def modified_lines(filename, extra_data, commit=None):
if extra_data is None:<EOL><INDENT>return []<EOL><DEDENT>if extra_data != '<STR_LIT:M>':<EOL><INDENT>return None<EOL><DEDENT>command = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:0>']<EOL>if commit:<EOL><INDENT>command.append('<STR_LIT>' % commit)<EOL><DEDENT>command.append(filename)<EOL>diff_lines = subprocess.check_output(command).split(<EOL>os.linesep.encode('<STR_LIT:utf-8>'))<EOL>diff_line_numbers = utils.filter_lines(<EOL>diff_lines,<EOL>br'<STR_LIT>',<EOL>groups=('<STR_LIT>', '<STR_LIT>'))<EOL>modified_line_numbers = []<EOL>for start_line, lines in diff_line_numbers:<EOL><INDENT>start_line = int(start_line)<EOL>lines = int(lines)<EOL>modified_line_numbers.extend(range(start_line, start_line + lines))<EOL><DEDENT>return modified_line_numbers<EOL>
Returns the lines that have been modifed for this file.

    Args:
      filename: the file to check.
      extra_data: is the extra_data returned by modified_files. Additionally, a
        value of None means that the file was not modified.
      commit: the complete sha1 (40 chars) of the commit. Note that specifying
        this value will only work (100%) when commit == last_commit (with
        respect to the currently checked out revision), otherwise, we could miss
        some lines.

    Returns: a list of lines that were modified, or None in case all lines are
      new.