class_docstr: A class which manages a list of :class:`EnvRunner`.
  Its job is to execute them possibly in parallel and aggregate their results.
class_docstr_tok: ["A","class","which","manages","a","list","of",":","class",":","`","EnvRunner","`",".","Its","job","is","to","execute","them","possibly","in","parallel","and","aggregate","their","results","."]
docstr: Args:
      env_runners (list[EnvRunner]):
      maximum_staleness (int): when >1 environments run in parallel,
          the actual stepping of an environment may happen several steps
          after calls to `EnvRunnerManager.step()`, in order to achieve better throughput.
code: def __init__(self, env_runners, maximum_staleness):
      """
      Args:
          env_runners (list[EnvRunner]):
          maximum_staleness (int): when >1 environments run in parallel,
              the actual stepping of an environment may happen several steps
              after calls to `EnvRunnerManager.step()`, in order to achieve better throughput.
      """
      assert len(env_runners) > 0
      self._runners = env_runners
  
      if len(self._runners) > 1:
          # Only use threads when having >1 runners.
          self._populate_job_queue = queue.Queue(
              maxsize=maximum_staleness
          )
          self._threads = [
              self._create_simulator_thread(i)
              for i in range(len(self._runners))
          ]
          for t in self._threads:
              t.start()
  
imports: import copy
  import itertools
  import numpy
  import threading
  from collections import namedtuple
  from six.moves import queue, range
  from tensorpack.utils.concurrency import LoopThread, ShareSessionThread
  from tensorpack.callbacks.base import Callback
  from tensorpack.dataflow import DataFlow
  from tensorpack.utils import logger, get_rng, get_tqdm
  from tensorpack.utils.stats import StatCounter
label_desc: Use image node_id 1 to create a new EnvRunnerManager object from inherited base classes: object with example: obj = EnvRunnerManager(env_runners, maximum_staleness)