code: def __init__(
      self, process_infos, sc, ray_rdd, raycontext, verbose=False
  ):
      self.sc = sc
      self.raycontext = raycontext
      self.verbose = verbose
      self.ray_rdd = ray_rdd
      self.master = []
      self.slaves = []
      self.pgids = []
      self.node_ips = []
      self.process_infos = process_infos
      for process_info in process_infos:
          self.pgids.append(process_info.pgid)
          self.node_ips.append(process_info.node_ip)
          if process_info.master_addr:
              self.master.append(process_info)
          else:
              self.slaves.append(process_info)
      invalidInputError(
          len(self.master) == 1,
          "We should got 1 master only, but we got {}".format(
              len(self.master)
          ),
      )
      self.master = self.master[0]
      if not is_local(self.sc):
          self.print_ray_remote_err_out()
  
file_path: BigDL/python/orca/src/bigdl/orca/ray/process.py
imports: import os
  import subprocess
  from bigdl.orca.ray.utils import is_local
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 1 to create a new ProcessMonitor object  with example: obj = ProcessMonitor(process_infos, sc, ray_rdd, raycontext, verbose)