def score(
        self,
        series: Union[TimeSeries, Sequence[TimeSeries]],
        return_model_prediction: bool = False,
        **kwargs,
    ) -> Union[TimeSeries, Sequence[TimeSeries]]:
        """Compute anomaly score(s) for the given series.

        Predicts the given target time series with the forecasting model, and applies the scorer(s)
        on the prediction and the target input time series.

        Parameters
        ----------
        series
            The (sequence of) series to score on.
        return_model_prediction
            Whether to return the forecasting/filtering model prediction along with the anomaly scores.
        **kwargs
            Additional parameters passed to `AnomalyModel.predict_series()`

        Returns
        -------
        TimeSeries
            A single `TimeSeries` for a single `series` with a single anomaly scorers.
        Sequence[TimeSeries]
            A sequence of `TimeSeries` for:

            - a single `series` with multiple anomaly scorers.
            - a sequence of `series` with a single anomaly scorer.
        Sequence[Sequence[TimeSeries]]
            A sequence of sequences of `TimeSeries` for a sequence of `series` and multiple anomaly scorers.
            The outer sequence is over the series, and inner sequence is over the scorers.
        """
        called_with_single_series = isinstance(series, TimeSeries)
        # check input series and covert to sequences
        series, kwargs = self._process_input_series(series, **kwargs)
        # predict / filter `series`
        pred = self.predict_series(series=series, **kwargs)

        scores = list(
            zip(*[sc.score_from_prediction(series, pred) for sc in self.scorers])
        )

        if called_with_single_series:
            scores = scores[0]
            if len(scores) == 1:
                # there's only one scorer
                scores = scores[0]
            pred = pred[0]

        if return_model_prediction:
            return scores, pred

        return scores
Compute anomaly score(s) for the given series.

        Predicts the given target time series with the forecasting model, and applies the scorer(s)
        on the prediction and the target input time series.

        Parameters
        ----------
        series
            The (sequence of) series to score on.
        return_model_prediction
            Whether to return the forecasting/filtering model prediction along with the anomaly scores.
        **kwargs
            Additional parameters passed to `AnomalyModel.predict_series()`

        Returns
        -------
        TimeSeries
            A single `TimeSeries` for a single `series` with a single anomaly scorers.
        Sequence[TimeSeries]
            A sequence of `TimeSeries` for:

            - a single `series` with multiple anomaly scorers.
            - a sequence of `series` with a single anomaly scorer.
        Sequence[Sequence[TimeSeries]]
            A sequence of sequences of `TimeSeries` for a sequence of `series` and multiple anomaly scorers.
            The outer sequence is over the series, and inner sequence is over the scorers.
        
darts/ad/anomaly_model/anomaly_model.py