code: def prettify_metrics(
      metrics: List[Tuple[str, float]], precision: int = 4
  ) -> OrderedDict:
      """Prettifies the dictionary of metrics."""
      prettified_metrics = OrderedDict()
      for key, value in metrics:
          if key in prettified_metrics:
              Warning(
                  "Multiple metrics with the same name {}.".format(key)
              )
          if isinstance(value, float):
              value = round(value, precision)
          prettified_metrics[key] = value
      return prettified_metrics
  
file_path: DeepPavlov/deeppavlov/core/trainers/utils.py
imports: from collections import OrderedDict, namedtuple
  from dataclasses import is_dataclass
  from functools import partial
  from json import JSONEncoder
  from typing import List, Tuple, Union, Iterable
  import numpy
  from deeppavlov.core.common.metrics_registry import get_metric_by_name
label_desc: Use image node_id 2 for calling a global function with example usage: prettify_metrics(metrics, precision) and returns: prettified_metrics