def _launch_encoder(
        self,
        target: Sequence[TimeSeries],
        past_covariates: SupportedTimeSeries,
        future_covariates: SupportedTimeSeries,
        encoder_method: _EncoderMethod,
        n: Optional[int] = None,
        encode_past: bool = True,
        encode_future: bool = True,
    ) -> tuple[Sequence[TimeSeries], Sequence[TimeSeries]]:
        """Launches the encode sequence for past covariates and future covariates for either training,
        inference/prediction or training and inference/prediction depending on `encoder_method`.
        """
        if not self.encoding_available:
            return past_covariates, future_covariates

        # guarantee that all inputs are either a sequence of TimeSeries or None
        single_series = isinstance(target, TimeSeries)
        target = series2seq(target)
        past_covariates = series2seq(past_covariates)
        future_covariates = series2seq(future_covariates)

        # generate past covariates encodings
        if self.past_encoders and encode_past:
            past_covariates = self._encode_sequence(
                encoders=self.past_encoders,
                transformer=self.past_transformer,
                target=target,
                covariates=past_covariates,
                covariates_type=PAST,
                encoder_method=encoder_method,
                n=n,
            )

        # generate future covariates encodings
        if self.future_encoders and encode_future:
            future_covariates = self._encode_sequence(
                encoders=self.future_encoders,
                transformer=self.future_transformer,
                target=target,
                covariates=future_covariates,
                covariates_type=FUTURE,
                encoder_method=encoder_method,
                n=n,
            )

        # convert covariates back to single series if single target was used as input
        if single_series:
            past_covariates = seq2series(past_covariates)
            future_covariates = seq2series(future_covariates)
        return past_covariates, future_covariates
Launches the encode sequence for past covariates and future covariates for either training,
        inference/prediction or training and inference/prediction depending on `encoder_method`.
        
darts/dataprocessing/encoders/encoders.py