code: def _create_study(
      trial_states_list: list[TrialState],
      trial_sys_attrs: dict[str, Any] | None = None,
  ) -> Study:
      study = optuna.create_study()
      fmax = float(len(trial_states_list))
      for i, s in enumerate(trial_states_list):
          study.add_trial(
              optuna.trial.create_trial(
                  params={"x": float(i)},
                  distributions={
                      "x": optuna.distributions.FloatDistribution(
                          -1.0, fmax
                      )
                  },
                  value=0.0,
                  state=s,
                  system_attrs=trial_sys_attrs,
              )
          )
      return study
  
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 1 for calling a global function with example usage: _create_study(trial_states_list, trial_sys_attrs) and returns: study