MCPcopy Create free account
hub / github.com/PRIME-RL/PRIME / chdir

Function chdir

eval/utils/execution_leetcode.py:645–656  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

643
644@contextlib.contextmanager
645def chdir(root):
646 if root == ".":
647 yield
648 return
649 cwd = os.getcwd()
650 os.chdir(root)
651 try:
652 yield
653 except BaseException as exc:
654 raise exc
655 finally:
656 os.chdir(cwd)
657
658
659def reliability_guard(maximum_memory_bytes: Optional[int] = None):

Callers 1

create_tempdirFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected