code: def merge(self, metrics: "StepMetrics"):
      if (
          isinstance(metrics, StepMetrics)
          and metrics.type == self.type
          and metrics.name == self.name
          and metrics.step_axis == self.step_axis
          and metrics.groups == self.groups
      ):
          return StepMetrics(
              name=self.name,
              type=self.type,
              groups=self.groups,
              step_axis=self.step_axis,
              data=[*self.data, *metrics.data],
          )
  
      raise RuntimeError(
          f"metrics merge not allowed: `{metrics}` with `{self}`"
      )
  
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 2 for calling the StepMetrics obj's underlying member method code with example usage: obj.merge(metrics) and returns: StepMetrics