MCPcopy Index your code
hub / github.com/RustPython/RustPython / load

Method load

Lib/importlib/metadata/__init__.py:173–181  ·  view source on GitHub ↗

Load the entry point from its definition. If only a module is indicated by the value, return that module. Otherwise, return the named object.

(self)

Source from the content-addressed store, hash-verified

171 vars(self).update(name=name, value=value, group=group)
172
173 def load(self) -> Any:
174 """Load the entry point from its definition. If only a module
175 is indicated by the value, return that module. Otherwise,
176 return the named object.
177 """
178 match = cast(Match, self.pattern.match(self.value))
179 module = import_module(match.group('module'))
180 attrs = filter(None, (match.group('attr') or '').split('.'))
181 return functools.reduce(getattr, attrs, module)
182
183 @property
184 def module(self) -> str:

Callers 2

Calls 7

castFunction · 0.90
import_moduleFunction · 0.90
filterFunction · 0.85
matchMethod · 0.45
groupMethod · 0.45
splitMethod · 0.45
reduceMethod · 0.45

Tested by 2