code: def _validate_nbeats_argument(
      self,
      argument_value,
      argument_name,
      default_value,
      validation_condition,
      invalidation_message,
  ):
      # set default value if applicable
      new_value = (
          argument_value
          if argument_value is not None
          else default_value
      )
  
      # check whether dimension of argument matches num_stack dimension
      assert len(new_value) == 1 or len(new_value) == self.num_stacks, (
          f"Invalid lengths of argument {argument_name}: {len(new_value)}. Argument must have "
          f"length 1 or {self.num_stacks} "
      )
  
      # check validity of actual values
      assert all(
          [validation_condition(val) for val in new_value]
      ), invalidation_message
  
      # make length of arguments consistent
      if len(new_value) == 1:
          return new_value * self.num_stacks
      else:
          return new_value
  
file_path: gluonts/src/gluonts/nursery/robust-mts-attack/pts/model/n_beats/n_beats_estimator.py
imports: from typing import List, Optional
  import torch
  import torch.nn
  from gluonts.core.component import validated
  from gluonts.dataset.field_names import FieldName
  from gluonts.model.predictor import Predictor
  from gluonts.torch.model.predictor import PyTorchPredictor
  from gluonts.torch.util import copy_parameters
  from gluonts.transform import InstanceSplitter, ValidationSplitSampler, TestSplitSampler, AddObservedValuesIndicator, Transformation, Chain, RemoveFields, ExpectedNumInstanceSampler
  from pts import Trainer
  from pts.model import PyTorchEstimator
  from pts.model.utils import get_module_forward_input_names
  from .n_beats_network import NBEATSPredictionNetwork, NBEATSTrainingNetwork, VALID_N_BEATS_STACK_TYPES
label_desc: Use image node_id 2 for calling the NBEATSEstimator obj's underlying member method code with example usage: obj._validate_nbeats_argument(argument_value, argument_name, default_value, validation_condition, invalidation_message) and returns: unknown, new_value