code: def check_training_validation(
      original_entry,
      train_entry,
      valid_pair,
      prediction_length: int,
      max_history,
      date,
      offset,
  ) -> None:
      for field_name in [FieldName.ITEM_ID, FieldName.INFO]:
          assert original_entry[field_name] == train_entry[field_name]
          assert original_entry[field_name] == valid_pair[0][field_name]
          assert original_entry[field_name] == valid_pair[1][field_name]
      if max_history is not None:
          assert (
              valid_pair[0][FieldName.TARGET].shape[-1] == max_history
          )
      assert (
          valid_pair[1][FieldName.TARGET].shape[-1] == prediction_length
      )
      train_end = (
          train_entry[FieldName.START]
          + train_entry[FieldName.TARGET].shape[-1]
          * train_entry[FieldName.START].freq
      )
      if date is not None:
          assert train_end == date + train_entry[FieldName.START].freq
      if offset is not None:
          if offset > 0:
              assert train_entry[FieldName.TARGET].shape[-1] == offset
          else:
              assert (
                  train_entry[FieldName.TARGET].shape[-1] - offset
                  == original_entry[FieldName.TARGET].shape[-1]
              )
      assert train_end <= valid_pair[1][FieldName.START]
      valid_end = (
          valid_pair[0][FieldName.START]
          + valid_pair[0][FieldName.TARGET].shape[-1]
          * valid_pair[0][FieldName.START].freq
      )
      assert valid_end == valid_pair[1][FieldName.START]
      if FieldName.FEAT_DYNAMIC_REAL in valid_pair[0]:
          assert (
              valid_pair[0][FieldName.FEAT_DYNAMIC_REAL].shape[-1]
              == valid_pair[0][FieldName.TARGET].shape[-1]
              + prediction_length
          )
  
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 4 for calling a global function with example usage: check_training_validation(original_entry, train_entry, valid_pair, prediction_length, max_history, date, offset) without return types