code: def helper_test_index_generator_creation(self, ig_cls, is_past=False):
      # invalid parameter sets
      with pytest.raises(ValueError):
          _ = ig_cls(
              output_chunk_length=3,
          )
  
      with pytest.raises(ValueError):
          _ = ig_cls(
              output_chunk_length=3,
              lags_covariates=[-1],
          )
  
      # valid parameter sets
      # TorchForecastingModel scenario
      _ = ig_cls(
          input_chunk_length=3,
          output_chunk_length=3,
      )
      # RegressionModel scenario
      _ = ig_cls(
          input_chunk_length=3,
          output_chunk_length=3,
          lags_covariates=[-1],
      )
      # LocalForecastingModel scenario, or model agnostic (only supported by FutureCovariatesIndexGenerator)
      if not is_past:
          _ = ig_cls()
  
file_path: darts/darts/tests/dataprocessing/encoders/test_covariate_index_generators.py
imports: import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.dataprocessing.encoders.encoder_base import CovariatesIndexGenerator, FutureCovariatesIndexGenerator, PastCovariatesIndexGenerator
  from darts.logging import get_logger
  from darts.utils import timeseries_generation
label_desc: Use image node_id 4 for calling the TestCovariatesIndexGenerator obj's underlying member method code with example usage: obj.helper_test_index_generator_creation(ig_cls, is_past) without return types