docstr: Create rolling split of past/future pairs.
  
  Parameters
  ----------
  index
      Starting index that denominates the cut off point from which splits
      are generated.
  distance
      The distance by which pairs are shifted. Defaults to ``1``. To
      avoid overlapping examples, ``distance`` has to be set to be at
      least ``past_length``.
  future_length, optional
      Optionally enforce future length. Note that ``rolsplit`` will never
      pad values in the future range.
  past_length, optional
      If provided, all pairs past will have ``past_length``, padded with
      ``pad_value`` if needed.
  n, optional
      If provided, limits the number of pairs to ``n``.
  pad_value
      Value to pad past if needed, defaults to ``0.0``.
  
  Returns
  -------
      A stream of ``zebras.SplitFrame`` objects.
code: def rolsplit(
      self,
      index,
      *,
      distance: int = 1,
      past_length: Optional[int] = None,
      future_length: Optional[int] = None,
      n: Optional[int] = None,
      pad_value=0.0,
  ):
      """Create rolling split of past/future pairs.
  
      Parameters
      ----------
      index
          Starting index that denominates the cut off point from which splits
          are generated.
      distance
          The distance by which pairs are shifted. Defaults to ``1``. To
          avoid overlapping examples, ``distance`` has to be set to be at
          least ``past_length``.
      future_length, optional
          Optionally enforce future length. Note that ``rolsplit`` will never
          pad values in the future range.
      past_length, optional
          If provided, all pairs past will have ``past_length``, padded with
          ``pad_value`` if needed.
      n, optional
          If provided, limits the number of pairs to ``n``.
      pad_value
          Value to pad past if needed, defaults to ``0.0``.
  
      Returns
      -------
          A stream of ``zebras.SplitFrame`` objects.
      """
      if not isinstance(index, (int, np.integer)):
          # If `index` is provided as timestamp we turn it into an integer.
          index = self.index_of(index)
      elif index < 0:
          # Ensure index is >= 0; (turn negative values into positive ones)
          index = len(self) + index
  
      for split_index in take(
          n,
          range(index, len(self) + 1 - distance, distance),
      ):
          yield self.split(
              split_index, past_length, future_length, pad_value
          )
  
imports: from __future__ import annotations
  import dataclasses
  from operator import itemgetter
  from typing import cast, Optional, List, Union, Collection, Any, Mapping
  import numpy
  from toolz import first, valmap, dissoc, merge, itemmap, take
  from gluonts import maybe
  from gluonts.itertools import pluck_attr, columns_to_rows, rows_to_columns, select, join_items
  from ._base import Pad, TimeBase
  from ._freq import Freq
  from ._period import Periods, Period, period
  from ._repr import html_table
  from ._util import AxisView, pad_axis, _replace
  from ._time_series import BatchTimeSeries, TimeSeries
  from ._split_frame import SplitFrame
label_desc: Use image node_id 23 for calling the TimeFrame obj's underlying member method code with example usage: obj.rolsplit(index) without return types