def METHOD_NAME(
    self,
    name: str,
    pred: AnyDataFrame,
    ground_truth_users: Optional[AnyDataFrame] = None,
) -> None:
    """
    Calculate metrics for predictions
    :param name: name of the run to store in the resulting DataFrame
    :param pred: model recommendations
    :param ground_truth_users: list of users to consider in metric calculation.
        if None, only the users from ground_truth are considered.
    """
    max_k = 0
    for current_k in self.metrics.values():
        max_k = max(
            (*current_k, max_k)
            if isinstance(current_k, list)
            else (current_k, max_k)
        )
    recs = get_enriched_recommendations(
        pred, self.test, max_k, ground_truth_users
    ).cache()
    for metric, k_list in sorted(
        self.metrics.items(), key=lambda x: str(x[0])
    ):
        enriched = None
        if isinstance(metric, (RecOnlyMetric, NCISMetric)):
            enriched = metric._get_enriched_recommendations(
                pred, self.test, max_k, ground_truth_users
            )
        values, median, conf_interval = self._calculate(
            metric, enriched or recs, k_list
        )
        if isinstance(k_list, int):
            self._add_metric(  # type: ignore
                name,
                metric,
                k_list,
                values,  # type: ignore
                median,  # type: ignore
                conf_interval,  # type: ignore
            )
        else:
            for k, val in sorted(values.items(), key=lambda x: x[0]):
                self._add_metric(
                    name,
                    metric,
                    k,
                    val,
                    None if median is None else median[k],
                    None if conf_interval is None else conf_interval[k],
                )
    recs.unpersist()