def feature(constant, fallback=None):
    def wrap(t):
        t.log_feature(constant)
        t._debug("Found feature: %s" % constant)
        if fallback:
            t._debug("Feature has fallback: %s" % repr(fallback))
        return lambda *a: fallback if fallback else {}

    return {'value': wrap,
            'return': lambda **kw: kw['traverser'].log_feature(constant)}
dataset/ETHPy150Open mozilla/app-validator/appvalidator/testcases/javascript/predefinedentities.py/feature/original