class_docstr: Base class to help with creating importer mocks.
code: def __init__(self, *names, module_code={}):
      self.modules = {}
      self.module_code = {}
      for name in names:
          if not name.endswith(".__init__"):
              import_name = name
          else:
              import_name = name[: -len(".__init__")]
          if "." not in name:
              package = None
          elif import_name == name:
              package = name.rsplit(".", 1)[0]
          else:
              package = import_name
          module = types.ModuleType(import_name)
          module.__loader__ = self
          module.__file__ = "<mock __file__>"
          module.__package__ = package
          module.attr = name
          if import_name != name:
              module.__path__ = ["<mock __path__>"]
          self.modules[import_name] = module
          if import_name in module_code:
              self.module_code[import_name] = module_code[import_name]
  
imports: import builtins
  import contextlib
  import errno
  import functools
  from importlib import machinery, util, invalidate_caches
  import marshal
  import os
  import os.path
  from test.support import import_helper
  from test.support import os_helper
  import unittest
  import sys
  import tempfile
  import types
label_desc: Use image node_id 1 to create a new _ImporterMock object  with example: obj = _ImporterMock()