code: def capture_processes(pool):
      """Need to be called to register the processes created by the pool. It is later used
      by the teardown_function to check if no process stayed alive after the test finished.
      """
      global pool_processes
      global pool_threads
      global pools
      if pool is not None:
          pools.append(weakref.ref(pool))
          pool_processes.extend(pool.pids())
          proc_pool = pool.pool
          pool_threads.append(proc_pool._observer.thread)
      check_shm_for_dali(
          "All shm chunks should be closed after initial pool setup, found {}"
      )
  
file_path: DALI/dali/test/python/test_pool_utils.py
imports: import os
  import psutil
  import weakref
label_desc: Use image node_id 1 for calling a global function with example usage: capture_processes(pool) without return types