code: def compute_running_feasible_optimum_df(
      exp_df: pd.DataFrame,
      metric_colname: str,
      minimize: bool,
      is_feasible_colname: Optional[str],
  ) -> pd.DataFrame:
      """Computes the running feasible optimum for a given metric."""
      # If feasibility column is not provided, assume all arms are feasible.
      if is_feasible_colname is None:
          running_feasible_optimum_df = exp_df
      else:
          running_feasible_optimum_df = exp_df[
              exp_df["is_feasible"].notnull() & exp_df["is_feasible"]
          ]
      running_feasible_optimum_df = running_feasible_optimum_df[
          ["trial_index", metric_colname]
      ].copy()
  
      # Compute running optimum.
      if minimize:
          running_feasible_optimum_df = (
              running_feasible_optimum_df.groupby("trial_index")
              .min()
              .reset_index()
          )
          running_feasible_optimum_df[
              "running_optimum"
          ] = running_feasible_optimum_df[metric_colname].cummin()
      else:
          running_feasible_optimum_df = (
              running_feasible_optimum_df.groupby("trial_index")
              .max()
              .reset_index()
          )
          running_feasible_optimum_df[
              "running_optimum"
          ] = running_feasible_optimum_df[metric_colname].cummax()
  
      # Infill missing/infeasible trials.
      available_trial_indices = exp_df[
          exp_df[metric_colname].notnull()
      ]["trial_index"]
      new_index = pd.Index(
          np.arange(
              start=available_trial_indices.min(),
              stop=available_trial_indices.max() + 1,
          ),
          name="trial_index",
      )
      running_feasible_optimum_df = (
          running_feasible_optimum_df.set_index("trial_index")
          .reindex(new_index)
          .reset_index()
          .fillna(method="ffill")
      )
  
      # Add legend column.
      running_feasible_optimum_df["Legend"] = "Running optimum"
      return running_feasible_optimum_df
  
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 15 for calling a global function with example usage: compute_running_feasible_optimum_df(exp_df, metric_colname, minimize, is_feasible_colname) and returns: running_feasible_optimum_df