code: def manage_stopped_experiment(args, mode):
      """view a stopped experiment"""
      update_experiment()
      experiments_config = Experiments()
      experiments_dict = experiments_config.get_all_experiments()
      experiment_id = None
      # find the latest stopped experiment
      if not args.id:
          print_error(
              "Please set experiment id! \nYou could use 'nnictl {0} id' to {0} a stopped experiment!\n"
              "You could use 'nnictl experiment list --all' to show all experiments!\n"
              "If your experiment is not started in current machine, you could specify experiment folder using "
              "--experiment_dir argument".format(mode)
          )
          exit(1)
      else:
          if experiments_dict.get(args.id) is None:
              print_error("Id %s not exist!" % args.id)
              exit(1)
          if experiments_dict[args.id]["status"] != "STOPPED":
              print_error(
                  "Only stopped experiments can be {0}ed!".format(mode)
              )
              exit(1)
          experiment_id = args.id
      print_normal("{0} experiment {1}...".format(mode, experiment_id))
      experiment_config = Config(
          experiment_id, experiments_dict[args.id]["logDir"]
      ).get_config()
      experiments_config.update_experiment(args.id, "port", args.port)
      args.url_prefix = experiments_dict[args.id]["prefixUrl"]
      assert (
          "trainingService" in experiment_config
          or "trainingServicePlatform" in experiment_config
      )
      try:
          if "trainingServicePlatform" in experiment_config:
              experiment_config["logDir"] = experiments_dict[args.id][
                  "logDir"
              ]
              launch_experiment(
                  args, experiment_config, mode, experiment_id, 1
              )
          else:
              experiment_config[
                  "experimentWorkingDirectory"
              ] = experiments_dict[args.id]["logDir"]
              launch_experiment(
                  args, experiment_config, mode, experiment_id, 2
              )
      except Exception as exception:
          restServerPid = (
              Experiments()
              .get_all_experiments()
              .get(experiment_id, {})
              .get("pid")
          )
          if restServerPid:
              kill_command(restServerPid)
          print_error(exception)
          exit(1)
  
imports: import json
  import os
  from pathlib import Path
  import sys
  import string
  import random
  import time
  import re
  from subprocess import Popen, check_call, CalledProcessError, PIPE, STDOUT
  from nni.experiment.config import ExperimentConfig, convert
  from nni.tools.package_utils.tuner_factory import get_builtin_module_class_name
  from .launcher_utils import validate_all_content
  from .rest_utils import rest_put, rest_post, check_rest_server, check_response
  from .url_utils import cluster_metadata_url, experiment_url, get_local_urls, set_prefix_url
  from .config_utils import Config, Experiments
  from .common_utils import get_yml_content, get_json_content, print_error, print_normal, detect_port
  from .constants import NNI_HOME_DIR, ERROR_INFO, REST_TIME_OUT, EXPERIMENT_SUCCESS_INFO, LOG_HEADER
  from .command_utils import check_output_command, kill_command
  from .nnictl_utils import update_experiment
label_desc: Use image node_id 20 for calling a global function with example usage: manage_stopped_experiment(args, mode) without return types