code: def test_get_optimization_history_info_list_with_multiple_studies(
      direction: str,
  ) -> None:
      n_studies = 10
      base_values = [1.0, 2.0, 0.0]
      base_best_values = (
          [1.0, 1.0, 0.0]
          if direction == "minimize"
          else [1.0, 2.0, 2.0]
      )
      target_name = "Target Name"
      value_states = [_ValueState.Feasible] * 3
  
      # Test with trials.
      studies = [
          create_study(direction=direction) for _ in range(n_studies)
      ]
      for i, study in enumerate(studies):
          study.optimize(
              lambda t: base_values[t.number] + i, n_trials=3
          )
      info_list = _get_optimization_history_info_list(
          studies, target=None, target_name=target_name, error_bar=False
      )
  
      for i, info in enumerate(info_list):
          values_i = [v + i for v in base_values]
          best_values_i = [v + i for v in base_best_values]
          assert info == _OptimizationHistoryInfo(
              [0, 1, 2],
              _ValuesInfo(
                  values_i,
                  None,
                  f"{target_name} of {studies[i].study_name}",
                  value_states,
              ),
              _ValuesInfo(
                  best_values_i,
                  None,
                  f"Best Value of {studies[i].study_name}",
                  value_states,
              ),
          )
  
      # Test customized target.
      info_list = _get_optimization_history_info_list(
          studies,
          target=lambda t: t.number,
          target_name=target_name,
          error_bar=False,
      )
      for i, info in enumerate(info_list):
          assert info == _OptimizationHistoryInfo(
              [0, 1, 2],
              _ValuesInfo(
                  [0.0, 1.0, 2.0],
                  None,
                  f"{target_name} of {studies[i].study_name}",
                  value_states,
              ),
              None,
          )
  
imports: from __future__ import annotations
  from io import BytesIO
  import math
  from typing import Sequence
  import numpy
  import pytest
  from optuna import samplers
  from optuna import TrialPruned
  from optuna.study import create_study
  from optuna.testing.objectives import fail_objective
  from optuna.testing.objectives import pruned_objective
  from optuna.trial import FrozenTrial
  from optuna.trial import Trial
  from optuna.visualization._optimization_history import _get_optimization_history_info_list
  from optuna.visualization._optimization_history import _get_optimization_history_plot
  from optuna.visualization._optimization_history import _OptimizationHistoryInfo
  from optuna.visualization._optimization_history import _ValuesInfo
  from optuna.visualization._optimization_history import _ValueState
label_desc: Use image node_id 7 for calling a global function with example usage: test_get_optimization_history_info_list_with_multiple_studies(direction) without return types