def _convert_tabular_to_series(
        self, series: Sequence[TimeSeries], score_vals: np.ndarray
    ) -> Sequence[TimeSeries]:
        """Converts generated anomaly score from `np.ndarray` into a sequence of series. For efficiency reasons,
        the anomaly scores were computed in one go (for each component if `component_wise=True`). If a list of series
        is given, each series will be concatenated by its components. The function aims to split the anomaly score at
        the proper indexes to create an anomaly score for each series.
        """
        if not self.is_univariate or self.is_univariate and series[0].width == 1:
            # number of input components matches output components, we can generate a new series
            # with the same attrs, and component names
            create_fn = "with_times_and_values"
        else:
            # otherwise, create a clean new series
            create_fn = "from_times_and_values"

        # (components, n series * (time - (window - 1))) -> (n series * (time - (window - 1)), components)
        score_vals = score_vals.T
        result = []
        idx = 0
        # (n series * (time - (window - 1)), components) -> n series * (time - (window - 1), components)
        for s in series:
            result.append(
                getattr(s, create_fn)(
                    times=s._time_index[self.window - 1 :],
                    values=score_vals[idx : idx + len(s) - self.window + 1, :],
                )
            )
            idx += len(s) - self.window + 1
        return result
Converts generated anomaly score from `np.ndarray` into a sequence of series. For efficiency reasons,
        the anomaly scores were computed in one go (for each component if `component_wise=True`). If a list of series
        is given, each series will be concatenated by its components. The function aims to split the anomaly score at
        the proper indexes to create an anomaly score for each series.
        
darts/ad/scorers/scorers.py