def get_inverse(val):
    if isinstance(val, (datetime.datetime, datetime.date)):
        return datetime.datetime.max - val
    elif isinstance(val, numbers.Number):
        return 10 ** 20
    elif isinstance(val, (types.NoneType, bool)):
        return not val
    else:
        raise Exception("%r has uninversable type: %s" % (val, type(val)))
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/casexml/apps/case/templatetags/case_tags.py/get_inverse/original