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

Function resfs_read

library/python/runtime_py3/__res.py:259–273  ·  view source on GitHub ↗

Return the bytes of the resource file at path, or None. If builtin is True, do not look for it on the filesystem. If builtin is False, do not look in the builtin resources.

(path, builtin=None)

Source from the content-addressed store, hash-verified

257
258
259def resfs_read(path, builtin=None):
260 """
261 Return the bytes of the resource file at path, or None.
262 If builtin is True, do not look for it on the filesystem.
263 If builtin is False, do not look in the builtin resources.
264 """
265 if builtin is not True:
266 arcpath = resfs_src(path, resfs_file=True)
267 if arcpath:
268 fspath = resfs_resolve(arcpath)
269 if fspath:
270 return file_bytes(fspath)
271
272 if builtin is not False:
273 return find(b'resfs/file/' + _b(path))
274
275
276def resfs_files(prefix=b''):

Callers 5

read_textMethod · 0.90
_init_prefixesMethod · 0.90
get_dataMethod · 0.85
get_sourceMethod · 0.85
get_codeMethod · 0.85

Calls 4

resfs_srcFunction · 0.85
resfs_resolveFunction · 0.85
file_bytesFunction · 0.85
findFunction · 0.50

Tested by

no test coverage detected