code: def roll_timeseries_dataframe(
      df, roll_feature_df, lookback, horizon, feature_col, target_col
  ):
      """
      roll dataframe into numpy ndarray sequence samples.
  
      :param input_df: a dataframe which has been resampled in uniform frequency.
      :param roll_feature_df: an additional rolling feature dataframe that will
             be append to final result.
      :param lookback: the length of the past sequence
      :param horizon: int or list,
             if `horizon` is an int, we will sample `horizon` step
             continuously after the forecasting point.
             if `horizon` is an list, we will sample discretely according
             to the input list. 1 means the timestampe just after the observed data.
      :param feature_col: list, indicate the feature col name.
      :param target_col: list, indicate the target col name.
      :return: x, y
          x: 3-d numpy array in format (no. of samples, lookback, feature_col length)
          y: 3-d numpy array in format (no. of samples, horizon, target_col length)
      Note: Specially, if `horizon` is set to 0, then y will be None.
      """
      assert isinstance(df, pd.DataFrame)
      assert isinstance(lookback, int)
      assert isinstance(feature_col, list)
      assert isinstance(target_col, list)
      is_horizon_int = isinstance(horizon, int)
      is_horizon_list = (
          isinstance(horizon, list)
          and isinstance(horizon[0], int)
          and min(horizon) > 0
      )
      assert is_horizon_int or is_horizon_list
  
      is_test = True if (is_horizon_int and horizon == 0) else False
      if not is_test:
          return _roll_timeseries_dataframe_train(
              df,
              roll_feature_df,
              lookback,
              horizon,
              feature_col,
              target_col,
          )
      else:
          return _roll_timeseries_dataframe_test(
              df, roll_feature_df, lookback, feature_col, target_col
          )
  
file_path: analytics-zoo/pyzoo/zoo/chronos/data/utils/roll.py
imports: import numpy
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: roll_timeseries_dataframe(df, roll_feature_df, lookback, horizon, feature_col, target_col) and returns: _roll_timeseries_dataframe_train, _roll_timeseries_dataframe_test