@staticmethod
    def coerce(a, b):
        if isinstance(a, string_types) and isinstance(b, string_types):
            return sort_normalize_string(a), sort_normalize_string(b)
        if type(a) is type(b):
            return a, b
        if isinstance(a, Undefined) or isinstance(b, Undefined):
            if isinstance(a, Undefined):
                a = None
            if isinstance(b, Undefined):
                b = None
            return a, b
        if isinstance(a, (int, long, float)):
            try:
                return a, type(a)(b)
            except (__HOLE__, TypeError, OverflowError):
                pass
        if isinstance(b, (int, long, float)):
            try:
                return type(b)(a), b
            except (ValueError, TypeError, OverflowError):
                pass
        return a, b
dataset/ETHPy150Open lektor/lektor/lektor/db.py/_CmpHelper.coerce