code: def module_for_loader(fxn):
      """Decorator to handle selecting the proper module for loaders.
  
      The decorated function is passed the module to use instead of the module
      name. The module passed in to the function is either from sys.modules if
      it already exists or is a new module. If the module is new, then __name__
      is set the first argument to the method, __loader__ is set to self, and
      __package__ is set accordingly (if self.is_package() is defined) will be set
      before it is passed to the decorated function (if self.is_package() does
      not work for the module it will be set post-load).
  
      If an exception is raised and the decorator created the module it is
      subsequently removed from sys.modules.
  
      The decorator assumes that the decorated function takes the module name as
      the second argument.
  
      """
      warnings.warn(
          "The import system now takes care of this automatically; "
          "this decorator is slated for removal in Python 3.12",
          DeprecationWarning,
          stacklevel=2,
      )
  
      @functools.wraps(fxn)
      def module_for_loader_wrapper(self, fullname, *args, **kwargs):
          with _module_to_load(fullname) as module:
              module.__loader__ = self
              try:
                  is_package = self.is_package(fullname)
              except (ImportError, AttributeError):
                  pass
              else:
                  if is_package:
                      module.__package__ = fullname
                  else:
                      module.__package__ = fullname.rpartition(".")[0]
              # If __package__ was not set above, __import__() will do it later.
              return fxn(self, module, *args, **kwargs)
  
      return module_for_loader_wrapper
  
imports: from ._abc import Loader
  from ._bootstrap import module_from_spec
  from ._bootstrap import _resolve_name
  from ._bootstrap import spec_from_loader
  from ._bootstrap import _find_spec
  from ._bootstrap_external import MAGIC_NUMBER
  from ._bootstrap_external import _RAW_MAGIC_NUMBER
  from ._bootstrap_external import cache_from_source
  from ._bootstrap_external import decode_source
  from ._bootstrap_external import source_from_cache
  from ._bootstrap_external import spec_from_file_location
  from contextlib import contextmanager
  import _imp
  import functools
  import sys
  import types
  import warnings
label_desc: Use image node_id 8 for calling a global function with example usage: module_for_loader(fxn) and returns: module_for_loader_wrapper, fxn