def METHOD_NAME(ref):
    global cleaned_up
    caller_code = sys._getframe(1).f_code
    assert caller_code == _weakref_finalizer.__code__, "expected: '%s' but was '%s'" % (_weakref_finalizer.__code__, caller_code)
    cleaned_up = True