code: def check_version(args):
      try:
          trial_runner_version = pkg_resources.get_distribution(
              "nni"
          ).version
      except pkg_resources.ResolutionError:
          # package nni does not exist, try nni-tool package
          nni_log(LogType.Error, "Package nni does not exist!")
          os._exit(1)
      if not args.nni_manager_version:
          # skip version check
          nni_log(LogType.Warning, "Skipping version check!")
      else:
          try:
              command_channel = args.command_channel
              trial_runner_version = regular.search(
                  trial_runner_version
              ).group("version")
              nni_log(
                  LogType.Info,
                  "{0}: runner_version is {1}".format(
                      args.node_id, trial_runner_version
                  ),
              )
              nni_manager_version = regular.search(
                  args.nni_manager_version
              ).group("version")
              nni_log(
                  LogType.Info,
                  "{0}: nni_manager_version is {1}".format(
                      args.node_id, nni_manager_version
                  ),
              )
              log_entry = {}
              if trial_runner_version != nni_manager_version:
                  nni_log(
                      LogType.Warning,
                      "{0}: Version does not match!".format(
                          args.node_id
                      ),
                  )
                  error_message = "{0}: NNIManager version is {1}, Trial runner version is {2}, NNI version does not match!".format(
                      args.node_id,
                      nni_manager_version,
                      trial_runner_version,
                  )
                  log_entry["tag"] = "VCFail"
                  log_entry["msg"] = error_message
                  command_channel.send(
                      CommandType.VersionCheck, log_entry
                  )
                  while not command_channel.sent():
                      time.sleep(1)
              else:
                  nni_log(
                      LogType.Info,
                      "{0}: Version match!".format(args.node_id),
                  )
                  log_entry["tag"] = "VCSuccess"
                  command_channel.send(
                      CommandType.VersionCheck, log_entry
                  )
          except AttributeError as err:
              nni_log(
                  LogType.Error, "{0}: {1}".format(args.node_id, err)
              )
  
file_path: nni/nni/tools/trial_tool/trial_runner.py
imports: import argparse
  import json
  import os
  import random
  import re
  import sys
  import time
  import traceback
  from datetime import datetime, timedelta
  import pkg_resources
  from .gpu import collect_gpu_usage
label_desc: Use image node_id 3 for calling a global function with example usage: check_version(args) without return types