code: def test_get_timeline_info(
      trial_sys_attrs: dict[str, Any] | None, infeasible: bool
  ) -> None:
      states = [
          TrialState.COMPLETE,
          TrialState.RUNNING,
          TrialState.WAITING,
      ]
      study = _create_study(states, trial_sys_attrs)
      info = _get_timeline_info(study)
      assert len(info.bars) == len(study.get_trials())
      for bar, trial in zip(info.bars, study.get_trials()):
          assert bar.number == trial.number
          assert bar.state == trial.state
          assert type(bar.hovertext) is str
          assert isinstance(bar.start, datetime.datetime)
          assert isinstance(bar.complete, datetime.datetime)
          assert bar.start <= bar.complete
          assert bar.infeasible == infeasible
  
file_path: optuna/tests/visualization_tests/test_timeline.py
imports: from __future__ import annotations
  import datetime
  from io import BytesIO
  from typing import Any
  import _pytest.capture
  import pytest
  import optuna
  from optuna.samplers._base import _CONSTRAINTS_KEY
  from optuna.study.study import Study
  from optuna.trial import TrialState
  from optuna.visualization._plotly_imports import go
  from optuna.visualization._timeline import _get_timeline_info
  from optuna.visualization._timeline import plot_timeline
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_timeline_info(trial_sys_attrs, infeasible) without return types