class_docstr: Manages the communication between this process and the worker processes.
  
  The manager is run in a local thread.
  
  Args:
      executor: A reference to the ProcessPoolExecutor that owns
          this thread. A weakref will be own by the manager as well as
          references to internal objects used to introspect the state of
          the executor.
class_docstr_tok: ["Manages","the","communication","between","this","process","and","the","worker","processes",".","The","manager","is","run","in","a","local","thread",".","Args",":","executor",":","A","reference","to","the","ProcessPoolExecutor","that","owns","this","thread",".","A","weakref","will","be","own","by","the","manager","as","well","as","references","to","internal","objects","used","to","introspect","the","state","of","the","executor","."]
code: def run(self):
      # Main loop for the executor manager thread.
  
      while True:
          self.add_call_item_to_queue()
  
          (
              result_item,
              is_broken,
              cause,
          ) = self.wait_result_broken_or_wakeup()
  
          if is_broken:
              self.terminate_broken(cause)
              return
          if result_item is not None:
              self.process_result_item(result_item)
  
              process_exited = result_item.exit_pid is not None
              if process_exited:
                  p = self.processes.pop(result_item.exit_pid)
                  p.join()
  
              # Delete reference to result_item to avoid keeping references
              # while waiting on new results.
              del result_item
  
              if executor := self.executor_reference():
                  if process_exited:
                      with self.shutdown_lock:
                          executor._adjust_process_count()
                  else:
                      executor._idle_worker_semaphore.release()
                  del executor
  
          if self.is_shutting_down():
              self.flag_executor_shutting_down()
  
              # When only canceled futures remain in pending_work_items, our
              # next call to wait_result_broken_or_wakeup would hang forever.
              # This makes sure we have some running futures or none at all.
              self.add_call_item_to_queue()
  
              # Since no new work items can be added, it is safe to shutdown
              # this thread if there are no pending work items.
              if not self.pending_work_items:
                  self.join_executor_internals()
                  return
  
imports: import os
  from concurrent.futures import _base
  import queue
  import multiprocessing
  import multiprocessing.connection
  from multiprocessing.queues import Queue
  import threading
  import weakref
  from functools import partial
  import itertools
  import sys
  from traceback import format_exception
label_desc: Use image node_id 2 for calling the _ExecutorManagerThread obj's underlying member method code with example usage: obj.run() without return types