@contextmanager<EOL>def _tmp_html(data):
filepath = '<STR_LIT>'<EOL>try:<EOL><INDENT>fid, filepath = tempfile.mkstemp(suffix='<STR_LIT>', prefix='<STR_LIT>')<EOL>os.write(fid, data.encode('<STR_LIT:utf8>'))<EOL>os.close(fid)<EOL>yield filepath<EOL><DEDENT>finally:<EOL><INDENT>if os.path.isfile(filepath):<EOL><INDENT>os.remove(filepath)<EOL><DEDENT><DEDENT>
Yields the path of a temporary HTML file containing data.