code: def log_step(self, value, name: str, type: Optional[str] = None):
      if isinstance(self.namespace, IndexedNS):
          step = self.namespace.index
      else:
          raise RuntimeError(
              "log step metric only allowed in indexed namespace since the step is inferred from namespace"
          )
      timestamp = time.time()
      return self.handler.log_metrics(
          StepMetrics(
              name=name,
              type=type,
              groups=self.namespace.metric_groups,
              step_axis=self.namespace.name,
              data=[dict(metric=value, step=step, timestamp=timestamp)],
          )
      )
  
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 MetricsWrap obj's underlying member method code with example usage: obj.log_step(value, name, type) and returns: self