def check_file(self, filename):
    """Process python file looking for indications of problems.

    :param filename: (str) Python source filename
    :return: (int) number of failures
    """
    # If the user specifies an invalid severity use comment.
    log_threshold = Nit.SEVERITY.get(self.options.severity, Nit.COMMENT)

    failure_count = 0
    fail_threshold = Nit.WARNING if self.options.strict else Nit.ERROR

    for i, nit in enumerate(self.get_nits(filename)):
      if i == 0:
        print()  # Add an extra newline to clean up the output only if we have nits.
      if nit.severity >= log_threshold:
        print('{nit}\n'.format(nit=nit))
      if fail_threshold >= nit.severity:
        failure_count += 1
    return failure_count
dataset/ETHPy150Open pantsbuild/pants/contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/checker.py/PythonCheckStyleTask.check_file/swapped operands of `>=`