docstr: Add the test rules subparser: manage.py test rules [options]
code: def _setup_test_rules_subparser(cls, subparsers):
      """Add the test rules subparser: manage.py test rules [options]"""
      test_rules_parser = generate_subparser(
          subparsers,
          "rules",
          description="Test rules using integration test files",
          subcommand=True,
      )
  
      # Flag to run additional stats during testing
      test_rules_parser.add_argument(
          "-s",
          "--stats",
          action="store_true",
          help="Enable outputing of statistical information on rules that run",
      )
  
      # Validate the provided repitition value
      def _validate_repitition(val):
          """Make sure the input is between 1 and 1000"""
          err = (
              "Invalid repitition value [{}]. Must be an integer between 1 "
              "and 1000"
          ).format(val)
          try:
              count = int(val)
          except TypeError:
              raise test_rules_parser.error(err)
  
          if not 1 <= count <= 1000:
              raise test_rules_parser.error(err)
  
          return count
  
      # flag to run these tests a given number of times
      test_rules_parser.add_argument(
          "-n",
          "--repeat",
          default=1,
          type=_validate_repitition,
          help="Number of times to repeat the tests, to be used as a form performance testing",
      )
  
      cls._add_default_test_args(test_rules_parser)
  
imports: import argparse
  import os
  import jmespath
  from mock import patch, MagicMock
  from streamalert.alert_processor import main
  from streamalert.alert_processor.helpers import compose_alert
  from streamalert.alert_processor.outputs.output_base import OutputDispatcher
  from streamalert.classifier import classifier
  from streamalert.rules_engine import rules_engine
  from streamalert.shared import rule
  from streamalert.shared.config import ConfigError
  from streamalert.shared.logger import get_logger
  from streamalert.shared.stats import RuleStatisticTracker
  from streamalert_cli.helpers import check_credentials
  from streamalert_cli.test.format import format_green, format_red, format_underline, format_yellow
  from streamalert_cli.test.mocks import LookupTableMocks, ThreatIntelMocks
  from streamalert_cli.test.event_file import TestEventFile
  from streamalert_cli.utils import CLICommand, DirectoryType, generate_subparser, UniqueSortedFileListAction, UniqueSortedListAction
label_desc: Use image node_id 3 for calling the TestCommand obj's underlying member method code with example usage: obj._setup_test_rules_subparser(cls, subparsers) and returns: count