Translate all the lines of a single file

def filter_lines(input_file, output_file, translate=lambda line: line):
    """ Translate all the lines of a single file """
    filepath, lines = get_lines([input_file])[0]
    return filepath, [(tag, translate(line=line, tag=tag)) for (tag, line) in lines]