code: def test_get_optimization_history_plot(
      target_name: str, info_list: list[_OptimizationHistoryInfo]
  ) -> None:
      figure = _get_optimization_history_plot(
          info_list, target_name=target_name
      )
      assert figure.layout.yaxis.title.text == target_name
      expected_legends = []
      for info in info_list:
          expected_legends.append(info.values_info.label_name)
          expected_legends.append("Infeasible Trial")
          if info.best_values_info is not None:
              expected_legends.append(info.best_values_info.label_name)
      legends = [
          scatter.name
          for scatter in figure.data
          if scatter.name is not None
      ]
      assert sorted(legends) == sorted(expected_legends)
      figure.write_image(BytesIO())
  
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 12 for calling a global function with example usage: test_get_optimization_history_plot(target_name, info_list) without return types