def determineDefaultFunctionName():
    """
    Return the string used by Python as the name for code objects which are
    compiled from interactive input or at the top-level of modules.
    """
    try:
        1 // 0
    except:
        # The last frame is this function.  The second to last frame is this
        # function's caller, which is module-scope, which is what we want,
        # so -2.
        return traceback.extract_stack()[-2][2]

    Return the string used by Python as the name for code objects which are
    compiled from interactive input or at the top-level of modules.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_manhole.py