MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _load

Method _load

tensorpack/utils/develop.py:161–171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

159 super(LazyLoader, self).__init__(name)
160
161 def _load(self):
162 # Import the target module and insert it into the parent's namespace
163 module = importlib.import_module(self.__name__)
164 self._parent_module_globals[self._local_name] = module
165
166 # Update this object's dict so that if someone keeps a reference to the
167 # LazyLoader, lookups are efficient (__getattr__ is only called on lookups
168 # that fail).
169 self.__dict__.update(module.__dict__)
170
171 return module
172
173 def __getattr__(self, item):
174 module = self._load()

Callers 2

__getattr__Method · 0.95
__dir__Method · 0.95

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected