
from se_dict import SeDict
from symbolic.instrumentation import whichBranch
python_ord = ord

def se_ord(obj):
    __foo = hasattr(obj, """__ord__""")
    if __foo:
        whichBranch(True)
        return obj.__ord__()
    else:
        whichBranch(False)
        return python_ord(obj)
ord = se_ord

def mac_to_int(mac):
    value = 0
    for byte in mac:
        value = ((value << 8) | byte)
    return long(value)

def mac_to_str(a, _resolve_name=False):
    """ In pyswitch it is used only for logging """
    return repr(a)