class_docstr: A metric defined by a dictionary mapping parameter values to the
  corresponding metric values.
  
  This provides an option to add normal noise with mean 0 and mean_sd scale
  to the given metric values.
code: def fetch_trial_data(
      self, trial: BaseTrial, **kwargs: Any
  ) -> MetricFetchResult:
      try:
          noise_sd = self.noise_sd
          arm_names = []
          mean = []
          for name, arm in trial.arms_by_name.items():
              arm_names.append(name)
              lookup_key = tuple(
                  not_none(arm.parameters[p]) for p in self.param_names
              )
              try:
                  val = self.lookup_dict[lookup_key]
              except KeyError:
                  raise KeyError(
                      "Got a KeyError while attempting to retrieve the "
                      f"parameterization {arm.parameters} from the lookup dict. "
                      f"This parameterization corresponds to {lookup_key=}."
                  )
              if noise_sd:
                  val = val + noise_sd * np.random.randn()
              mean.append(val)
          # Indicate unknown noise level in data.
          if noise_sd is None:
              noise_sd = float("nan")
          df = pd.DataFrame(
              {
                  "arm_name": arm_names,
                  "metric_name": self.name,
                  "mean": mean,
                  "sem": noise_sd,
                  "trial_index": trial.index,
              }
          )
  
          return Ok(value=Data(df=df))
  
      except Exception as e:
          return Err(
              MetricFetchE(
                  message=f"Failed to fetch {self.name}", exception=e
              )
          )
  
file_path: Ax/ax/metrics/dict_lookup.py
imports: from __future__ import annotations
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  from ax.core.base_trial import BaseTrial
  from ax.core.data import Data
  from ax.core.metric import Metric, MetricFetchE, MetricFetchResult
  from ax.utils.common.result import Err, Ok
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 4 for calling the DictLookupMetric obj's underlying member method code with example usage: obj.fetch_trial_data(trial) and returns: Ok, Err