def _count_pylint_violations(report_file):
 num_violations_report = 0
 pylint_pattern = re.compile('.(\\d+):\\ \\[(\\D\\d+.+\\]).')
 for line in open(report_file):
  violation_list_for_line = pylint_pattern.split(line)
  if (len(violation_list_for_line) == 4):
   num_violations_report += 1
 return num_violations_report

def _count_pylint_violations ( report_file ) : num_violations_report = 0 pylint_pattern = re . compile ( '.(\\d+):\\ \\[(\\D\\d+.+\\]).' ) for line in open ( report_file ) : violation_list_for_line = pylint_pattern . split ( line ) if ( len ( violation_list_for_line ) == 4 ) : num_violations_report += 1 return num_violations_report
parses a pylint report line-by-line and determines the number of violations reported .