code: def test_api(collection):
      os.chdir(TEST_DIR)
      ALL_DIRS = [
          MODEL_STORE_DIR,
          ARTIFACTS_MANAGEMENT_DIR,
          ARTIFACTS_INFERENCE_DIR,
          ARTIFACTS_EXPLANATION_DIR,
          ARTIFACTS_INCRSD_TIMEOUT_INFERENCE_DIR,
          ARTIFACTS_HTTPS_DIR,
          ARTIFACTS_MANAGEMENT_DIR_KF,
          ARTIFACTS_INFERENCE_DIR_KF,
          ARTIFACTS_INCRSD_TIMEOUT_INFERENCE_DIR_KF,
          ARTIFACTS_HTTPS_DIR_KF,
          ARTIFACTS_INFERENCE_DIR_KFV2,
          ARTIFACTS_INCRSD_TIMEOUT_INFERENCE_DIR_KFV2,
          ARTIFACTS_HTTPS_DIR_KFV2,
          ARTIFACTS_WORKFLOW_MANAGEMENT_DIR,
          ARTIFACTS_WORKFLOW_INFERENCE_DIR,
      ]
  
      for DIR in ALL_DIRS:
          shutil.rmtree(DIR, True)
          os.makedirs(DIR, exist_ok=True)
  
      switcher = {
          "management": trigger_management_tests,
          "management_kf": trigger_management_tests_kf,
          "inference": trigger_inference_tests,
          "inference_kf": trigger_inference_tests_kf,
          "inference_kfv2": trigger_inference_tests_kfv2,
          "explanation": trigger_explanation_tests,
          "increased_timeout_inference": trigger_incr_timeout_inference_tests,
          "https": trigger_https_tests,
          "https_kf": trigger_https_tests_kf,
          "https_kfv2": trigger_https_tests_kfv2,
          "all": trigger_all,
      }
  
      exit_code = switcher[collection]()
      os.chdir(REPO_ROOT)
  
      if exit_code != 0:
          sys.exit("## Newman API Tests Failed !")
  
imports: import glob
  import os
  import shutil
  import sys
  from ts_scripts import tsutils
label_desc: Use image node_id 16 for calling a global function with example usage: test_api(collection) without return types