def get_meth_func(obj):
    if PY2:
        # Python 2
        return obj.im_func
    else:
        # Python 3
        return obj.__func__
Patch the given "thing", and revert the patch on test teardown.
dataset/ETHPy150Open winpython/winpython/winpython/py3compat.py/get_meth_func--crossover with--dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/tests/test_utils.py/TestValidationAnnotatorBase.patch