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

Method get_data

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

Source from the content-addressed store, hash-verified

397
398 # PEP-302 extension 1 of 3: data loader.
399 def get_data(self, path):
400 # XXX
401 # Python machinery operates on absolute paths and uses this method to load bytecode.
402 # That's why we don't try to resolve the path, but try to read it right away.
403 # For more info see get_code() in this file and
404 # data flow in SourceLoader.get_data in contrib/tools/python3/Lib/importlib/_bootstrap_external.py
405 if EXTERNAL_PY_FILES_MODE and path.endswith('.pyc'):
406 return file_bytes(_b(path))
407
408 path = _b(path)
409 abspath = resfs_resolve(path)
410
411 if abspath:
412 return file_bytes(abspath)
413
414 path = path.replace(_b('\\'), _b('/'))
415 data = resfs_read(path, builtin=True)
416 if data is None:
417 raise OSError(path) # Y_PYTHON_ENTRY_POINT=:resource_files
418 return data
419
420 # PEP-302 extension 2 of 3: get __file__ without importing.
421 def get_filename(self, fullname):

Callers 2

path_existsFunction · 0.80
open_source_from_loaderFunction · 0.80

Calls 4

file_bytesFunction · 0.85
resfs_resolveFunction · 0.85
resfs_readFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected