class_docstr: Internal class for `parallel_map`, arguments match the constructor's.
class_docstr_tok: ["Internal","class","for","`","parallel_map","`",",","arguments","match","the","constructor","'s","."]
docstr: Spins up an executor (if none were provided), then yields all
  processed chunks in order.
docstr_tok: ["Spins","up","an","executor","(","if","none","were","provided",")",",","then","yields","all","processed","chunks","in","order","."]
code: def run(self):
      """Spins up an executor (if none were provided), then yields all
      processed chunks in order."""
      with CancelFuturesOnExit(self.future_chunks):
          if self.executor is not None:
              # just use the executor we were provided
              yield from self._map_all()
          else:
              # start and shut down a process pool executor -- ok for
              # long-running tasks
              with ProcessPoolExecutor(
                  max_workers=self.process_count
              ) as pool:
                  self.executor = pool
                  yield from self._map_all()
  
file_path: speechbrain/speechbrain/utils/parallel.py
imports: import itertools
  import multiprocessing
  from collections import deque
  from concurrent.futures import Executor, ProcessPoolExecutor
  from threading import Condition
  from typing import Any, Callable, Iterable, Optional
  from tqdm.auto import tqdm
label_desc: Use image node_id 2 for calling the _ParallelMapper obj's underlying member method code with example usage: obj.run() without return types