code: def test_past_index_generator_creation(self):
      # test parameter scenarios
      self.helper_test_index_generator_creation(
          ig_cls=PastCovariatesIndexGenerator, is_past=True
      )
  
      # ==> test failures
      # one lag is >= 0 (not possible for past covariates)
      with pytest.raises(ValueError):
          _ = PastCovariatesIndexGenerator(
              1,
              1,
              lags_covariates=[-1, 1],
          )
      with pytest.raises(ValueError):
          _ = PastCovariatesIndexGenerator(
              1,
              1,
              lags_covariates=[0, -1],
          )
  
      min_lag, max_lag = -2, -1
      ig = PastCovariatesIndexGenerator(
          1,
          1,
          lags_covariates=[min_lag, max_lag],
      )
      assert ig.shift_start == min_lag + 1
      assert ig.shift_end == max_lag + 1
  
      min_lag, max_lag = -1, -1
      ig = PastCovariatesIndexGenerator(
          1,
          1,
          lags_covariates=[min_lag, max_lag],
      )
      assert ig.shift_start == min_lag + 1
      assert ig.shift_end == max_lag + 1
  
      # check that min/max lags are extracted from list of lags
      min_lag, max_lag = -10, -3
      ig = PastCovariatesIndexGenerator(
          1,
          1,
          lags_covariates=[-5, min_lag, max_lag, -4],
      )
      assert ig.shift_start == min_lag + 1
      assert ig.shift_end == max_lag + 1
  
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 5 for calling the TestCovariatesIndexGenerator obj's underlying member method code with example usage: obj.test_past_index_generator_creation() without return types