parameters: ()
docstring: Returns the module that's calling into this module.
  
    We generally use this function to get the name of the module calling a
    DEFINE_foo... function.
docstring_summary: Returns the module that's calling into this module.
docstring_tokens: Returns the module that s calling into this module .
function: def _GetCallingModuleObjectAndName():
    """Returns the module that's calling into this module.
  
    We generally use this function to get the name of the module calling a
    DEFINE_foo... function.
    """
    # Walk down the stack to find the first globals dict that's not ours.
    for depth in range(1, sys.getrecursionlimit()):
      if not sys._getframe(depth).f_globals is globals():
        globals_for_frame = sys._getframe(depth).f_globals
        module, module_name = _GetModuleObjectAndName(globals_for_frame)
        if module_name is not None:
          return module, module_name
    raise AssertionError("No module was found")
function_tokens: def _GetCallingModuleObjectAndName ( ) : # Walk down the stack to find the first globals dict that's not ours. for depth in range ( 1 , sys . getrecursionlimit ( ) ) : if not sys . _getframe ( depth ) . f_globals is globals ( ) : globals_for_frame = sys . _getframe ( depth ) . f_globals module , module_name = _GetModuleObjectAndName ( globals_for_frame ) if module_name is not None : return module , module_name raise AssertionError ( "No module was found" )