class_docstr: Generates index for future covariates on train and inference datasets.
class_docstr_tok: ["Generates","index","for","future","covariates","on","train","and","inference","datasets","."]
code: def generate_train_idx(
      self, target: TimeSeries, covariates: Optional[TimeSeries] = None
  ) -> Tuple[SupportedIndex, pd.Timestamp]:
      super().generate_train_idx(target, covariates)
  
      # the returned index depends on the following cases:
      # case 0
      #     user supplied covariates: simply return the covariate time index; guarantees that models raise an
      #     exception if user supplied insufficient covariates
      # case 1
      #     user uses a LocalForecastingModel or model agnostic scenario (input_chunk_length is None):
      #     simply return the target time index.
      # case 2
      #     only input_chunk_length and output_chunk_length are given: the complete covariate index is within the
      #     target index; always True for all models except RegressionModels.
      # case 3
      #     covariate lags were given and (shift_start <= 0 or shift_end <= 0): historic part of future covariates.
      #     if shift_end < 0 there will only be the historic part of future covariates.
      #     If shift_start <= 0 and abs(shift_start - 1) > input_chunk_length: we need to add indices before the
      #     beginning of the target series; can only be True for RegressionModels.
      # case 4
      #     covariate lags were given and (shift_start > 0 or shift_end > 0): future part of future covariates.
      #     if shift_start > 0 there will only be the future part of future covariates.
      #     If shift_end > 0 and shift_start > input_chunk_length: we need to add indices after the end of the
      #     target series; can only be True for RegressionModels.
  
      target_end = target.end_time()
  
      if covariates is not None:  # case 0
          return covariates.time_index, target_end
  
      if self.input_chunk_length is None:  # case 1
          return target.time_index, target_end
  
      if self.shift_start is None:  # case 2
          steps_ahead_start = 0
      else:  # case 3
          steps_ahead_start = (
              self.input_chunk_length + self.shift_start - 1
          )
  
      if self.shift_end is None:  # case 2
          steps_ahead_end = 0
      else:  # case 4
          steps_ahead_end = -self.output_chunk_length + self.shift_end
      steps_ahead_end = steps_ahead_end if steps_ahead_end else None
  
      return (
          _generate_train_idx(
              target, steps_ahead_start, steps_ahead_end
          ),
          target_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 for calling the FutureCovariatesIndexGenerator obj's underlying member method code with example usage: obj.generate_train_idx(target, covariates) and returns: _generate_train_idx,  target_end, covariates,  target_end, target,  target_end