code: def kill(self, trial_id=None):
      if trial_id == self.id or trial_id is None:
          if self.process is not None:
              try:
                  nni_log(LogType.Info, "%s: killing trial" % self.name)
                  for child in psutil.Process(
                      self.process.pid
                  ).children(True):
                      child.kill()
                  self.process.kill()
              except psutil.NoSuchProcess:
                  nni_log(
                      LogType.Info,
                      "kill trial %s failed: %s does not exist!"
                      % (trial_id, self.process.pid),
                  )
              except Exception as ex:
                  nni_log(
                      LogType.Error,
                      "kill trial %s failed: %s " % (trial_id, str(ex)),
                  )
          self.cleanup()
  
file_path: nni/nni/tools/trial_tool/trial.py
imports: import ctypes
  import os
  import sys
  import shlex
  import tarfile
  import time
  from datetime import datetime
  from subprocess import Popen
  import psutil
  from .log_utils import LogType, RemoteLogger, StdOutputType, nni_log
  from .commands import CommandType
label_desc: Use image node_id 5 for calling the Trial obj's underlying member method code with example usage: obj.kill(trial_id) without return types