code: def create_instance_splitter(self, mode: str):
      assert mode in ["training", "validation", "test"]
  
      instance_sampler = {
          "training": self.train_sampler,
          "validation": self.validation_sampler,
          "test": TestSplitSampler(),
      }[mode]
  
      return InstanceSplitter(
          target_field=FieldName.TARGET,
          is_pad_field=FieldName.IS_PAD,
          start_field=FieldName.START,
          forecast_start_field=FieldName.FORECAST_START,
          instance_sampler=instance_sampler,
          past_length=self.history_length,
          future_length=self.prediction_length,
          time_series_fields=[
              FieldName.FEAT_TIME,
              FieldName.OBSERVED_VALUES,
          ],
      ) + (
          CDFtoGaussianTransform(
              target_field=FieldName.TARGET,
              observed_values_field=FieldName.OBSERVED_VALUES,
              max_context_length=self.conditioning_length,
              target_dim=self.target_dim,
          )
          if self.use_marginal_transformation
          else RenameFields(
              {
                  f"past_{FieldName.TARGET}": f"past_{FieldName.TARGET}_cdf",
                  f"future_{FieldName.TARGET}": f"future_{FieldName.TARGET}_cdf",
              }
          )
      )
  
imports: from typing import List, Optional, Callable
  import numpy
  import torch
  from gluonts.core.component import validated
  from gluonts.dataset.field_names import FieldName
  from gluonts.time_feature import TimeFeature
  from gluonts.torch.modules.distribution_output import DistributionOutput
  from gluonts.torch.util import copy_parameters
  from gluonts.torch.model.predictor import PyTorchPredictor
  from gluonts.model.predictor import Predictor
  from gluonts.transform import AddObservedValuesIndicator, AddTimeFeatures, AsNumpyArray, CDFtoGaussianTransform, Chain, ExpandDimArray, ExpectedNumInstanceSampler, InstanceSplitter, ValidationSplitSampler, TestSplitSampler, RenameFields, SetField, TargetDimIndicator, Transformation, VstackFeatures, RemoveFields, AddAgeFeature, cdf_to_gaussian_forward_transform
  from pts import Trainer
  from pts.model.utils import get_module_forward_input_names
  from pts.feature import fourier_time_features_from_frequency, lags_for_fourier_time_features_from_frequency
  from pts.model import PyTorchEstimator
  from pts.modules import LowRankMultivariateNormalOutput
  from .deepvar_network import DeepVARTrainingNetwork, DeepVARPredictionNetwork
label_desc: Use image node_id 3 for calling the DeepVAREstimator obj's underlying member method code with example usage: obj.create_instance_splitter(mode) and returns: unknown