code: def run(args):
      it_config = get_yml_content(args.config)
      test_cases = it_config["testCases"]
  
      for test_case_id, test_case_config in enumerate(
          test_cases, start=1
      ):
          name = test_case_config["name"]
          print(GREEN + "=" * 80 + CLEAR)
          print("## {}Testing: {}{} ##".format(GREEN, name, CLEAR))
  
          # Print progress on devops
          print(
              f"##vso[task.setprogress value={int(test_case_id / len(test_cases) * 100)};]{name}"
          )
  
          if case_excluded(name, args.exclude):
              print("{} excluded".format(name))
              continue
          if args.cases and not case_included(name, args.cases):
              continue
  
          # fill test case default config
          for k in it_config["defaultTestCaseConfig"]:
              if k not in test_case_config:
                  test_case_config[k] = it_config[
                      "defaultTestCaseConfig"
                  ][k]
          print(json.dumps(test_case_config, indent=4))
  
          if not match_platform(test_case_config):
              print(
                  "skipped {}, platform {} not match [{}]".format(
                      name, sys.platform, test_case_config["platform"]
                  )
              )
              continue
  
          if not match_training_service(test_case_config, args.ts):
              print(
                  "skipped {}, training service {} not match [{}]".format(
                      name, args.ts, test_case_config["trainingService"]
                  )
              )
              continue
  
          if args.ts == "remote":
              if not match_remoteConfig(
                  test_case_config, args.nni_source_dir
              ):
                  print(
                      "skipped {}, remoteConfig not match.".format(name)
                  )
                  continue
  
          # remote mode need more time to cleanup
          if args.ts == "remote" or args.ts == "hybrid":
              wait_for_port_available(8080, 240)
              wait_for_port_available(
                  8081, 240
              )  # some training services need one more port to listen metrics
  
          # adl mode need more time to cleanup PVC
          if args.ts == "adl" and name == "nnictl-resume-2":
              time.sleep(30)
  
          begin_time = time.time()
  
          run_test_case(test_case_config, it_config, args)
          print(
              "{}Test {}: TEST PASS IN {} SECONDS{}\n\n".format(
                  GREEN, name, int(time.time() - begin_time), CLEAR
              ),
              flush=True,
          )
  
imports: import argparse
  import datetime
  import json
  import os
  import subprocess
  import sys
  import time
  import yaml
  import validators
  from utils import CLEAR, EXPERIMENT_URL, GREEN, RED, REST_ENDPOINT, STATUS_URL, TRIAL_JOBS_URL, deep_update, dump_yml_content, get_experiment_dir, get_experiment_id, get_experiment_status, get_failed_trial_jobs, get_trial_stats, get_yml_content, parse_max_duration_time, print_experiment_log, print_trial_job_log, wait_for_port_available
label_desc: Use image node_id 13 for calling a global function with example usage: run(args) without return types