def METHOD_NAME(val):
    if isinstance(val, (datetime.datetime, datetime.date)):
        return datetime.datetime.max - val
    elif isinstance(val, numbers.Number):
        return 10 ** 20
    elif val is None or isinstance(val, bool):
        return not val
    else:
        raise Exception("%r has uninversable type: %s" % (val, type(val)))