code: def deep_reload_hook(m):
      """Replacement for reload()."""
      # Hardcode this one  as it would raise a NotImplementedError from the
      # bowels of Python and screw up the import machinery after.
      # unlike other imports the `exclude` list already in place is not enough.
  
      if m is types:
          return m
      if not isinstance(m, ModuleType):
          raise TypeError("reload() argument must be module")
  
      name = m.__name__
  
      if name not in sys.modules:
          raise ImportError(
              "reload(): module %.200s not in sys.modules" % name
          )
  
      global modules_reloading
      try:
          return modules_reloading[name]
      except:
          modules_reloading[name] = m
  
      try:
          newm = importlib.reload(m)
      except:
          sys.modules[name] = m
          raise
      finally:
          modules_reloading.clear()
      return newm
  
file_path: catboost/contrib/python/ipython/py3/IPython/lib/deepreload.py
imports: import builtins
  from contextlib import contextmanager
  import importlib
  import sys
  from types import ModuleType
  from warnings import warn
  import types
label_desc: Use image node_id 8 for calling a global function with example usage: deep_reload_hook(m) and returns: newm, m, modules_reloading