def fit_transform(
        self, data: Union[TimeSeries, Sequence[TimeSeries]]
    ) -> Union[TimeSeries, Sequence[TimeSeries]]:
        """
        For each data transformer in the pipeline, first fit the data if transformer is fittable then transform data
        using fitted transformer. The transformed data is then passed to next transformer.

        Parameters
        ----------
        data
            (`Sequence` of) `TimeSeries` to fit and transform on.

        Returns
        -------
        Union[TimeSeries, Sequence[TimeSeries]]
            Transformed data.
        """
        for transformer in self._transformers:
            if isinstance(transformer, FittableDataTransformer):
                transformer.fit(data)

            data = transformer.transform(data)
        return data

        For each data transformer in the pipeline, first fit the data if transformer is fittable then transform data
        using fitted transformer. The transformed data is then passed to next transformer.

        Parameters
        ----------
        data
            (`Sequence` of) `TimeSeries` to fit and transform on.

        Returns
        -------
        Union[TimeSeries, Sequence[TimeSeries]]
            Transformed data.
        
darts/dataprocessing/pipeline.py