def encode_train_inference(
        self,
        n: int,
        target: SupportedTimeSeries,
        past_covariates: Optional[SupportedTimeSeries] = None,
        future_covariates: Optional[SupportedTimeSeries] = None,
        encode_past: bool = True,
        encode_future: bool = True,
    ) -> tuple[
        Union[TimeSeries, Sequence[TimeSeries]], Union[TimeSeries, Sequence[TimeSeries]]
    ]:
        """Returns encoded index for all past and/or future covariates for training and inference/prediction.
        Which covariates are generated depends on the parameters used at model creation.

        Parameters
        ----------
        n
            The forecast horizon
        target
            The target TimeSeries used for training and prediction.
        past_covariates
            Optionally, the past covariates used for training and prediction.
        future_covariates
            Optionally, the future covariates used for training and prediction.
        encode_past
            Whether to apply encoders for past covariates.
        encode_future
            Whether to apply encoders for future covariates.

        Returns
        -------
        Tuple[past_covariates, future_covariates]
            The past_covariates and/or future_covariates for prediction/inference including the encodings.
            If input {x}_covariates is None and no {x}_encoders are given, will return `None`
            for the {x}_covariates.
        """
        if not self.fit_called:
            if not isinstance(target, (TimeSeries, list)):
                logger.warning(
                    "Fitting was called with `add_encoders` and suspicion of lazy loading. "
                    "The encodings/covariates are generated pre-train for all individual targets and "
                    "loaded into memory. Depending on the size of your data, this can create memory issues. "
                    "In case this applies, consider setting `add_encoders=None` at model creation."
                )

            self._fit_called = True
        past_covariates, future_covariates = self._launch_encoder(
            target=target,
            past_covariates=past_covariates,
            future_covariates=future_covariates,
            encoder_method=_EncoderMethod("train_inference"),
            n=n,
            encode_past=encode_past,
            encode_future=encode_future,
        )
        self._fit_called = True
        return past_covariates, future_covariates
Returns encoded index for all past and/or future covariates for training and inference/prediction.
        Which covariates are generated depends on the parameters used at model creation.

        Parameters
        ----------
        n
            The forecast horizon
        target
            The target TimeSeries used for training and prediction.
        past_covariates
            Optionally, the past covariates used for training and prediction.
        future_covariates
            Optionally, the future covariates used for training and prediction.
        encode_past
            Whether to apply encoders for past covariates.
        encode_future
            Whether to apply encoders for future covariates.

        Returns
        -------
        Tuple[past_covariates, future_covariates]
            The past_covariates and/or future_covariates for prediction/inference including the encodings.
            If input {x}_covariates is None and no {x}_encoders are given, will return `None`
            for the {x}_covariates.
        
darts/dataprocessing/encoders/encoders.py