class_docstr: A concurrent.futures Executor that executes tasks on a dask.distributed Client.
class_docstr_tok: ["A","concurrent.futures","Executor","that","executes","tasks","on","a","dask.distributed","Client","."]
docstr: Returns an iterator equivalent to ``map(fn, *iterables)``.
  
  Parameters
  ----------
  fn : A callable that will take as many arguments as there are
      passed iterables.
  iterables : One iterable for each parameter to *fn*.
  timeout : The maximum number of seconds to wait. If None, then there
      is no limit on the wait time.
  chunksize : ignored.
  
  Returns
  -------
  An iterator equivalent to: ``map(fn, *iterables)`` but the calls may
  be evaluated out-of-order.
  
  Raises
  ------
  concurrent.futures.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",",","*","iterables",")","``",".","Parameters","--","--","--","--","--","fn",":","A","callable","that","will","take","as","many","arguments","as","there","are","passed","iterables",".","iterables",":","One","iterable","for","each","parameter","to","*","fn","*",".","timeout",":","The","maximum","number","of","seconds","to","wait",".","If","None",",","then","there","is","no","limit","on","the","wait","time",".","chunksize",":","ignored",".","Returns","--","--","--","-","An","iterator","equivalent","to",":","``","map","(","fn",",","*","iterables",")","``","but","the","calls","may","be","evaluated","out-of-order",".","Raises","--","--","--","concurrent.futures.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, **kwargs):
      """Returns an iterator equivalent to ``map(fn, *iterables)``.
  
      Parameters
      ----------
      fn : A callable that will take as many arguments as there are
          passed iterables.
      iterables : One iterable for each parameter to *fn*.
      timeout : The maximum number of seconds to wait. If None, then there
          is no limit on the wait time.
      chunksize : ignored.
  
      Returns
      -------
      An iterator equivalent to: ``map(fn, *iterables)`` but the calls may
      be evaluated out-of-order.
  
      Raises
      ------
      concurrent.futures.TimeoutError:
          If the entire result iterator could not be generated before the given
          timeout.
      Exception:
          If ``fn(*args)`` raises for any values.
      """
      timeout = kwargs.pop("timeout", None)
      if timeout is not None:
          timeout = parse_timedelta(timeout)
          end_time = timeout + time()
      if "chunksize" in kwargs:
          del kwargs["chunksize"]
      if kwargs:
          raise TypeError(
              "unexpected arguments to map(): %s" % sorted(kwargs)
          )
  
      fs = self._client.map(fn, *iterables, **self._kwargs)
  
      # Below iterator relies on fs being an iterator itself, and not just an iterable
      # (such as a list), in order to cancel remaining futures
      fs = iter(fs)
  
      # Yield must be hidden in closure so that the tasks are submitted
      # before the first iterator value is required.
      def result_iterator():
          try:
              for future in fs:
                  self._futures.add(future)
                  if timeout is not None:
                      try:
                          yield future.result(end_time - time())
                      except TimeoutError:
                          raise cf.TimeoutError
                  else:
                      yield future.result()
          finally:
              remaining = list(fs)
              self._futures.update(remaining)
              self._client.cancel(remaining)
  
      return result_iterator()
  
file_path: distributed/distributed/cfexecutor.py
imports: from __future__ import annotations
  import concurrent.futures
  import weakref
  from tlz import merge
  from tornado import gen
  from dask.utils import parse_timedelta
  from distributed.metrics import time
  from distributed.utils import TimeoutError, sync
label_desc: Use image node_id 4 for calling the ClientExecutor obj's underlying member method code with example usage: obj.map(fn) and returns: result_iterator