def eval_metric_from_scores(
    anomalies: Union[TimeSeries, Sequence[TimeSeries]],
    pred_scores: Union[TimeSeries, Sequence[TimeSeries]],
    window: Union[int, Sequence[int]] = 1,
    metric: Literal["AUC_ROC", "AUC_PR"] = "AUC_ROC",
) -> Union[float, Sequence[float], Sequence[Sequence[float]]]:
    """Computes a score/metric between anomaly scores against true anomalies.

    `anomalies` and `pred_scores` must have the same shape.
    `anomalies` must be binary and have values belonging to the two classes (0 and 1).

    If one series is given for `anomalies` and `pred_scores` contains more than
    one series, the function will consider `anomalies` as the ground truth anomalies for
    all scores in `pred_scores`.

    Parameters
    ----------
    anomalies
        The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
    pred_scores
        The (sequence of) of estimated anomaly score series indicating how anomalous each window of size w is.
    window
        Integer value indicating the number of past samples each point represents in the `pred_scores`.
        The parameter will be used to transform `anomalies`.
        If a list of integers, the length must match the number of series in `pred_scores`.
        If an integer, the value will be used for every series in `pred_scores` and `anomalies`.
    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 `pred_scores` series (with only one component/column).
    Sequence[float]
        A sequence (list) of scores for:

        - multivariate `pred_scores` series (multiple components). Gives a score for each component.
        - a sequence (list) of univariate `pred_scores` series. Gives a score for each series.
    Sequence[Sequence[float]]
        A sequence of sequences of scores for a sequence of multivariate `pred_scores` series.
        Gives a score for each series (outer sequence) and component (inner sequence).
    """
    return _eval_metric(
        anomalies=anomalies,
        pred_series=pred_scores,
        window=window,
        metric=metric,
        pred_is_binary=False,
    )
Computes a score/metric between anomaly scores against true anomalies.

    `anomalies` and `pred_scores` must have the same shape.
    `anomalies` must be binary and have values belonging to the two classes (0 and 1).

    If one series is given for `anomalies` and `pred_scores` contains more than
    one series, the function will consider `anomalies` as the ground truth anomalies for
    all scores in `pred_scores`.

    Parameters
    ----------
    anomalies
        The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
    pred_scores
        The (sequence of) of estimated anomaly score series indicating how anomalous each window of size w is.
    window
        Integer value indicating the number of past samples each point represents in the `pred_scores`.
        The parameter will be used to transform `anomalies`.
        If a list of integers, the length must match the number of series in `pred_scores`.
        If an integer, the value will be used for every series in `pred_scores` and `anomalies`.
    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 `pred_scores` series (with only one component/column).
    Sequence[float]
        A sequence (list) of scores for:

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