docstr: :class:`CovariatesIndexGenerator` generates a time index for covariates at training and inference /
  prediction time with methods :func:`generate_train_idx()`, and :func:`generate_inference_idx()`.
  Without user `covariates`, it generates the minimum required covariate times spans for the corresponding
  scenarios described below. With user `covariates`, it simply copies and returns the `covariates` time index.
  
  It can be used:
  A   in combination with :class:`LocalForecastingModel`, or in a model agnostic scenario:
          All parameters can be ignored. This scenario is only supported by
          :class:`FutureCovariatesIndexGenerator`.
  B   in combination with :class:`RegressionModel`:
          Set `input_chunk_length`, `output_chunk_length`, and `lags_covariates`.
          `input_chunk_length` is the absolute value of the minimum target lag `abs(min(lags))` used with the
          regression model.
          Set `output_chunk_length`, and `lags_covariates` with the identical values used at forecasting model
          creation. For the covariates lags, use `lags_past_covariates` for class:`PastCovariatesIndexGenerator`,
          and `lags_future_covariates` for class:`PastCovariatesIndexGenerator`.
  C   in combination with :class:`TorchForecastingModel`:
          Set `input_chunk_length`, and `output_chunk_length` with the identical values used at forecasting model
          creation.
  
  Parameters
  ----------
  input_chunk_length
      Optionally, the number of input target time steps per chunk. Only required in scenarios B, C.
      Corresponds to `input_chunk_length` for :class:`TorchForecastingModel`, or to the absolute minimum target
      lag value `abs(min(lags))` for :class:`RegressionModel`.
  output_chunk_length
      Optionally, the number of output target time steps per chunk. Only required in scenarios B, and C.
      Corresponds to `output_chunk_length` for both :class:`TorchForecastingModel`, and :class:`RegressionModel`.
  lags_covariates
      Optionally, a list of integers giving the covariates lags used for Darts' RegressionModels. Only required
      in scenario B. Corresponds to the lag values from `lags_past_covariates` for past covariates, and
      `lags_future_covariates` for future covariates.
