<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def total_num_violations(self):
 """ Returns the total number of lines in the diff that are in violation. """


        return sum(
            len(summary.lines)
            for summary
            in self._diff_violations().values()
        )