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_array(
      metrics_positions: tp.Dict[str, int], metrics: tp.Dict[str, float]
  ) -> List[float]:
      array: List[float] = [0.0] * len(metrics_positions)
  
      # data validation
      assert set(metrics.keys()) == set(metrics_positions.keys()), (
          f"Not all metrics were passed while logging, expected "
          f"following: {', '.join(list(metrics_positions.keys()))}"
      )
  
      for metric, value in metrics.items():
          assert isinstance(
              value, float
          ), "Type of metric {metric} should be float"
          array[metrics_positions[metric]] = value
      return array
  
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 5 for calling the MetricsPlotter obj's underlying member method code with example usage: obj.construct_metrics_array(metrics_positions, metrics) and returns: array