code: def plot_timeline(study: Study) -> "Axes":
      """Plot the timeline of a study.
  
      .. seealso::
          Please refer to :func:`optuna.visualization.plot_timeline` for an example.
  
      Example:
  
          The following code snippet shows how to plot the timeline of a study.
  
          .. plot::
  
              import time
  
              import optuna
  
  
              def objective(trial):
                  x = trial.suggest_float("x", 0, 1)
                  time.sleep(x * 0.1)
                  if x > 0.8:
                      raise ValueError()
                  if x > 0.4:
                      raise optuna.TrialPruned()
                  return x ** 2
  
  
              study = optuna.create_study(direction="minimize")
              study.optimize(
                  objective, n_trials=50, n_jobs=2, catch=(ValueError,)
              )
  
              optuna.visualization.matplotlib.plot_timeline(study)
  
      Args:
          study:
              A :class:`~optuna.study.Study` object whose trials are plotted with
              their lifetime.
  
      Returns:
          A :class:`matplotlib.axes.Axes` object.
      """
      _imports.check()
      info = _get_timeline_info(study)
      return _get_timeline_plot(info)
  
file_path: optuna/optuna/visualization/matplotlib/_timeline.py
imports: from optuna._experimental import experimental_func
  from optuna.study import Study
  from optuna.trial import TrialState
  from optuna.visualization._timeline import _get_timeline_info
  from optuna.visualization._timeline import _TimelineBarInfo
  from optuna.visualization._timeline import _TimelineInfo
  from optuna.visualization.matplotlib._matplotlib_imports import _imports
label_desc: Use image node_id 1 for calling a global function with example usage: plot_timeline(study) and returns: _get_timeline_plot