MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / chdir

Class chdir

python/graphvite/util.py:69–84  ·  view source on GitHub ↗

Context manager for working directory. Parameters: dir (str): new working directory

Source from the content-addressed store, hash-verified

67
68
69class chdir(object):
70 """
71 Context manager for working directory.
72
73 Parameters:
74 dir (str): new working directory
75 """
76 def __init__(self, dir):
77 self.dir = dir
78
79 def __enter__(self):
80 self.old_dir = os.getcwd()
81 os.chdir(self.dir)
82
83 def __exit__(self, *args):
84 os.chdir(self.old_dir)
85
86
87class SharedNDArray(np.memmap):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected