def mutate_file(backup, context):
with open(context.filename) as f:<EOL><INDENT>code = f.read()<EOL><DEDENT>context.source = code<EOL>if backup:<EOL><INDENT>with open(context.filename + '<STR_LIT>', '<STR_LIT:w>') as f:<EOL><INDENT>f.write(code)<EOL><DEDENT><DEDENT>result, number_of_mutations_performed = mutate(context)<EOL>with open(context.filename, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(result)<EOL><DEDENT>return number_of_mutations_performed<EOL>
:type backup: bool
:type context: Context