@contextmanager
def from_dir(cwd):
    import os
    curdir = os.getcwd()
    try:
        os.chdir(cwd)
        yield
    finally:
        os.chdir(curdir)
Context manager to ensure in the cwd directory.
dataset/ETHPy150Open hayd/pep8radius/pep8radius/shell.py/from_dir