intent: How to replace (or strip) an extension from a filename in Python?
rewritten_intent: replace extension '.txt' in basename '/home/user/somefile.txt' with extension '.jpg'
snippet: print(os.path.splitext('/home/user/somefile.txt')[0] + '.jpg')