code: def _feature_extraction_on_chunk_helper(
      df,
      column_id,
      column_kind,
      column_sort,
      column_value,
      default_fc_parameters,
      kind_to_fc_parameters,
  ):
      """
      Helper function wrapped around _do_extraction_on_chunk to use the correct format
      of the "chunk" and output a pandas dataframe.
      Is used e.g. in the convenience functions for dask and spark.
  
      For the definitions of the parameters, please see these convenience functions.
      """
      if (
          default_fc_parameters is None
          and kind_to_fc_parameters is None
      ):
          default_fc_parameters = ComprehensiveFCParameters()
      elif (
          default_fc_parameters is None
          and kind_to_fc_parameters is not None
      ):
          default_fc_parameters = {}
  
      if column_sort is not None:
          df = df.sort_values(column_sort)
  
      chunk = (
          df[column_id].iloc[0],
          df[column_kind].iloc[0],
          df[column_value],
      )
      features = _do_extraction_on_chunk(
          chunk,
          default_fc_parameters=default_fc_parameters,
          kind_to_fc_parameters=kind_to_fc_parameters,
      )
      features = pd.DataFrame(
          features, columns=[column_id, "variable", "value"]
      )
      features["value"] = features["value"].astype("double")
  
      return features[[column_id, "variable", "value"]]
  
imports: from functools import partial
  import pandas
  from tsfresh.feature_extraction.extraction import _do_extraction_on_chunk
  from tsfresh.feature_extraction.settings import ComprehensiveFCParameters
label_desc: Use image node_id 1 for calling a global function with example usage: _feature_extraction_on_chunk_helper(df, column_id, column_kind, column_sort, column_value, default_fc_parameters, kind_to_fc_parameters) and returns: features