def tmpdir(prefix='<STR_LIT>', delete=True):
path = tempfile.mkdtemp(prefix=prefix)<EOL>if not os.path.isdir(path): raise ValueError('<STR_LIT>')<EOL>if delete: atexit.register(shutil.rmtree, path)<EOL>return path<EOL>
tmpdir() creates a temporary directory and yields its path. At python exit, the directory and
  all of its contents are recursively deleted (so long as the the normal python exit process is
  allowed to call the atexit handlers).
tmpdir(prefix) uses the given prefix in the tempfile.mkdtemp() call.

The option delete may be set to False to specify that the tempdir should not be deleted on exit.