class_docstr: the magical lazy-loading module standing
class_docstr_tok: ["the","magical","lazy-loading","module","standing"]
code: def __init__(self, name, importspec, implprefix=None, attr=None):
      self.__name__ = name
      self.__all__ = [x for x in importspec if x != "__onfirstaccess__"]
      self.__map__ = {}
      self.__implprefix__ = implprefix or name
      if attr:
          for name, val in attr.items():
              # print "setting", self.__name__, name, val
              setattr(self, name, val)
      for name, importspec in importspec.items():
          if isinstance(importspec, dict):
              subname = "{}.{}".format(self.__name__, name)
              apimod = ApiModule(subname, importspec, implprefix)
              sys.modules[subname] = apimod
              setattr(self, name, apimod)
          else:
              parts = importspec.split(":")
              modpath = parts.pop(0)
              attrname = parts and parts[0] or ""
              if modpath[0] == ".":
                  modpath = implprefix + modpath
  
              if not attrname:
                  subname = "{}.{}".format(self.__name__, name)
                  apimod = AliasModule(subname, modpath)
                  sys.modules[subname] = apimod
                  if "." not in name:
                      setattr(self, name, apimod)
              else:
                  self.__map__[name] = (modpath, attrname)
  
file_path: catboost/contrib/python/py/py3/py/_vendored_packages/apipkg/__init__.py
imports: import os
  import sys
  from types import ModuleType
  from .version import version
label_desc: Use image node_id 3 to create a new ApiModule object from inherited base classes: ModuleType with example: obj = ApiModule(name, importspec, implprefix, attr)