MCPcopy
hub / github.com/dmlc/dgl / setdir

Function setdir

tools/files.py:9–19  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

7
8@contextmanager
9def setdir(path):
10 try:
11 os.makedirs(path, exist_ok=True)
12 cwd = os.getcwd()
13 logging.info("Changing directory to %s" % path)
14 logging.info("Previously: %s" % cwd)
15 os.chdir(path)
16 yield
17 finally:
18 logging.info("Restoring directory to %s" % cwd)
19 os.chdir(cwd)

Callers 5

_chunk_graphFunction · 0.90
chunk_graphFunction · 0.90
random_partitionFunction · 0.90
_chunk_graphFunction · 0.90
chunk_graphFunction · 0.90

Calls 1

infoMethod · 0.80

Tested by 2

_chunk_graphFunction · 0.72
chunk_graphFunction · 0.72