@contextlib.contextmanager
def temporary_directory():
    temp_dir = tempfile.mkdtemp()
    try:
        yield temp_dir
    finally:
        shutil.rmtree(temp_dir)
Context manager to create and clean up a temporary directory.
dataset/ETHPy150Open enthought/traits/traits/etsconfig/tests/test_etsconfig.py/temporary_directory