class_docstr: A splitter that slices training and test data based on a ``pandas.Period``.
  
  Training entries obtained from this class will be limited to observations
  up to (including) the given ``date``.
  
  Parameters
  ----------
  date
      ``pandas.Period`` determining where the training data ends.
code: def test_pair(
      self, entry: DataEntry, prediction_length: int, offset: int = 0
  ) -> Tuple[DataEntry, DataEntry]:
      base = periods_between(entry["start"], self.date)
      input_slice = slice(None, base + offset)
      label_slice = slice(
          base + offset, base + offset + prediction_length
      )
      assert (
          label_slice.stop <= entry[FieldName.TARGET].shape[-1]
      ), "Not enough data to generate some of the windows; try splitting data at an earlier date"
      return (
          slice_data_entry(
              entry, input_slice, prediction_length=prediction_length
          ),
          slice_data_entry(
              entry, label_slice, prediction_length=prediction_length
          ),
      )
  
imports: from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Generator, Optional, Tuple
  import pandas
  from gluonts.dataset import Dataset, DataEntry
  from gluonts.dataset.field_names import FieldName
label_desc: Use image node_id 2 for calling the DateSplitter obj's underlying member method code with example usage: obj.test_pair(entry, prediction_length, offset) and returns: slice_data_entry,  slice_data_entry