code: def optimization_times(
      fit_times: Dict[str, List[float]],
      gen_times: Dict[str, List[float]],
      title: str = "",
  ) -> AxPlotConfig:
      """Plots wall times for each method as a bar chart.
  
      Args:
          fit_times: A map from method name to a list of the model fitting times.
          gen_times: A map from method name to a list of the gen times.
          title: Title for this plot.
  
      Returns: AxPlotConfig with the plot
      """
      # Compute means and SEs
      methods = list(fit_times.keys())
      fit_res: Dict[str, Union[str, List[float]]] = {"name": "Fitting"}
      fit_res["mean"] = [np.mean(fit_times[m]) for m in methods]
      fit_res["2sems"] = [
          2 * np.std(fit_times[m]) / np.sqrt(len(fit_times[m]))
          for m in methods
      ]
      gen_res: Dict[str, Union[str, List[float]]] = {
          "name": "Generation"
      }
      gen_res["mean"] = [np.mean(gen_times[m]) for m in methods]
      gen_res["2sems"] = [
          2 * np.std(gen_times[m]) / np.sqrt(len(gen_times[m]))
          for m in methods
      ]
      total_mean: List[float] = []
      total_2sems: List[float] = []
      for m in methods:
          totals = np.array(fit_times[m]) + np.array(gen_times[m])
          total_mean.append(np.mean(totals))
          total_2sems.append(2 * np.std(totals) / np.sqrt(len(totals)))
      total_res: Dict[str, Union[str, List[float]]] = {
          "name": "Total",
          "mean": total_mean,
          "2sems": total_2sems,
      }
  
      # Construct plot
      data: List[go.Bar] = []
  
      for i, res in enumerate([fit_res, gen_res, total_res]):
          data.append(
              go.Bar(
                  x=methods,
                  y=res["mean"],
                  text=res["name"],
                  textposition="auto",
                  error_y={
                      "type": "data",
                      "array": res["2sems"],
                      "visible": True,
                  },
                  marker={
                      "color": rgba(DISCRETE_COLOR_SCALE[i]),
                      "line": {"color": "rgb(0,0,0)", "width": 1.0},
                  },
                  opacity=0.6,
                  name=res["name"],
              )
          )
  
      layout = go.Layout(
          title=title,
          showlegend=False,
          yaxis={"title": "Time"},
          xaxis={"title": "Method"},
      )
  
      return AxPlotConfig(
          data=go.Figure(layout=layout, data=data),
          plot_type=AxPlotTypes.GENERIC,
      )
  
imports: from datetime import datetime, timedelta
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  import plotly.graph_objs
  from ax.core.experiment import Experiment
  from ax.plot.base import AxPlotConfig, AxPlotTypes
  from ax.plot.color import COLORS, DISCRETE_COLOR_SCALE, rgba
  from ax.utils.common.timeutils import timestamps_in_range
  from ax.utils.common.typeutils import not_none
  from plotly import express
  from plotly.express.colors import sample_colorscale
label_desc: Use image node_id 12 for calling a global function with example usage: optimization_times(fit_times, gen_times, title) and returns: AxPlotConfig