def _training_sample_time_index_length(self) -> int:
        """
        Required time_index length for one training sample, for any model.
        """
        (
            min_target_lag,
            max_target_lag,
            min_past_cov_lag,
            max_past_cov_lag,
            min_future_cov_lag,
            max_future_cov_lag,
            output_chunk_shift,
            max_target_lag_train,
        ) = self.extreme_lags

        # some models can have different output chunks for training and prediction (e.g. `RNNModel`)
        output_lag = max_target_lag_train or max_target_lag
        return max(
            output_lag + 1,
            max_future_cov_lag + 1 if max_future_cov_lag else 0,
        ) - min(
            min_target_lag if min_target_lag else 0,
            min_past_cov_lag if min_past_cov_lag else 0,
            min_future_cov_lag if min_future_cov_lag else 0,
        )

        Required time_index length for one training sample, for any model.
        
darts/models/forecasting/forecasting_model.py