code: def log_trial(args):
      """'get trial log path"""
      trial_id_path_dict = {}
      trial_id_list = []
      experiments_config = Experiments()
      experiments_dict = experiments_config.get_all_experiments()
      experiment_id = get_config_filename(args)
      rest_port = experiments_dict.get(experiment_id).get("port")
      rest_pid = experiments_dict.get(experiment_id).get("pid")
      experiment_config = Config(
          experiment_id,
          experiments_dict.get(experiment_id).get("logDir"),
      ).get_config()
      if not detect_process(rest_pid):
          print_error("Experiment is not running...")
          return
      running, response = check_rest_server_quick(rest_port)
      if running:
          response = rest_get(trial_jobs_url(rest_port), REST_TIME_OUT)
          if response and check_response(response):
              content = json.loads(response.text)
              for trial in content:
                  trial_id_list.append(trial.get("trialJobId"))
                  if trial.get("logPath"):
                      trial_id_path_dict[
                          trial.get("trialJobId")
                      ] = trial["logPath"]
      else:
          print_error("Restful server is not running...")
          exit(1)
      is_adl = experiment_config.get("trainingServicePlatform") == "adl"
      if is_adl and not args.trial_id:
          print_error(
              'Trial ID is required to retrieve the log for adl. Please specify it with "--trial_id".'
          )
          exit(1)
      if args.trial_id:
          if args.trial_id not in trial_id_list:
              print_error(
                  "Trial id {0} not correct, please check your command!".format(
                      args.trial_id
                  )
              )
              exit(1)
          if is_adl:
              log_trial_adl_helper(args, experiment_id)
              # adl has its own way to log trial, and it thus returns right after the helper returns
              return
          if trial_id_path_dict.get(args.trial_id):
              print_normal(
                  "id:"
                  + args.trial_id
                  + " path:"
                  + trial_id_path_dict[args.trial_id]
              )
          else:
              print_error(
                  "Log path is not available yet, please wait..."
              )
              exit(1)
      else:
          print_normal("All of trial log info:")
          for key in trial_id_path_dict:
              print_normal(
                  "id:" + key + " path:" + trial_id_path_dict[key]
              )
          if not trial_id_path_dict:
              print_normal("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 19 for calling a global function with example usage: log_trial(args) without return types