def eval_metric(
        self,
        anomalies: Union[TimeSeries, Sequence[TimeSeries]],
        series: Union[TimeSeries, Sequence[TimeSeries]],
        metric: Literal["AUC_ROC", "AUC_PR"] = "AUC_ROC",
    ) -> Union[float, Sequence[float], Sequence[Sequence[float]]]:
        """Computes the anomaly score of the given time series, and returns the score
        of an agnostic threshold metric.

        Parameters
        ----------
        anomalies
            The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
        series
            The (sequence of) series to detect anomalies from.
        metric
            The name of the metric function to use. Must be one of "AUC_ROC" (Area Under the
            Receiver Operating Characteristic Curve) and "AUC_PR" (Average Precision from scores).
            Default: "AUC_ROC".

        Returns
        -------
        float
            A single score/metric for univariate `series` series (with only one component/column).
        Sequence[float]
            A sequence (list) of scores for:

            - multivariate `series` series (multiple components). Gives a score for each component.
            - a sequence (list) of univariate `series` series. Gives a score for each series.
        Sequence[Sequence[float]]
            A sequence of sequences of scores for a sequence of multivariate `series` series.
            Gives a score for each series (outer sequence) and component (inner sequence).
        """
        anomalies = series2seq(anomalies)
        self._check_univariate_scorer(anomalies)
        pred_scores = self.score(series)
        window = 1 if self.window_agg else self.window
        return eval_metric_from_scores(
            anomalies=anomalies,
            pred_scores=pred_scores,
            window=window,
            metric=metric,
        )
Computes the anomaly score of the given time series, and returns the score
        of an agnostic threshold metric.

        Parameters
        ----------
        anomalies
            The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
        series
            The (sequence of) series to detect anomalies from.
        metric
            The name of the metric function to use. Must be one of "AUC_ROC" (Area Under the
            Receiver Operating Characteristic Curve) and "AUC_PR" (Average Precision from scores).
            Default: "AUC_ROC".

        Returns
        -------
        float
            A single score/metric for univariate `series` series (with only one component/column).
        Sequence[float]
            A sequence (list) of scores for:

            - multivariate `series` series (multiple components). Gives a score for each component.
            - a sequence (list) of univariate `series` series. Gives a score for each series.
        Sequence[Sequence[float]]
            A sequence of sequences of scores for a sequence of multivariate `series` series.
            Gives a score for each series (outer sequence) and component (inner sequence).
        
darts/ad/scorers/scorers.py