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

Function _guess_source_root

library/python/runtime_py3/__res.py:113–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111
112
113def _guess_source_root():
114 path, tail = _os.getcwd(), 'start'
115
116 root = None
117 while tail:
118 guidence_file = _path_join(path, '.root.path')
119 if _path_isfile(guidence_file):
120 # return immediately when guidence file is found
121 return file_bytes(guidence_file, strip=True)
122
123 if _path_isfile(_path_join(path, '.arcadia.root')) and not root:
124 # save as a fallback but continue searching for a guidence file
125 # NOTE: .arcadia.root may be a symlink if it's set in DATA macros
126 # and it may be a regular file if ya:copydata tag is set
127 # in addition to that. So it's not very reliable.
128 root = _b(path)
129
130 path, tail = _path_split(path)
131 return root
132
133
134def _get_source_root():

Callers 1

_get_source_rootFunction · 0.85

Calls 1

file_bytesFunction · 0.85

Tested by

no test coverage detected