code: def get_running_trials_per_minute(
      experiment: Experiment,
      show_until_latest_end_plus_timedelta: timedelta = FIVE_MINUTES,
  ) -> AxPlotConfig:
      trial_runtimes: List[Tuple[int, datetime, Optional[datetime]]] = [
          (
              trial.index,
              not_none(trial._time_run_started),
              trial._time_completed,  # Time trial was completed, failed, or abandoned.
          )
          for trial in experiment.trials.values()
          if trial._time_run_started is not None
      ]
  
      earliest_start = min(tr[1] for tr in trial_runtimes)
      latest_end = max(
          not_none(tr[2]) for tr in trial_runtimes if tr[2] is not None
      )
  
      running_during = {
          ts: [
              t[0]  # Trial index.
              for t in trial_runtimes
              # Trial is running during a given timestamp if:
              # 1) it's run start time is at/before the timestamp,
              # 2) it's completion time has not yet come or is after the timestamp.
              if t[1] <= ts
              and (True if t[2] is None else not_none(t[2]) >= ts)
          ]
          for ts in timestamps_in_range(
              earliest_start,
              latest_end + show_until_latest_end_plus_timedelta,
              timedelta(seconds=60),
          )
      }
  
      num_running_at_ts = {
          ts: len(trials) for ts, trials in running_during.items()
      }
  
      scatter = go.Scatter(
          x=list(num_running_at_ts.keys()),
          y=[num_running_at_ts[ts] for ts in num_running_at_ts],
      )
  
      return AxPlotConfig(
          data=go.Figure(
              layout=go.Layout(
                  title="Number of running trials during experiment"
              ),
              data=[scatter],
          ),
          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 13 for calling a global function with example usage: get_running_trials_per_minute(experiment, show_until_latest_end_plus_timedelta) and returns: AxPlotConfig