code: def check_experiment_id(args, update=True):
      """check if the id is valid"""
      if update:
          update_experiment()
      experiments_config = Experiments()
      experiments_dict = experiments_config.get_all_experiments()
      if not experiments_dict:
          print_normal("There is no experiment running...")
          return None
      if not args.id:
          running_experiment_list = []
          for key in experiments_dict.keys():
              if isinstance(experiments_dict[key], dict):
                  if experiments_dict[key].get("status") != "STOPPED":
                      running_experiment_list.append(key)
              elif isinstance(experiments_dict[key], list):
                  # if the config file is old version, remove the configuration from file
                  experiments_config.remove_experiment(key)
          if len(running_experiment_list) > 1:
              print_error(
                  "There are multiple experiments, please set the experiment id..."
              )
              experiment_information = ""
              for key in running_experiment_list:
                  experiment_information += EXPERIMENT_DETAIL_FORMAT % (
                      key,
                      experiments_dict[key].get(
                          "experimentName", "N/A"
                      ),
                      experiments_dict[key]["status"],
                      experiments_dict[key].get("port", "N/A"),
                      experiments_dict[key].get("platform"),
                      time.strftime(
                          "%Y-%m-%d %H:%M:%S",
                          time.localtime(
                              experiments_dict[key]["startTime"] / 1000
                          ),
                      )
                      if isinstance(
                          experiments_dict[key]["startTime"], int
                      )
                      else experiments_dict[key]["startTime"],
                      time.strftime(
                          "%Y-%m-%d %H:%M:%S",
                          time.localtime(
                              experiments_dict[key]["endTime"] / 1000
                          ),
                      )
                      if isinstance(
                          experiments_dict[key]["endTime"], int
                      )
                      else experiments_dict[key]["endTime"],
                  )
              print(
                  EXPERIMENT_INFORMATION_FORMAT % experiment_information
              )
              exit(1)
          elif not running_experiment_list:
              print_error("There is no experiment running.")
              return None
          else:
              return running_experiment_list[0]
      if experiments_dict.get(args.id):
          return args.id
      else:
          print_error("Id not correct.")
          return None
  
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 4 for calling a global function with example usage: check_experiment_id(args, update) and returns: None, args, None, None, running_experiment_list