def CheckHealth(self, sanity_checks=None, fast_check=False, final_check=False, port_check=False):
    """Qualify a nameserver to see if it is any good."""

    is_fatal = False
    if fast_check:
      tests = [(self.TestARootServerResponse, [])]
      is_fatal = True
      sanity_checks = []
    elif final_check:
      tests = [(self.TestWwwNegativeResponse, []), (self.TestNodeId, [])]
    elif port_check:
      tests = [(self.TestNodeId, [])]
    else:
      # Put the bind version here so that we have a great minimum latency measurement.
      tests = [(self.TestNegativeResponse, []), (self.TestBindVersion, [])]

    if sanity_checks:
      for (check, expected_value) in sanity_checks:
        (req_type, req_name) = check.split(' ')
        expected_values = expected_value.split(',')
        tests.append((self.TestAnswers, [req_type.upper(), req_name, expected_values]))

    for test in tests:
      (function, args) = test
      (is_broken, warning, duration) = function(*args)
      if args:
        test_name = args[1]
      else:
        test_name = function.__name__

      self.checks.append((test_name, is_broken, warning, duration))
      if is_broken:
        self.AddFailure('%s: %s' % (test_name, warning), fatal=is_fatal)
      if warning:
        # Special case for NXDOMAIN de-duplication
        if not ('NXDOMAIN' in warning and 'NXDOMAIN Hijacking' in self.warnings):
          self.AddWarning(warning)
      if self.is_disabled:
        break

    return self.is_disabled
dataset/ETHPy150Open catap/namebench/libnamebench/health_checks.py/NameServerHealthChecks.CheckHealth/original