code: def _metric_max_over_ground_truths(
      metric_fn: Callable[[str, str], Tensor],
      prediction: str,
      ground_truths: List[str],
  ) -> Tensor:
      """Calculate maximum score for a predicted answer with all reference answers."""
      return max(
          metric_fn(prediction, truth) for truth in ground_truths
      )
  
file_path: torchmetrics/src/torchmetrics/functional/text/squad.py
imports: import re
  import string
  from collections import Counter
  from typing import Any, Callable, Dict, List, Tuple, Union
  from torch import Tensor, tensor
  from torchmetrics.utilities import rank_zero_warn
label_desc: Use image node_id 5 for calling a global function with example usage: _metric_max_over_ground_truths(metric_fn, prediction, ground_truths) and returns: max