code: def pids_from_gpid(gpid):
      import psutil
  
      processes = psutil.process_iter()
      result = []
      for proc in processes:
          try:
              if os.getpgid(proc.pid) == gpid:
                  result.append(proc.pid)
          except Exception:
              pass
      return result
  
file_path: analytics-zoo/pyzoo/zoo/ray/process.py
imports: import os
  import subprocess
  from zoo.ray.utils import is_local
label_desc: Use image node_id 1 for calling a global function with example usage: pids_from_gpid(gpid) and returns: result