@contextmanager<EOL>def ensure_clean_dir():
directory_name = tempfile.mkdtemp(suffix='<STR_LIT>')<EOL>try:<EOL><INDENT>yield directory_name<EOL><DEDENT>finally:<EOL><INDENT>try:<EOL><INDENT>rmtree(directory_name)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
Get a temporary directory path and agrees to remove on close.

Yields
------
Temporary directory path