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

Method __init__

library/python/runtime_py3/__res.py:548–565  ·  view source on GitHub ↗
(self, source_root)

Source from the content-addressed store, hash-verified

546 S_IFDIR = 0o040000
547
548 def __init__(self, source_root):
549 self.source_root = source_root
550 self.module_path_cache = {'': set()}
551 for key, dirty_path in iter_keys(self.NAMESPACE_PREFIX):
552 # dirty_path contains unique prefix to prevent repeatable keys in the resource storage
553 path = dirty_path.split(b'/', 1)[1]
554 namespaces = find(key).split(b':')
555 for n in namespaces:
556 package_name = _s(n.rstrip(b'.'))
557 self.module_path_cache.setdefault(package_name, set()).add(_s(path))
558 # Fill parents with default empty path set if parent doesn't exist in the cache yet
559 while package_name:
560 package_name = package_name.rpartition('.')[0]
561 if package_name in self.module_path_cache:
562 break
563 self.module_path_cache.setdefault(package_name, set())
564 for package_name in self.module_path_cache.keys():
565 self._add_parent_dirs(package_name, visited=set())
566
567 def get_module_path(self, fullname):
568 """

Callers

nothing calls this directly

Calls 6

_add_parent_dirsMethod · 0.95
iter_keysFunction · 0.85
setFunction · 0.50
findFunction · 0.50
splitMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected