def _PrintSummary(paths, error_records):
  """Print a summary of the number of errors and files."""

  error_count = len(error_records)
  all_paths = set(paths)
  all_paths_count = len(all_paths)

  if error_count is 0:
    print '%d files checked, no errors found.' % all_paths_count

  new_error_count = len([e for e in error_records if e.new_error])

  error_paths = set([e.path for e in error_records])
  error_paths_count = len(error_paths)
  no_error_paths_count = all_paths_count - error_paths_count

  if (error_count or new_error_count) and not FLAGS.quiet:
    error_noun = 'error' if error_count == 1 else 'errors'
    new_error_noun = 'error' if new_error_count == 1 else 'errors'
    error_file_noun = 'file' if error_paths_count == 1 else 'files'
    ok_file_noun = 'file' if no_error_paths_count == 1 else 'files'
    print ('Found %d %s, including %d new %s, in %d %s (%d %s OK).' %
           (error_count,
            error_noun,
            new_error_count,
            new_error_noun,
            error_paths_count,
            error_file_noun,
            no_error_paths_count,
            ok_file_noun))
dataset/ETHPy150Open google/closure-linter/closure_linter/gjslint.py/_PrintSummary/original