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 __init__(self, executor):
      # Store references to necessary internals of the executor.
  
      # A _ThreadWakeup to allow waking up the queue_manager_thread from the
      # main Thread and avoid deadlocks caused by permanently locked queues.
      self.thread_wakeup = executor._executor_manager_thread_wakeup
      self.shutdown_lock = executor._shutdown_lock
  
      # A weakref.ref to the ProcessPoolExecutor that owns this thread. Used
      # to determine if the ProcessPoolExecutor has been garbage collected
      # and that the manager can exit.
      # When the executor gets garbage collected, the weakref callback
      # will wake up the queue management thread so that it can terminate
      # if there is no pending work item.
      def weakref_cb(
          _,
          thread_wakeup=self.thread_wakeup,
          shutdown_lock=self.shutdown_lock,
      ):
          mp.util.debug(
              "Executor collected: triggering callback for"
              " QueueManager wakeup"
          )
          with shutdown_lock:
              thread_wakeup.wakeup()
  
      self.executor_reference = weakref.ref(executor, weakref_cb)
  
      # A list of the ctx.Process instances used as workers.
      self.processes = executor._processes
  
      # A ctx.Queue that will be filled with _CallItems derived from
      # _WorkItems for processing by the process workers.
      self.call_queue = executor._call_queue
  
      # A ctx.SimpleQueue of _ResultItems generated by the process workers.
      self.result_queue = executor._result_queue
  
      # A queue.Queue of work ids e.g. Queue([5, 6, ...]).
      self.work_ids_queue = executor._work_ids
  
      # Maximum number of tasks a worker process can execute before
      # exiting safely
      self.max_tasks_per_child = executor._max_tasks_per_child
  
      # A dict mapping work ids to _WorkItems e.g.
      #     {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
      self.pending_work_items = executor._pending_work_items
  
      super().__init__()
  
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 1 to create a new _ExecutorManagerThread object from inherited base classes: threading with example: obj = _ExecutorManagerThread(executor)