original_docstring: Give package where calling function is defined.
  
      :level: levels deep to look up the stack frame
      :return: a Python module (representing the ``__init__.py`` of a package)
      
docstring: Give package where calling function is defined.
docstring_tokens: Give package where calling function is defined .
code: def caller_package(level=2):
      """Give package where calling function is defined.
  
      :level: levels deep to look up the stack frame
      :return: a Python module (representing the ``__init__.py`` of a package)
      """
      # caller_module in arglist for tests
      module = caller_module(level + 1)
      f = getattr(module, "__file__", "")
      if ("__init__.py" in f) or ("__init__$py" in f):  # empty at >>>
          # Module is a package
          return module
      # Go up one level to get package
      package_name = module.__name__.rsplit(".", 1)[0]
      return sys.modules[package_name]
code_tokens: def caller_package ( level = 2 ) : module = caller_module ( level + 1 ) f = getattr ( module , "__file__" , "" ) if ( "__init__.py" in f ) or ( "__init__$py" in f ) : return module package_name = module . __name__ . rsplit ( "." , 1 ) [ 0 ] return sys . modules [ package_name ]
short_docstring: Give package where calling function is defined.
short_docstring_tokens: Give package where calling function is defined .
comment: """Give package where calling function is defined.
  
      :level: levels deep to look up the stack frame
      :return: a Python module (representing the ``__init__.py`` of a package)
      """$SEP$# caller_module in arglist for tests$SEP$# empty at >>>$SEP$# Module is a package$SEP$# Go up one level to get package