code: def _posix_recursive_kill(pid):
      """Recursively kill the descendants of a process before killing it."""
      try:
          children_pids = subprocess.check_output(
              ["pgrep", "-P", str(pid)], stderr=None, text=True
          )
      except subprocess.CalledProcessError as e:
          # `ps` returns 1 when no child process has been found
          if e.returncode == 1:
              children_pids = ""
          else:
              raise  # pragma: no cover
  
      # Decode the result, split the cpid and remove the trailing line
      for cpid in children_pids.splitlines():
          cpid = int(cpid)
          _posix_recursive_kill(cpid)
  
      _kill(pid)
  
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 7 for calling a global function with example usage: _posix_recursive_kill(pid) without return types