code: def fetch_trial_data(
      self, trial: BaseTrial, noisy: bool = True, **kwargs: Any
  ) -> MapMetricFetchResult:
      try:
          if (
              self._trial_index_to_timestamp[trial.index] == 0
              or trial.status.is_running
          ):
              self._trial_index_to_timestamp[trial.index] += 1
  
          datas = []
          for timestamp in range(
              self._trial_index_to_timestamp[trial.index]
          ):
              res = [
                  self.f(
                      np.fromiter(arm.parameters.values(), dtype=float),
                      timestamp=timestamp,
                  )
                  for arm in trial.arms
              ]
  
              df = pd.DataFrame(
                  {
                      "arm_name": [arm.name for arm in trial.arms],
                      "metric_name": self.name,
                      "sem": self.noise_sd if noisy else 0.0,
                      "trial_index": trial.index,
                      "mean": [item["mean"] for item in res],
                      self.map_key_info.key: [
                          item[self.map_key_info.key] for item in res
                      ],
                  }
              )
  
              datas.append(
                  MapData(df=df, map_key_infos=[self.map_key_info])
              )
  
          return Ok(value=MapData.from_multiple_map_data(datas))
  
      except Exception as e:
          return Err(
              MetricFetchE(
                  message=f"Failed to fetch {self.name}", exception=e
              )
          )
  
imports: from __future__ import annotations
  import math
  from collections import defaultdict
  from random import random
  from typing import Any, Iterable, Mapping, Optional
  import numpy
  import pandas
  from ax.core.base_trial import BaseTrial
  from ax.core.map_data import MapData, MapKeyInfo
  from ax.core.map_metric import MapMetricFetchResult
  from ax.core.metric import MetricFetchE
  from ax.metrics.noisy_function_map import NoisyFunctionMapMetric
  from ax.utils.common.result import Err, Ok
  from ax.utils.common.typeutils import checked_cast, not_none
  from ax.utils.measurement.synthetic_functions import branin
label_desc: Use image node_id 3 for calling the BraninTimestampMapMetric obj's underlying member method code with example usage: obj.fetch_trial_data(trial, noisy) and returns: Ok, Err