class_docstr: Context manager that enables widget with learning curves in
  JupyterLab / Jupyter Notebook
class_docstr_tok: ["Context","manager","that","enables","widget","with","learning","curves","in","JupyterLab","\/","Jupyter","Notebook"]
code: def construct_metrics_meta(
      metrics: List[Union[str, tp.Dict[str, str]]]
  ) -> List[tp.Dict[str, str]]:
      meta: List[tp.Dict[str, str]] = []
      for item in metrics:
          if isinstance(item, str):
              name, best_value = item, "Undefined"
          elif isinstance(item, dict):
              assert "name" in item and "best_value" in item, (
                  "Wrong metrics definition format: should have "
                  "`name` and `best_value` fields"
              )
              name, best_value = item["name"], item["best_value"]
          else:
              assert False, (
                  "Each metric should be defined as str or as"
                  "dict with `name` and `best_value` fields"
              )
          meta.append({"best_value": best_value, "name": name})
      return meta
  
file_path: catboost/catboost/python-package/catboost/widget/metrics_plotter.py
imports: import time
  import logging
  import typing
  from IPython.display import display
  from copy import deepcopy
  from typing import List, Optional, Any, Union
  from .ipythonwidget import MetricWidget
label_desc: Use image node_id 4 for calling the MetricsPlotter obj's underlying member method code with example usage: obj.construct_metrics_meta(metrics) and returns: meta