def filter(self, series: TimeSeries):
        """
        Computes a moving average of this series' values and returns a new TimeSeries.
        The returned series has the same length and time axis as `series`. (Note that this might create border effects).

        Parameters
        ----------
        series
            The a deterministic series to average

        Returns
        -------
        TimeSeries
            A time series containing the average values
        """
        transformation = {
            "function": "mean",
            "mode": "rolling",
            "window": self.window,
            "center": self.centered,
            "min_periods": 1,
        }

        return series.window_transform(
            transforms=transformation, forecasting_safe=False
        )

        Computes a moving average of this series' values and returns a new TimeSeries.
        The returned series has the same length and time axis as `series`. (Note that this might create border effects).

        Parameters
        ----------
        series
            The a deterministic series to average

        Returns
        -------
        TimeSeries
            A time series containing the average values
        
darts/models/filtering/moving_average_filter.py