MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / cd

Function cd

imperative/python/megengine/hub/tools.py:32–43  ·  view source on GitHub ↗

Changes current directory to target. Args: target: target directory.

(target: str)

Source from the content-addressed store, hash-verified

30
31@contextmanager
32def cd(target: str) -> Iterator[None]:
33 """Changes current directory to target.
34
35 Args:
36 target: target directory.
37 """
38 prev = os.getcwd()
39 os.chdir(os.path.expanduser(target))
40 try:
41 yield
42 finally:
43 os.chdir(prev)

Callers 2

_get_repoFunction · 0.85
fetchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected