code: def stop(pgid):
      logging.info(f"Stopping pgid {pgid} by ray_daemon.")
      try:
          # SIGTERM may not kill all the children processes in the group.
          os.killpg(pgid, signal.SIGKILL)
      except Exception:
          logging.error("Cannot kill pgid: {}".format(pgid))
  
imports: import os
  import sys
  import signal
  import psutil
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: stop(pgid) without return types