code: def _do_extraction_on_chunk(
      chunk,
      default_fc_parameters,
      kind_to_fc_parameters,
      show_warnings=True,
  ):
      """
      Main function of this module: use the feature calculators defined in the
      default_fc_parameters or kind_to_fc_parameters parameters and extract all
      features on the chunk.
  
      The chunk consists of the chunk id, the chunk kind and the data (as a Series),
      which is then converted to a numpy array - so a single time series.
  
      Returned is a list of the extracted features. Each one is a tuple consisting of
      { the id of the chunk,
        the feature name in the format <kind>__<feature>__<parameters>,
        the numeric value of the feature or np.nan , }
  
      The <parameters> are in the form described in :mod:`~tsfresh.utilities.string_manipulation`.
  
      :param chunk: A tuple of sample_id, kind, data
      :param default_fc_parameters: A dictionary of feature calculators.
      :param kind_to_fc_parameters: A dictionary of fc_parameters for special kinds or None.
      :param show_warnings: Surpress warnings (some feature calculators are quite verbose)
      :return: A list of calculated features.
      """
      sample_id, kind, data = chunk
      if kind_to_fc_parameters and kind in kind_to_fc_parameters:
          fc_parameters = kind_to_fc_parameters[kind]
      else:
          fc_parameters = default_fc_parameters
  
      def _f():
          for (
              f_or_function_name,
              parameter_list,
          ) in fc_parameters.items():
              if callable(f_or_function_name):
                  func = f_or_function_name
              else:
                  func = getattr(
                      feature_calculators, f_or_function_name
                  )
  
              # If the function uses the index, pass is at as a pandas Series.
              # Otherwise, convert to numpy array
              if getattr(func, "input", None) == "pd.Series":
                  # If it has a required index type, check that the data has the right index type.
                  index_type = getattr(func, "index_type", None)
                  if index_type is not None:
                      try:
                          assert isinstance(data.index, index_type)
                      except AssertionError:
                          warnings.warn(
                              "{} requires the data to have a index of type {}. Results will "
                              "not be calculated".format(
                                  f_or_function_name, index_type
                              )
                          )
                          continue
                  x = data
              else:
                  x = data.values
  
              if getattr(func, "fctype", None) == "combiner":
                  result = func(x, param=parameter_list)
              else:
                  if parameter_list:
                      result = (
                          (
                              convert_to_output_format(param),
                              func(x, **param),
                          )
                          for param in parameter_list
                      )
                  else:
                      result = [("", func(x))]
  
              for key, item in result:
                  feature_name = str(kind) + "__" + func.__name__
                  if key:
                      feature_name += "__" + str(key)
                  yield (sample_id, feature_name, item)
  
      with warnings.catch_warnings():
          if not show_warnings:
              warnings.simplefilter("ignore")
          else:
              warnings.simplefilter("default")
  
          return list(_f())
  
file_path: tsfresh/tsfresh/feature_extraction/extraction.py
imports: import logging
  import warnings
  from collections.abc import Iterable
  import pandas
  from tsfresh import defaults
  from tsfresh.feature_extraction import feature_calculators
  from tsfresh.feature_extraction.data import to_tsdata
  from tsfresh.feature_extraction.settings import ComprehensiveFCParameters
  from tsfresh.utilities import profiling
  from tsfresh.utilities.distribution import ApplyDistributor, DistributorBaseClass, MapDistributor, MultiprocessingDistributor
  from tsfresh.utilities.string_manipulation import convert_to_output_format
label_desc: Use image node_id 3 for calling a global function with example usage: _do_extraction_on_chunk(chunk, default_fc_parameters, kind_to_fc_parameters, show_warnings) and returns: list