code: def to_record(self):
      return MetricRecord(
          name=self.name,
          groups=[
              MetricRecord.Group(name=k, index=v)
              for k, v in self.groups
          ],
          type=self.type,
          step_axis=None,
          data=self.data,
      )
  
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 3 for calling the OneTimeMetrics obj's underlying member method code with example usage: obj.to_record() and returns: MetricRecord