code: def test_warn_default_target_name_with_customized_target(
      direction: str, error_bar: bool
  ) -> None:
      # Single study.
      study = create_study(direction=direction)
      with pytest.warns(UserWarning):
          _get_optimization_history_info_list(
              study,
              target=lambda t: t.number,
              target_name="Objective Value",
              error_bar=error_bar,
          )
  
      # Multiple studies.
      studies = [create_study(direction=direction) for _ in range(10)]
      with pytest.warns(UserWarning):
          _get_optimization_history_info_list(
              studies,
              target=lambda t: t.number,
              target_name="Objective Value",
              error_bar=error_bar,
          )
  
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 2 for calling a global function with example usage: test_warn_default_target_name_with_customized_target(direction, error_bar) without return types