code: def _plot_bars(
      bars: list[_TimelineBarInfo],
      color: str,
      name: str,
      fig: go.Figure,
  ) -> None:
      if len(bars) == 0:
          return
  
      fig.add_trace(
          go.Bar(
              name=name,
              x=[
                  (b.complete - b.start).total_seconds() * 1000
                  for b in bars
              ],
              y=[b.number for b in bars],
              base=[b.start.isoformat() for b in bars],
              text=[b.hovertext for b in bars],
              hovertemplate="%{text}<extra>" + name + "</extra>",
              orientation="h",
              marker=dict(color=color),
              textposition="none",  # Avoid drawing hovertext in a bar.
          )
      )
  
file_path: optuna/optuna/visualization/_timeline.py
imports: from __future__ import annotations
  import datetime
  from typing import NamedTuple
  from optuna._experimental import experimental_func
  from optuna.logging import get_logger
  from optuna.samplers._base import _CONSTRAINTS_KEY
  from optuna.study import Study
  from optuna.trial import TrialState
  from optuna.visualization._plotly_imports import _imports
  from optuna.visualization._utils import _make_hovertext
label_desc: Use image node_id 4 for calling a global function with example usage: _plot_bars(bars, color, name, fig) without return types