code: def test_InstanceSplitter(
      start,
      target,
      lead_time: int,
      is_train: bool,
      pick_incomplete: bool,
  ):
      train_length = 100
      pred_length = 13
      t = transform.InstanceSplitter(
          target_field=FieldName.TARGET,
          is_pad_field=FieldName.IS_PAD,
          start_field=FieldName.START,
          forecast_start_field=FieldName.FORECAST_START,
          instance_sampler=(
              transform.UniformSplitSampler(
                  p=1.0,
                  min_past=0 if pick_incomplete else train_length,
                  min_future=lead_time + pred_length,
              )
              if is_train
              else transform.TestSplitSampler(
                  min_past=0 if pick_incomplete else train_length
              )
          ),
          past_length=train_length,
          future_length=pred_length,
          lead_time=lead_time,
          time_series_fields=["some_time_feature"],
      )
  
      assert_serializable(t)
  
      other_feat = np.arange(len(target) + 100)
      data = {
          "start": start,
          "target": target,
          "some_time_feature": other_feat,
          "some_other_col": "ABC",
      }
  
      if (
          not is_train
          and not pick_incomplete
          and len(target) < train_length
      ):
          with pytest.raises(AssertionError):
              out = list(t.flatmap_transform(data, is_train=is_train))
          return
      else:
          out = list(t.flatmap_transform(data, is_train=is_train))
  
      if is_train:
          assert len(out) == max(
              0,
              len(target)
              - pred_length
              - lead_time
              + 1
              - (0 if pick_incomplete else train_length),
          )
      else:
          assert len(out) == 1
  
      for o in out:
          assert "target" not in o
          assert "some_time_feature" not in o
          assert "some_other_col" in o
  
          assert len(o["past_some_time_feature"]) == train_length
          assert len(o["past_target"]) == train_length
  
          if is_train:
              assert len(o["future_target"]) == pred_length
              assert len(o["future_some_time_feature"]) == pred_length
          else:
              assert len(o["future_target"]) == 0
              assert len(o["future_some_time_feature"]) == pred_length
  
imports: from typing import Tuple, List
  import numpy
  import pandas
  from pandas.tseries.frequencies import to_offset
  import pytest
  import gluonts
  from gluonts import time_feature, transform
  from gluonts.core import fqname_for
  from gluonts.core.serde import dump_json, load_json
  from gluonts.dataset.common import DataEntry, ListDataset
  from gluonts.dataset.field_names import FieldName
  from gluonts.dataset.stat import ScaleHistogram, calculate_dataset_statistics
  from gluonts.transform import CausalMeanValueImputation, DummyValueImputation, LastValueImputation, MeanValueImputation, RollingMeanValueImputation, Valmap
  from gluonts.transform.convert import ToIntervalSizeFormat, erf, erfinv
  from gluonts.transform.feature import CountTrailingZeros
label_desc: Use image node_id 6 for calling a global function with example usage: test_InstanceSplitter(start, target, lead_time, is_train, pick_incomplete) without return types