code: def _parse_check(self, rule):
          
  
          # Handle the special constant-type checks
          for check_cls in (checks.FalseCheck, checks.TrueCheck):
              check = check_cls()
              if rule == str(check):
                  return check
  
          try:
              kind, match = rule.split(':', 1)
          except Exception:
              if self.raise_error:
                  raise InvalidRuleException(rule)
              else:
                  LOG.exception('Failed to understand rule %r', rule)
                  # If the rule is invalid, we'll fail closed
                  return checks.FalseCheck()
  
          if kind in checks.registered_checks:
              return checks.registered_checks[kind](kind, match)
          elif None in checks.registered_checks:
              return checks.registered_checks[None](kind, match)
          elif self.raise_error:
              raise InvalidRuleException(rule)
          else:
              LOG.error('No handler for matches of kind %r', kind)
              # If the rule is invalid, we'll fail closed
              return checks.FalseCheck()
docs: Parse a single base check rule into an appropriate Check object.