code: def is_running(self):
      if self.process is None:
          return False
  
      retCode = self.process.poll()
      # child worker process exits and all stdout data is read
      if (
          retCode is not None
          and self.log_pipe_stdout.set_process_exit()
          and self.log_pipe_stdout.is_read_completed == True
      ):
          # In Windows, the retCode -1 is 4294967295. It's larger than c_long, and raise OverflowError.
          # So covert it to int32.
          retCode = ctypes.c_long(retCode).value
          nni_log(
              LogType.Info,
              "{0}: subprocess terminated. Exit code is {1}.".format(
                  self.name, retCode
              ),
          )
  
          end_time = int(datetime.now().timestamp() * 1000)
          end_message = {
              "code": retCode,
              "time": end_time,
              "trial": self.id,
          }
          self.command_channel.send(CommandType.TrialEnd, end_message)
          self.cleanup()
          return False
      else:
          return True
  
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 4 for calling the Trial obj's underlying member method code with example usage: obj.is_running() and returns: False, False, True