def _tabularize_series(
        self, series: Sequence[TimeSeries], component_wise: bool
    ) -> np.ndarray:
        """Internal function called by WindowedAnomalyScorer `fit()` and `score()` functions.

        Transforms a sequence of series into tabular data of size window `W`. The parameter `component_wise`
        indicates how the rolling window must treat the different components if the series is multivariate.
        If set to `False`, the rolling window will be done on each component independently. If set to `True`,
        the `N` components will be concatenated to create windows of size `W` * `N`. The resulting tabular
        data of each series are concatenated.

        Returns
        -------
        np.ndarray
            For `component_wise=True`, an array of shape (components, time - (window - 1), window).
            The component dimension is in first place for easy parallelization over all component-wise models.
            For `component_wise=False`, an array of shape (time - (window - 1), window * components).
        """
        # n series * (time, components, sample) -> (time - (window - 1), window * components)
        data = create_lagged_data(
            target_series=series,
            lags=[i for i in range(-self.window, 0)],
            uses_static_covariates=False,
            is_training=False,
            concatenate=True,
        )[0].squeeze(-1)

        # bring into required model input shape
        if component_wise:
            # (time - (window - 1), window * components) -> (time - (window - 1), window, components)
            data = data.reshape((-1, self.window, series[0].width))
            # (time - (window - 1), window, components) -> (components, time - (window - 1), window)
            d_time, d_wind, d_comp = (0, 1, 2)
            data = np.moveaxis(data, [d_time, d_comp], [d_wind, d_time])
        return data
Internal function called by WindowedAnomalyScorer `fit()` and `score()` functions.

        Transforms a sequence of series into tabular data of size window `W`. The parameter `component_wise`
        indicates how the rolling window must treat the different components if the series is multivariate.
        If set to `False`, the rolling window will be done on each component independently. If set to `True`,
        the `N` components will be concatenated to create windows of size `W` * `N`. The resulting tabular
        data of each series are concatenated.

        Returns
        -------
        np.ndarray
            For `component_wise=True`, an array of shape (components, time - (window - 1), window).
            The component dimension is in first place for easy parallelization over all component-wise models.
            For `component_wise=False`, an array of shape (time - (window - 1), window * components).
        
darts/ad/scorers/scorers.py