code: def kill_child_processes(parent_pid):
      """
      Gracefully terminate or kill child processes from a main process
      """
      import psutil
  
      parent = psutil.Process(parent_pid)
      for child in parent.children(recursive=True):
          try:
              child.terminate()
          except psutil.NoSuchProcess:
              pass
      _, still_alive = psutil.wait_procs(parent.children(), timeout=3)
      for p in still_alive:
          p.kill()
  
imports: import base64
  import functools
  import inspect
  import json
  import logging
  import posixpath
  import re
  import textwrap
  import warnings
  from typing import List, Optional
  from urllib.parse import urlparse
  from mlflow.environment_variables import MLFLOW_GATEWAY_URI
  from mlflow.exceptions import MlflowException
  from mlflow.gateway.constants import MLFLOW_AI_GATEWAY_MOSAICML_CHAT_SUPPORTED_MODEL_PREFIXES
  from mlflow.utils.uri import append_to_uri_path
label_desc: Use image node_id 4 for calling a global function with example usage: kill_child_processes(parent_pid) without return types