class_docstr: Distributor using a dask cluster, meaning that the calculation is spread over a cluster
class_docstr_tok: ["Distributor","using","a","dask","cluster",",","meaning","that","the","calculation","is","spread","over","a","cluster"]
docstr: Calculates the features in a parallel fashion by distributing the map command to the dask workers on a cluster
  
  :param func: the function to send to each worker.
  :type func: callable
  :param partitioned_chunks: The list of data chunks - each element is again
      a list of chunks - and should be processed by one worker.
  :type partitioned_chunks: iterable
  :param kwargs: parameters for the map function
  :type kwargs: dict of string to parameter
  
  :return: The result of the calculation as a list - each item should be the result of the application of func
      to a single element.
docstr_tok: ["Calculates","the","features","in","a","parallel","fashion","by","distributing","the","map","command","to","the","dask","workers","on","a","cluster",":","param","func",":","the","function","to","send","to","each","worker",".",":","type","func",":","callable",":","param","partitioned_chunks",":","The","list","of","data","chunks","-","each","element","is","again","a","list","of","chunks","-","and","should","be","processed","by","one","worker",".",":","type","partitioned_chunks",":","iterable",":","param","kwargs",":","parameters","for","the","map","function",":","type","kwargs",":","dict","of","string","to","parameter",":","return",":","The","result","of","the","calculation","as","a","list","-","each","item","should","be","the","result","of","the","application","of","func","to","a","single","element","."]
code: def distribute(self, func, partitioned_chunks, kwargs):
      """
      Calculates the features in a parallel fashion by distributing the map command to the dask workers on a cluster
  
      :param func: the function to send to each worker.
      :type func: callable
      :param partitioned_chunks: The list of data chunks - each element is again
          a list of chunks - and should be processed by one worker.
      :type partitioned_chunks: iterable
      :param kwargs: parameters for the map function
      :type kwargs: dict of string to parameter
  
      :return: The result of the calculation as a list - each item should be the result of the application of func
          to a single element.
      """
      if isinstance(partitioned_chunks, Iterable):
          # since dask 2.0.0 client map no longer accepts iterables
          partitioned_chunks = list(partitioned_chunks)
      result = self.client.gather(
          self.client.map(partial(func, **kwargs), partitioned_chunks)
      )
      return [item for sublist in result for item in sublist]
  
imports: import itertools
  import math
  import warnings
  from collections.abc import Generator, Iterable
  from functools import partial
  from itertools import islice, repeat, takewhile
  from multiprocessing import Pool
  from tqdm import tqdm
  from tsfresh.feature_extraction.data import TsData
label_desc: Use image node_id 3 for calling the ClusterDaskDistributor obj's underlying member method code with example usage: obj.distribute(func, partitioned_chunks, kwargs) and returns: unknown