def _create_binary_trigger(trigger):
    """Create an 8-bit binary trigger from an InputTrigger, TrueTrigger, FalseTrigger."""

    ops = {
        0: ">",
        1: "<",
        2: ">=",
        3: "<=",
        4: "==",
        5: 'always'
    }

    op_codes = {y: x for x, y in ops.items()}
    source = 0

    if isinstance(trigger, TrueTrigger):
        op_code = op_codes['always']
    elif isinstance(trigger, FalseTrigger):
        raise ArgumentError("Cannot express a never trigger in binary descriptor", trigger=trigger)
    else:
        op_code = op_codes[trigger.comp_string]

        if trigger.use_count:
            source = 1

    return (op_code << 1) | source
Create an 8-bit binary trigger from an InputTrigger, TrueTrigger, FalseTrigger.