class_docstr: This is an abstract base class for concrete asynchronous executors.
class_docstr_tok: ["This","is","an","abstract","base","class","for","concrete","asynchronous","executors","."]
docstr: Returns an iterator equivalent to map(fn, iter).
  
  Args:
      fn: A callable that will take as many arguments as there are
          passed iterables.
      timeout: The maximum number of seconds to wait. If None, then there
          is no limit on the wait time.
      chunksize: The size of the chunks the iterable will be broken into
          before being passed to a child process. This argument is only
          used by ProcessPoolExecutor; it is ignored by
          ThreadPoolExecutor.
  
  Returns:
      An iterator equivalent to: map(func, *iterables) but the calls may
      be evaluated out-of-order.
  
  Raises:
      TimeoutError: If the entire result iterator could not be generated
          before the given timeout.
      Exception: If fn(*args) raises for any values.
docstr_tok: ["Returns","an","iterator","equivalent","to","map","(","fn",",","iter",")",".","Args",":","fn",":","A","callable","that","will","take","as","many","arguments","as","there","are","passed","iterables",".","timeout",":","The","maximum","number","of","seconds","to","wait",".","If","None",",","then","there","is","no","limit","on","the","wait","time",".","chunksize",":","The","size","of","the","chunks","the","iterable","will","be","broken","into","before","being","passed","to","a","child","process",".","This","argument","is","only","used","by","ProcessPoolExecutor",";","it","is","ignored","by","ThreadPoolExecutor",".","Returns",":","An","iterator","equivalent","to",":","map","(","func",",","*","iterables",")","but","the","calls","may","be","evaluated","out-of-order",".","Raises",":","TimeoutError",":","If","the","entire","result","iterator","could","not","be","generated","before","the","given","timeout",".","Exception",":","If","fn","(","*","args",")","raises","for","any","values","."]
code: def map(self, fn, *iterables, timeout=None, chunksize=1):
      """Returns an iterator equivalent to map(fn, iter).
  
      Args:
          fn: A callable that will take as many arguments as there are
              passed iterables.
          timeout: The maximum number of seconds to wait. If None, then there
              is no limit on the wait time.
          chunksize: The size of the chunks the iterable will be broken into
              before being passed to a child process. This argument is only
              used by ProcessPoolExecutor; it is ignored by
              ThreadPoolExecutor.
  
      Returns:
          An iterator equivalent to: map(func, *iterables) but the calls may
          be evaluated out-of-order.
  
      Raises:
          TimeoutError: If the entire result iterator could not be generated
              before the given timeout.
          Exception: If fn(*args) raises for any values.
      """
      if timeout is not None:
          end_time = timeout + time.monotonic()
  
      fs = [self.submit(fn, *args) for args in zip(*iterables)]
  
      # Yield must be hidden in closure so that the futures are submitted
      # before the first iterator value is required.
      def result_iterator():
          try:
              # reverse to keep finishing order
              fs.reverse()
              while fs:
                  # Careful not to keep a reference to the popped future
                  if timeout is None:
                      yield _result_or_cancel(fs.pop())
                  else:
                      yield _result_or_cancel(
                          fs.pop(), end_time - time.monotonic()
                      )
          finally:
              for future in fs:
                  future.cancel()
  
      return result_iterator()
  
imports: import collections
  import logging
  import threading
  import time
  import types
label_desc: Use image node_id 2 for calling the Executor obj's underlying member method code with example usage: obj.map(fn) and returns: result_iterator