code: def cleanup_children():
      yield
  
      with RSAPrivateKey._process_wide_key_lock:
          RSAPrivateKey._process_wide_key = None
  
      gc.collect()  # Call .__del__() for removed objects
  
      children = psutil.Process().children(recursive=True)
      if children:
          logger.info(
              f"Cleaning up {len(children)} leftover child processes"
          )
          for child in children:
              with suppress(psutil.NoSuchProcess):
                  child.terminate()
          psutil.wait_procs(children, timeout=1)
          for child in children:
              with suppress(psutil.NoSuchProcess):
                  child.kill()
  
      MPFuture.reset_backend()
  
file_path: hivemind/tests/conftest.py
imports: import asyncio
  import gc
  from contextlib import suppress
  import psutil
  import pytest
  from hivemind.utils.crypto import RSAPrivateKey
  from hivemind.utils.logging import get_logger, use_hivemind_log_handler
  from hivemind.utils.mpfuture import MPFuture
label_desc: Use image node_id 2 for calling a global function with example usage: cleanup_children() without return types