code: def test_forking_sequence_with_features(is_train) -> None:
      def make_dataset(N, train_length):
          # generates 2 ** N - 1 timeseries with constant increasing values
          n = 2**N - 1
  
          targets = np.arange(n * train_length).reshape(
              (n, train_length)
          )
  
          return ListDataset(
              [
                  {"start": "2012-01-01", "target": targets[i, :]}
                  for i in range(n)
              ],
              freq="D",
          )
  
      ds = make_dataset(1, 20)
      enc_len = 5
      dec_len = 3
      num_forking = 1
      num_time_feat_daily_freq = 3
      num_age_feat = 1
  
      trans = transform.Chain(
          [
              transform.AddAgeFeature(
                  target_field=FieldName.TARGET,
                  output_field=FieldName.FEAT_AGE,
                  pred_length=10,
              ),
              transform.AddTimeFeatures(
                  start_field=FieldName.START,
                  target_field=FieldName.TARGET,
                  output_field=FieldName.FEAT_TIME,
                  time_features=time_features_from_frequency_str("D"),
                  pred_length=10,
              ),
              ForkingSequenceSplitter(
                  instance_sampler=ValidationSplitSampler(
                      min_future=dec_len
                  )
                  if is_train
                  else TSplitSampler(),
                  enc_len=enc_len,
                  dec_len=dec_len,
                  num_forking=num_forking,
                  encoder_series_fields=[
                      FieldName.FEAT_AGE,
                      FieldName.FEAT_TIME,
                  ],
                  decoder_series_fields=[FieldName.FEAT_TIME],
              ),
          ]
      )
  
      out = trans(iter(ds), is_train=is_train)
      transformed_data = next(iter(out))
  
      assert transformed_data["past_target"].shape == (enc_len, 1)
      assert transformed_data["past_feat_dynamic_age"].shape == (
          enc_len,
          num_age_feat,
      )
      assert transformed_data["past_time_feat"].shape == (
          enc_len,
          num_time_feat_daily_freq,
      )
      assert transformed_data["future_time_feat"].shape == (
          num_forking,
          dec_len,
          num_time_feat_daily_freq,
      )
  
      if is_train:
          assert transformed_data["future_target"].shape == (
              num_forking,
              dec_len,
          )
  
file_path: gluonts/test/mx/model/seq2seq/test_forking_sequence_splitter.py
imports: import numpy
  import pytest
  from gluonts import transform
  from gluonts.dataset.common import ListDataset
  from gluonts.dataset.field_names import FieldName
  from gluonts.mx.model.seq2seq._transform import ForkingSequenceSplitter
  from gluonts.time_feature import time_features_from_frequency_str
  from gluonts.transform import TestSplitSampler
  from gluonts.transform import ValidationSplitSampler
label_desc: Use image node_id 3 for calling a global function with example usage: test_forking_sequence_with_features(is_train) and returns: ListDataset