class_docstr: Distributor Base Class that can handle all iterable items and calculate
  a map_function on each item separately.
  
  This is done on chunks of the data, meaning, that the DistributorBaseClass classes will chunk the data into chunks,
  distribute the data and apply the map_function functions on the items separately.
  
  Dependent on the implementation of the distribute function, this is done in parallel or using a cluster of nodes.
class_docstr_tok: ["Distributor","Base","Class","that","can","handle","all","iterable","items","and","calculate","a","map_function","on","each","item","separately",".","This","is","done","on","chunks","of","the","data",",","meaning",",","that","the","DistributorBaseClass","classes","will","chunk","the","data","into","chunks",",","distribute","the","data","and","apply","the","map_function","functions","on","the","items","separately",".","Dependent","on","the","implementation","of","the","distribute","function",",","this","is","done","in","parallel","or","using","a","cluster","of","nodes","."]
docstr: This generator partitions an iterable into slices of length `chunk_size`.
  If the chunk size is not a divider of the data length, the last slice will be shorter.
  
  Taken from
  https://stackoverflow.com/questions/1915170/split-a-generator-iterable-every-n-items-in-python-splitevery
  
  The important part here is, that the iterable is only
  traversed once and the chunks are produced one at a time.
  This is good for both memory as well as speed.
  
  :param data: The data to partition.
  :type data: Iterable
  :param chunk_size: The chunk size. The last chunk might be smaller.
  :type chunk_size: int
  
  :return: A generator producing the chunks of data.
  :rtype: Generator[Iterable]
docstr_tok: ["This","generator","partitions","an","iterable","into","slices","of","length","`","chunk_size","`",".","If","the","chunk","size","is","not","a","divider","of","the","data","length",",","the","last","slice","will","be","shorter",".","Taken","from","https",":","\/\/stackoverflow.com\/questions\/1915170\/split-a-generator-iterable-every-n-items-in-python-splitevery","The","important","part","here","is",",","that","the","iterable","is","only","traversed","once","and","the","chunks","are","produced","one","at","a","time",".","This","is","good","for","both","memory","as","well","as","speed",".",":","param","data",":","The","data","to","partition",".",":","type","data",":","Iterable",":","param","chunk_size",":","The","chunk","size",".","The","last","chunk","might","be","smaller",".",":","type","chunk_size",":","int",":","return",":","A","generator","producing","the","chunks","of","data",".",":","rtype",":","Generator","[","Iterable","]"]
code: def partition(data, chunk_size):
      """
      This generator partitions an iterable into slices of length `chunk_size`.
      If the chunk size is not a divider of the data length, the last slice will be shorter.
  
      Taken from
      https://stackoverflow.com/questions/1915170/split-a-generator-iterable-every-n-items-in-python-splitevery
  
      The important part here is, that the iterable is only
      traversed once and the chunks are produced one at a time.
      This is good for both memory as well as speed.
  
      :param data: The data to partition.
      :type data: Iterable
      :param chunk_size: The chunk size. The last chunk might be smaller.
      :type chunk_size: int
  
      :return: A generator producing the chunks of data.
      :rtype: Generator[Iterable]
      """
      # Make sure we have an iterable
      iterator = iter(data)
  
      # takewhile(true, ...) generates an iterator until the items are empty
      # (= we have reached the end)
      # The islice(iterator, n) gets the next n elements from the iterator.
      # The list(...) makes sure we do not pass
      return takewhile(
          bool,
          (list(islice(iterator, chunk_size)) for _ in repeat(None)),
      )
  
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 1 for calling the IterableDistributorBaseClass obj's underlying member method code with example usage: obj.partition(data, chunk_size) and returns: takewhile