@contextlib.contextmanager<EOL>def _create_tempfile(content=None):
<EOL>file_handle, tmp = tempfile.mkstemp()<EOL>if content:<EOL><INDENT>if sys.version_info >= (<NUM_LIT:3>, <NUM_LIT:0>):<EOL><INDENT>write(file_handle, bytes(content, "<STR_LIT:ascii>"))<EOL><DEDENT>else:<EOL><INDENT>write(file_handle, content)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>yield tmp<EOL><DEDENT>finally:<EOL><INDENT>close(file_handle)<EOL>remove(tmp)<EOL><DEDENT>
Create a new temporary file.

    If *content* parameter is given, then it will be written
    in the temporary file, before passing it back.
    This is a context manager and should be used with a *with* statement.