code: def test_split(dataset, date, offset, windows, distance, max_history):
      assert (offset is None) != (date is None)
  
      prediction_length = 7
  
      train, test_template = split(dataset, date=date, offset=offset)
      train = list(train)
  
      validation = list(
          test_template.generate_instances(
              prediction_length=prediction_length,
              windows=windows,
              distance=distance,
              max_history=max_history,
          )
      )
  
      assert len(train) == len(dataset)
      assert len(validation) == windows * len(train)
  
      k = 0
      for original_entry, train_entry in zip(dataset, train):
          for _ in range(windows):
              valid_pair = validation[k]
              check_training_validation(
                  original_entry=original_entry,
                  train_entry=train_entry,
                  valid_pair=valid_pair,
                  prediction_length=prediction_length,
                  max_history=max_history,
                  date=date,
                  offset=offset,
              )
              k += 1
  
file_path: gluonts/test/dataset/test_split.py
imports: import numpy
  import pandas
  import pytest
  from gluonts.dataset.field_names import FieldName
  from gluonts.dataset.split import OffsetSplitter, periods_between, split, slice_data_entry
label_desc: Use image node_id 5 for calling a global function with example usage: test_split(dataset, date, offset, windows, distance, max_history) without return types