def METHOD_NAME():
  """Executes tests.
  Return codes:
    0 if all tests passed, 1 otherwise
    2 if no tests were found
  """
  parser = argparse.ArgumentParser("Notebook test runner")
  # TODO: for environments with multiple kernels, add kernel name
  parser.add_argument("suites", nargs="*")
  parser.add_argument("--single-test")
  parser.add_argument(
      "--timeout-secs",
      type=int,
      default=30,
      help="The time to wait (in seconds) for output from the execution of a "
      "cell.")
  args = parser.parse_args()
  if args.single_test:
    specs = [args.single_test]
  else:
    specs = itertools.chain.from_iterable([
        glob.iglob("{}/**.spec".format(suite), recursive=True)
        for suite in args.suites
    ])
  total_test_count = 0
  total_error_count = 0
  total_errors = []
  for spec in specs:
    test_count, error_count, errors = Executor(
        spec, args.timeout_secs).execute_tests()
    total_test_count += test_count
    total_error_count += error_count
    if errors:
      total_errors.append((spec, errors))
  if total_test_count == 0:
    print("No tests were found.")
    sys.exit(2)
  print("{} errors in {} tests.\n".format(total_error_count, total_test_count))
  if total_error_count:
    for spec, errors in total_errors:
      print("In spec {}:".format(spec))
      for info, error in errors.items():
        cell_num, cls, setup = info
        print("\tCell {} [{}: {}]: {}".format(cell_num, cls, setup, error))
      print("\n")
  ret_code = 0 if total_error_count == 0 else 1
  sys.exit(ret_code)