code: def invoke_validator(
      test_case_config, nni_source_dir, training_service
  ):
      validator_config = test_case_config.get("validator")
      if (
          validator_config is None
          or validator_config.get("class") is None
      ):
          return
  
      validator = validators.__dict__[validator_config.get("class")]()
      kwargs = validator_config.get("kwargs", {})
      print("kwargs:", kwargs)
      experiment_id = get_experiment_id(EXPERIMENT_URL)
      try:
          validator(
              REST_ENDPOINT,
              get_experiment_dir(EXPERIMENT_URL),
              nni_source_dir,
              **kwargs,
          )
      except:
          print_experiment_log(experiment_id=experiment_id)
          print_trial_job_log(training_service, TRIAL_JOBS_URL)
          raise
  
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 4 for calling a global function with example usage: invoke_validator(test_case_config, nni_source_dir, training_service) without return types