@contextmanager<EOL>def temp_dir():
path = tempfile.mkdtemp()<EOL>try:<EOL><INDENT>yield path<EOL><DEDENT>finally:<EOL><INDENT>shutil.rmtree(path)<EOL><DEDENT>
Create a temporary folder for the duration of this context manager,
    deleting it afterwards.

    Yields:
        str - path to the temporary folder