code: def experiment_list(args):
      """get the information of all experiments"""
      update_experiment()
      experiments_config = Experiments()
      experiments_dict = experiments_config.get_all_experiments()
      if not experiments_dict:
          print_normal("Cannot find experiments.")
          exit(1)
      experiment_id_list = []
      if args.all:
          for key in experiments_dict.keys():
              experiment_id_list.append(key)
      else:
          for key in experiments_dict.keys():
              if experiments_dict[key]["status"] != "STOPPED":
                  experiment_id_list.append(key)
          if not experiment_id_list:
              print_warning(
                  "There is no experiment running...\nYou can use 'nnictl experiment list --all' to list all experiments."
              )
      experiment_information = ""
      for key in experiment_id_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)
      return experiment_id_list
  
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 27 for calling a global function with example usage: experiment_list(args) and returns: experiment_id_list