MCPcopy Create free account
hub / github.com/huggingface/evaluate / chdir

Function chdir

metrics/code_eval/execute.py:144–155  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

142
143@contextlib.contextmanager
144def chdir(root):
145 if root == ".":
146 yield
147 return
148 cwd = os.getcwd()
149 os.chdir(root)
150 try:
151 yield
152 except BaseException as exc:
153 raise exc
154 finally:
155 os.chdir(cwd)
156
157
158def reliability_guard(maximum_memory_bytes=None):

Callers 1

create_tempdirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…