code: def __init__(
      self, metrics_to_collect: Mapping = default_metrics_to_collect
  ) -> None:
      super().__init__()
  
      self.metric_history: Dict[str, list] = {}
      self.metrics_to_collect: Mapping = metrics_to_collect
      for target in self.metrics_to_collect.values():
          self.metric_history[target] = []
  
file_path: flair/flair/trainers/plugins/loggers/metric_history.py
imports: import logging
  from typing import Any, Dict, Mapping
  from flair.trainers.plugins.base import TrainerPlugin
label_desc: Use image node_id 1 to create a new MetricHistoryPlugin object from inherited base classes: TrainerPlugin with example: obj = MetricHistoryPlugin(metrics_to_collect)