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: Uses the number of dask workers in the cluster (during execution time, meaning when you start the extraction)
  to find the optimal chunk_size.
  
  :param data_length: A length which defines how many calculations there need to be.
  :type data_length: int
docstr_tok: ["Uses","the","number","of","dask","workers","in","the","cluster","(","during","execution","time",",","meaning","when","you","start","the","extraction",")","to","find","the","optimal","chunk_size",".",":","param","data_length",":","A","length","which","defines","how","many","calculations","there","need","to","be",".",":","type","data_length",":","int"]
code: def calculate_best_chunk_size(self, data_length):
      """
      Uses the number of dask workers in the cluster (during execution time, meaning when you start the extraction)
      to find the optimal chunk_size.
  
      :param data_length: A length which defines how many calculations there need to be.
      :type data_length: int
      """
      n_workers = len(self.client.scheduler_info()["workers"])
      chunk_size, extra = divmod(data_length, n_workers * 5)
      if extra:
          chunk_size += 1
      return chunk_size
  
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 2 for calling the ClusterDaskDistributor obj's underlying member method code with example usage: obj.calculate_best_chunk_size(data_length) and returns: chunk_size