def main(unused_argv):
  sample_data = {}

  tests = GroupRegressionTestsByHandler()
  for handler, test_classes in tests.items():

    for test_class in sorted(test_classes, key=lambda cls: cls.__name__):
      if flags.FLAGS.tests and flags.FLAGS.tests not in test_class.__name__:
        continue

      test_instance = test_class()

      # Recreate a new data store each time.
      startup.TestInit()
      try:
        test_instance.setUp()

        test_instance.Run()
        sample_data.setdefault(handler, []).extend(test_instance.checks)
      finally:
        try:
          test_instance.tearDown()
        except Exception:  # pylint: disable=broad-except
          pass

  encoded_sample_data = json.dumps(
      sample_data, indent=2, sort_keys=True, separators=(",", ": "),
      cls=http_api.JSONEncoderWithRDFPrimitivesSupport)
  print encoded_sample_data
dataset/ETHPy150Open google/grr/grr/gui/api_handlers_regression_data_generate.py/main/swapped operands of `not in`