code: def search_space_auto_gen(args):
      """dry run trial code to generate search space file"""
      trial_dir = os.path.expanduser(args.trial_dir)
      file_path = os.path.expanduser(args.file)
      if not os.path.isabs(file_path):
          file_path = os.path.join(os.getcwd(), file_path)
      assert os.path.exists(trial_dir)
      if os.path.exists(file_path):
          print_warning(
              "%s already exists, will be overwritten." % file_path
          )
      print_normal("Dry run to generate search space...")
      Popen(
          args.trial_command,
          cwd=trial_dir,
          env=dict(os.environ, NNI_GEN_SEARCH_SPACE=file_path),
          shell=True,
      ).wait()
      if not os.path.exists(file_path):
          print_warning(
              "Expected search space file '{}' generated, but not found.".format(
                  file_path
              )
          )
      else:
          print_normal(
              "Generate search space done: '{}'.".format(file_path)
          )
  
imports: import csv
  import os
  import sys
  import json
  import time
  import shutil
  import subprocess
  from functools import cmp_to_key
  import traceback
  from datetime import datetime, timezone
  from subprocess import Popen
  from .rest_utils import rest_get, rest_delete, check_rest_server_quick, check_response
  from .url_utils import trial_jobs_url, experiment_url, trial_job_id_url, export_data_url, metric_data_url
  from .config_utils import Config, Experiments
  from .constants import NNI_HOME_DIR, EXPERIMENT_INFORMATION_FORMAT, EXPERIMENT_DETAIL_FORMAT, EXPERIMENT_MONITOR_INFO, TRIAL_MONITOR_HEAD, TRIAL_MONITOR_CONTENT, TRIAL_MONITOR_TAIL, REST_TIME_OUT
  from .common_utils import print_normal, print_error, print_warning, detect_process, get_yml_content, generate_temp_dir
  from .common_utils import print_green
  from .command_utils import check_output_command, kill_command
  from .ssh_utils import create_ssh_sftp_client, remove_remote_directory
label_desc: Use image node_id 33 for calling a global function with example usage: search_space_auto_gen(args) without return types