intent: Prepend a line to an existing file in Python
rewritten_intent: prepend the line '#test firstline\n' to the contents of file 'infile' and save as the file 'outfile'
snippet: open('outfile', 'w').write('#test firstline\n' + open('infile').read())