@contextlib.contextmanager
def work_in(dirname=None):
    curdir = os.getcwd()
    try:
        if dirname is not None:
            os.chdir(dirname)
        yield
    finally:
        os.chdir(curdir)
Context manager version of os.chdir. When exited, returns to the working
dataset/ETHPy150Open audreyr/cookiecutter/cookiecutter/utils.py/work_in