def insert_before_extension(filename, content):
parts = list(os.path.splitext(filename))<EOL>parts[<NUM_LIT:1>:<NUM_LIT:1>] = [content]<EOL>return '<STR_LIT>'.join(parts)<EOL>
Given a filename and some content, insert the content just before
the extension.

>>> insert_before_extension('pages.pdf', '-old')
'pages-old.pdf'