Context manager that creates a temporary directory, and cleans it up
    when exiting.
    
    >>> with empty_directory():
    >>>     pass

def empty_directory(path=None):
    """
    Context manager that creates a temporary directory, and cleans it up
    when exiting.
    
    >>> with empty_directory():
    >>>     pass
    """
    install_dir = tempfile.mkdtemp(dir=path)
    try:
        yield install_dir
    finally:
        shutil.rmtree(install_dir)