code: def get_metrics(self):
      metrics = []
      for k, v in self._step_metrics.items():
          metrics.append(v.dict())
      for k, v in self._one_time_metrics.items():
          metrics.append(v.dict())
      return metrics
  
imports: import time
  import typing
  from typing import Dict, List, Optional, Tuple, Union
  import pydantic
  from ._namespace import NS, IndexedNS
label_desc: Use image node_id 4 for calling the InMemoryMetricsHandler obj's underlying member method code with example usage: obj.get_metrics() and returns: metrics