code: def prepare_config_file(test_case_config, it_config, args):
      config_path = args.nni_source_dir + test_case_config["configFile"]
      test_yml_config = get_yml_content(config_path)
  
      # apply test case specific config
      if test_case_config.get("config") is not None:
          deep_update(test_yml_config, test_case_config["config"])
  
      # hack for windows
      # We've only got windows local and remote win-to-win now.
      if sys.platform == "win32":
          test_yml_config["trial"]["command"] = test_yml_config[
              "trial"
          ]["command"].replace("python3", "python")
  
      # apply training service config
      # user's gpuNum, logCollection config is overwritten by the config in training_service.yml
      # the hack for kubeflow should be applied at last step
      update_training_service_config(
          test_yml_config,
          args.ts,
          test_case_config["configFile"],
          args.nni_source_dir,
          args.reuse_mode,
      )
  
      # generate temporary config yml file to launch experiment
      new_config_file = config_path + ".tmp"
      dump_yml_content(new_config_file, test_yml_config)
      print(
          yaml.safe_dump(test_yml_config, default_flow_style=False),
          flush=True,
      )
  
      return new_config_file
  
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 2 for calling a global function with example usage: prepare_config_file(test_case_config, it_config, args) and returns: new_config_file