code: def _function_with_partly_reduce(chunk_list, map_function, kwargs):
      """
      Small helper function to call a function (map_function)
      on a list of data chunks (chunk_list) and convert the results into
      a flattened list.
  
      This function is used to send chunks of data with a size larger than 1 to
      the workers in parallel and process these on the worker.
  
      :param chunk_list: A list of data chunks to process.
      :type chunk_list: list
      :param map_function: A function, which is called on each chunk in the list separately.
      :type map_function: callable
  
      :return: A list of the results of the function evaluated on each chunk and flattened.
      :rtype: list
      """
      kwargs = kwargs or {}
      results = (map_function(chunk, **kwargs) for chunk in chunk_list)
      results = list(itertools.chain.from_iterable(results))
      return results
  
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 a global function with example usage: _function_with_partly_reduce(chunk_list, map_function, kwargs) and returns: results