code: def log_metrics(
      self, metrics: Mapping[str, float], step: Optional[int] = None
  ) -> None:
      super(MetricsLogger, self).log_metrics(metrics, step)
      # metrics is a dictionary of metric names and values
      for metric_name, metric_value in metrics.items():
          if metric_name == "hp_metric":
              pass
          elif metric_name != "epoch":
              self.history[metric_name].append(metric_value)
          else:  # case epoch. We want to avoid adding multiple times the same. It happens for multiple losses.
              if (
                  not len(self.history["epoch"])
                  or not self.history["epoch"][-1]
                  == metric_value  # len == 0:
              ):  # the last values of epochs is not the one we are currently trying to add.
                  self.history["epoch"].append(metric_value)
              else:
                  pass
      return
  
file_path: neural_prophet/neuralprophet/logger.py
imports: import collections
  from typing import Any, Mapping, Optional
  import pytorch_lightning
  from pytorch_lightning.callbacks import TQDMProgressBar
  from pytorch_lightning.loggers import TensorBoardLogger
  from pytorch_lightning.utilities.rank_zero import rank_zero_only
label_desc: Use image node_id 3 for calling the MetricsLogger obj's underlying member method code with example usage: obj.log_metrics(metrics, step) without return types