class_docstr: TestResult contains information useful for tracking test results
class_docstr_tok: ["TestResult","contains","information","useful","for","tracking","test","results"]
code: def _format_rules(self, items, compare_set):
      if not items:
          return self._NONE_STRING
  
      all_rules = set(rule.Rule.rule_names())
  
      result = []
      for value in sorted(items):
          if value not in all_rules:
              value = "{} (does not exist)".format(value)
  
          result.append(
              format_red(value) if value not in compare_set else value
          )
      return ", ".join(result)
  
imports: from collections import defaultdict
  import textwrap
  from streamalert.shared import rule
  from streamalert.shared.logger import get_logger
  from streamalert_cli.test.event import TestEvent
  from streamalert_cli.test.format import format_green, format_red, format_underline
label_desc: Use image node_id 12 for calling the TestResult obj's underlying member method code with example usage: obj._format_rules(items, compare_set) and returns: str, self