def warped(self) -> (TimeSeries, TimeSeries):
        """Warps the two time series according to the warp path returned by `DTWAlignment.path()`, which minimizes the
        pair-wise distance.
        This will bring two time series that are out-of-phase back into phase.

        Returns
        -------
        (TimeSeries, TimeSeries)
            Two new TimeSeries instances of the same length, indexed by pd.RangeIndex.
        """

        xa1 = self.series1.data_array(copy=False)
        xa2 = self.series2.data_array(copy=False)
        path = self.path()

        values1, values2 = xa1.values[path[:, 0]], xa2.values[path[:, 1]]

        # We set a RangeIndex for both series:
        warped_series1 = xr.DataArray(
            data=values1,
            dims=xa1.dims,
            coords={
                self.series1._time_dim: pd.RangeIndex(values1.shape[0]),
                DIMS[1]: xa1.coords[DIMS[1]],
            },
            attrs=xa1.attrs,
        )

        warped_series2 = xr.DataArray(
            data=values2,
            dims=xa2.dims,
            coords={
                self.series2._time_dim: pd.RangeIndex(values2.shape[0]),
                DIMS[1]: xa2.coords[DIMS[1]],
            },
            attrs=xa2.attrs,
        )

        time_dim1, time_dim2 = self.series1._time_dim, self.series2._time_dim

        # todo: prevent time information being lost after warping
        # Applying time index from series1 to series2 (take_dates = True) is disabled for consistency reasons
        # Applying the warp path to the dates directly will result in duplicate dates
        # and hence values being lost when converting back to a TimeSeries.
        # As a result series1 will not be warped, whereas series2 will be.
        # It could also cause the two series to have different lengths, if len(series1) < len(series2)
        # One could generate intermediate dates, but then the series would not have a consistent frequency

        take_dates = False
        if take_dates:
            time_index = warped_series1[time_dim1]
            time_index = time_index.rename({time_dim1: time_dim2})
            warped_series2[time_dim2] = time_index

        return TimeSeries.from_xarray(warped_series1), TimeSeries.from_xarray(
            warped_series2
        )
Warps the two time series according to the warp path returned by `DTWAlignment.path()`, which minimizes the
        pair-wise distance.
        This will bring two time series that are out-of-phase back into phase.

        Returns
        -------
        (TimeSeries, TimeSeries)
            Two new TimeSeries instances of the same length, indexed by pd.RangeIndex.
        
darts/dataprocessing/dtw/dtw.py