def _find_function_module(func):
    if hasattr(func, '__module__'):
        return func.__module__
    try:
        module = inspect.getmodule(func)
        if module: return module.__name__
    except KeyboardInterrupt: raise
    except: pass

    # This fallback shouldn't usually be needed.  But it is needed in
    # a couple special cases (including using epydoc to document
    # itself).  In particular, if a module gets loaded twice, using
    # two different names for the same file, then this helps.
    for module in sys.modules.values():
        if (hasattr(module, '__dict__') and
            hasattr(func, 'func_globals') and
            func.func_globals is module.__dict__):
            return module.__name__
    return None

#////////////////////////////////////////////////////////////
# Introspection Dispatch Table
#////////////////////////////////////////////////////////////
Backtracking
dataset/ETHPy150Open CollabQ/CollabQ/vendor/epydoc/docintrospecter.py/_find_function_module--crossover with--dataset/ETHPy150Open algorhythms/LeetCode/306 Additive Number.py/Solution.isAdditiveNumber