code: def test_train_loader_shapes(loader_factory):
      loader = loader_factory(get_dataset(), 1.0, 1.5)
  
      d = next(iter(loader))
  
      field_names = [
          "past_target",
          "past_valid_length",
          "future_target",
          "future_valid_length",
      ]
  
      assert all([key in d for key in field_names])
  
      assert (
          d["past_target"].shape[2] == d["future_target"].shape[2] == 2
      )
      assert (
          d["past_target"].shape[0] == d["future_target"].shape[0] == 10
      )
      assert (
          d["past_valid_length"].shape[0]
          == d["future_valid_length"].shape[0]
          == 10
      )
  
imports: import itertools
  from functools import partial
  from typing import Iterable
  import numpy
  from pandas.tseries.frequencies import to_offset
  import pytest
  from gluonts.dataset.common import Dataset
  from gluonts.dataset.loader import DataBatch, InferenceDataLoader, TrainDataLoader
  from gluonts.mx.batchify import _pad_arrays, batchify, stack
  from gluonts.testutil.dummy_datasets import get_dataset
  from gluonts.transform import ContinuousTimeInstanceSplitter, ContinuousTimeUniformSampler, ContinuousTimePredictionSampler
label_desc: Use image node_id 2 for calling a global function with example usage: test_train_loader_shapes(loader_factory) without return types