code: def _kill_process_tree_with_psutil(process):
      try:
          descendants = psutil.Process(process.pid).children(
              recursive=True
          )
      except psutil.NoSuchProcess:
          return
  
      # Kill the descendants in reverse order to avoid killing the parents before
      # the descendant in cases where there are more processes nested.
      for descendant in descendants[::-1]:
          try:
              descendant.kill()
          except psutil.NoSuchProcess:
              pass
  
      try:
          psutil.Process(process.pid).kill()
      except psutil.NoSuchProcess:
          pass
      process.join()
  
file_path: catboost/contrib/python/joblib/joblib/externals/loky/backend/utils.py
imports: import os
  import sys
  import time
  import errno
  import signal
  import warnings
  import subprocess
  import traceback
label_desc: Use image node_id 3 for calling a global function with example usage: _kill_process_tree_with_psutil(process) without return types