code: def _get_stats(
      step_data: Iterable[np.ndarray],
      percentiles: List[float],
  ) -> Dict[str, List[float]]:
      quantiles = []
      stats = {"mean": [], "sem": []}
      for step_vals in step_data:
          stats["mean"].append(nanmean(step_vals))
          stats["sem"].append(
              sem(step_vals, ddof=1, nan_policy="propagate")
          )
          quantiles.append(nanquantile(step_vals, q=percentiles))
      stats.update(
          {
              f"P{100 * p:.0f}": q
              for p, q in zip(percentiles, zip(*quantiles))
          }
      )
      return stats
  
file_path: Ax/ax/benchmark/benchmark_result.py
imports: from dataclasses import dataclass
  from typing import Dict, Iterable, List, Optional
  import numpy
  from ax.core.experiment import Experiment
  from ax.utils.common.base import Base
  from numpy import nanmean, nanquantile, ndarray
  from pandas import DataFrame
  from scipy.stats import sem
label_desc: Use image node_id 1 for calling a global function with example usage: _get_stats(step_data, percentiles) and returns: stats