code: def _module_to_load(name):
      is_reload = name in sys.modules
  
      module = sys.modules.get(name)
      if not is_reload:
          # This must be done before open() is called as the 'io' module
          # implicitly imports 'locale' and would otherwise trigger an
          # infinite loop.
          module = type(sys)(name)
          # This must be done before putting the module in sys.modules
          # (otherwise an optimization shortcut in import.c becomes wrong)
          module.__initializing__ = True
          sys.modules[name] = module
      try:
          yield module
      except Exception:
          if not is_reload:
              try:
                  del sys.modules[name]
              except KeyError:
                  pass
      finally:
          module.__initializing__ = False
  
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 5 for calling a global function with example usage: _module_to_load(name) without return types