docstr_tok: [":","class",":","`","CovariatesIndexGenerator","`","generates","a","time","index","for","covariates","at","training","and","inference","\/","prediction","time","with","methods",":","func",":","`","generate_train_idx","(",")","`",",","and",":","func",":","`","generate_inference_idx","(",")","`",".","Without","user","`","covariates","`",",","it","generates","the","minimum","required","covariate","times","spans","for","the","corresponding","scenarios","described","below",".","With","user","`","covariates","`",",","it","simply","copies","and","returns","the","`","covariates","`","time","index",".","It","can","be","used",":","A","in","combination","with",":","class",":","`","LocalForecastingModel","`",",","or","in","a","model","agnostic","scenario",":","All","parameters","can","be","ignored",".","This","scenario","is","only","supported","by",":","class",":","`","FutureCovariatesIndexGenerator","`",".","B","in","combination","with",":","class",":","`","RegressionModel","`",":","Set","`","input_chunk_length","`",",","`","output_chunk_length","`",",","and","`","lags_covariates","`",".","`","input_chunk_length","`","is","the","absolute","value","of","the","minimum","target","lag","`","abs","(","min","(","lags",")",")","`","used","with","the","regression","model",".","Set","`","output_chunk_length","`",",","and","`","lags_covariates","`","with","the","identical","values","used","at","forecasting","model","creation",".","For","the","covariates","lags",",","use","`","lags_past_covariates","`","for","class",":","`","PastCovariatesIndexGenerator","`",",","and","`","lags_future_covariates","`","for","class",":","`","PastCovariatesIndexGenerator","`",".","C","in","combination","with",":","class",":","`","TorchForecastingModel","`",":","Set","`","input_chunk_length","`",",","and","`","output_chunk_length","`","with","the","identical","values","used","at","forecasting","model","creation",".","Parameters","--","--","--","--","--","input_chunk_length","Optionally",",","the","number","of","input","target","time","steps","per","chunk",".","Only","required","in","scenarios","B",",","C.","Corresponds","to","`","input_chunk_length","`","for",":","class",":","`","TorchForecastingModel","`",",","or","to","the","absolute","minimum","target","lag","value","`","abs","(","min","(","lags",")",")","`","for",":","class",":","`","RegressionModel","`",".","output_chunk_length","Optionally",",","the","number","of","output","target","time","steps","per","chunk",".","Only","required","in","scenarios","B",",","and","C.","Corresponds","to","`","output_chunk_length","`","for","both",":","class",":","`","TorchForecastingModel","`",",","and",":","class",":","`","RegressionModel","`",".","lags_covariates","Optionally",",","a","list","of","integers","giving","the","covariates","lags","used","for","Darts","'","RegressionModels",".","Only","required","in","scenario","B",".","Corresponds","to","the","lag","values","from","`","lags_past_covariates","`","for","past","covariates",",","and","`","lags_future_covariates","`","for","future","covariates","."]
code: def __init__(
      self,
      input_chunk_length: Optional[int] = None,
      output_chunk_length: Optional[int] = None,
      lags_covariates: Optional[List[int]] = None,
  ):
      """:class:`CovariatesIndexGenerator` generates a time index for covariates at training and inference /
      prediction time with methods :func:`generate_train_idx()`, and :func:`generate_inference_idx()`.
      Without user `covariates`, it generates the minimum required covariate times spans for the corresponding
      scenarios described below. With user `covariates`, it simply copies and returns the `covariates` time index.
  
      It can be used:
      A   in combination with :class:`LocalForecastingModel`, or in a model agnostic scenario:
              All parameters can be ignored. This scenario is only supported by
              :class:`FutureCovariatesIndexGenerator`.
      B   in combination with :class:`RegressionModel`:
              Set `input_chunk_length`, `output_chunk_length`, and `lags_covariates`.
              `input_chunk_length` is the absolute value of the minimum target lag `abs(min(lags))` used with the
              regression model.
              Set `output_chunk_length`, and `lags_covariates` with the identical values used at forecasting model
              creation. For the covariates lags, use `lags_past_covariates` for class:`PastCovariatesIndexGenerator`,
              and `lags_future_covariates` for class:`PastCovariatesIndexGenerator`.
      C   in combination with :class:`TorchForecastingModel`:
              Set `input_chunk_length`, and `output_chunk_length` with the identical values used at forecasting model
              creation.
  
      Parameters
      ----------
      input_chunk_length
          Optionally, the number of input target time steps per chunk. Only required in scenarios B, C.
          Corresponds to `input_chunk_length` for :class:`TorchForecastingModel`, or to the absolute minimum target
          lag value `abs(min(lags))` for :class:`RegressionModel`.
      output_chunk_length
          Optionally, the number of output target time steps per chunk. Only required in scenarios B, and C.
          Corresponds to `output_chunk_length` for both :class:`TorchForecastingModel`, and :class:`RegressionModel`.
      lags_covariates
          Optionally, a list of integers giving the covariates lags used for Darts' RegressionModels. Only required
          in scenario B. Corresponds to the lag values from `lags_past_covariates` for past covariates, and
          `lags_future_covariates` for future covariates.
      """
      # check that parameters match one of the scenarios
      self._verify_scenario(
          input_chunk_length, output_chunk_length, lags_covariates
      )
  
      # input/output chunk length are guaranteed to both be `None`, or both be defined
      self.input_chunk_length = input_chunk_length
      self.output_chunk_length = output_chunk_length
  
      # check lags validity
      min_covariates_lag = (
          min(lags_covariates) if lags_covariates is not None else None
      )
      max_covariates_lag = (
          max(lags_covariates) if lags_covariates is not None else None
      )
      self._verify_lags(min_covariates_lag, max_covariates_lag)
  
      # from verification min/max lags are guaranteed to either both be None, or both be an integer
      if min_covariates_lag is not None:
          # we add 1 to the lags so that shift == 0 represents the end of the target series (forecasting point)
          shift_start = min_covariates_lag + 1
          shift_end = max_covariates_lag + 1
      else:
          shift_start = None
          shift_end = None
      self.shift_start = shift_start
      self.shift_end = shift_end
  
imports: from abc import ABC, abstractmethod
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  from darts import TimeSeries
  from darts.dataprocessing.transformers import FittableDataTransformer
  from darts.logging import get_logger, raise_if, raise_log
  from darts.utils.timeseries_generation import generate_index
label_desc: Use image node_id 1 to create a new CovariatesIndexGenerator object from inherited base classes: ABC with example: obj = CovariatesIndexGenerator(input_chunk_length, output_chunk_length, lags_covariates)