code: def generic_get_metric_name(
      value_name_template: Union[str, Callable[[Dict[str, Any]], str]],
      metric_info: Dict[str, Any],
  ):
      if isinstance(value_name_template, str):
          name_template = value_name_template
      else:
          name_template = value_name_template(metric_info)
  
      # https://stackoverflow.com/a/17895844
      return name_template.format(**metric_info)
  
file_path: avalanche/avalanche/evaluation/metric_utils.py
imports: from typing import Dict, Optional, Union, Iterable, Sequence, Tuple, TYPE_CHECKING, List, Callable, Any
  import matplotlib.pyplot
  import numpy
  from matplotlib.axes import Axes
  from numpy import ndarray, arange
  from torch import Tensor
label_desc: Use image node_id 9 for calling a global function with example usage: generic_get_metric_name(value_name_template, metric_info) and returns: name_template