MCPcopy Create free account
hub / github.com/catboost/catboost / __init__

Method __init__

library/python/runtime_py3/__res.py:295–313  ·  view source on GitHub ↗
(self, fullname, path)

Source from the content-addressed store, hash-verified

293 """
294
295 def __init__(self, fullname, path):
296 super().__init__(fullname, path)
297 self.memory = set(iter_py_modules()) # Set of importable module names.
298 self._source_name = {} # Map from original to altered module names.
299 self._package_prefix = ''
300
301 self._before_import_callback = None
302 self._after_import_callback = None
303
304 if Y_PYTHON_SOURCE_ROOT and Y_PYTHON_EXTENDED_SOURCE_SEARCH:
305 self.arcadia_source_finder = ArcadiaSourceFinder(_s(Y_PYTHON_SOURCE_ROOT))
306 else:
307 self.arcadia_source_finder = None
308
309 for p in list(self.memory) + list(sys.builtin_module_names):
310 for pp in iter_prefixes(p):
311 k = pp + '.__init__'
312 if k not in self.memory:
313 self.memory.add(k)
314
315 def set_callbacks(self, before_import=None, after_import=None):
316 """Callable[[module], None]"""

Callers

nothing calls this directly

Calls 6

iter_py_modulesFunction · 0.85
ArcadiaSourceFinderClass · 0.85
iter_prefixesFunction · 0.85
setFunction · 0.50
listClass · 0.50
addMethod · 0.45

Tested by

no test coverage detected