code: def test_get_optimization_history_info_list_with_pruned_trial(
      direction: str,
  ) -> None:
      target_name = "Target Name"
  
      def objective(trial: Trial) -> float:
          if trial.number == 0:
              return 1.0
          elif trial.number == 1:
              return 2.0
          elif trial.number == 2:
              raise TrialPruned()
          return 0.0
  
      study = create_study(direction=direction)
      study.optimize(objective, n_trials=3)
      info_list = _get_optimization_history_info_list(
          study, target=None, target_name=target_name, error_bar=False
      )
  
      assert info_list[0].values_info.states == [
          _ValueState.Feasible,
          _ValueState.Feasible,
          _ValueState.Incomplete,
      ]
      assert math.isnan(info_list[0].values_info.values[2])
      if info_list[0].best_values_info is not None:
          assert (
              info_list[0].best_values_info.values == [1.0, 1.0, 1.0]
              if direction == "minimize"
              else [1.0, 2.0, 2.0]
          )
  
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 9 for calling a global function with example usage: test_get_optimization_history_info_list_with_pruned_trial(direction) and returns: int, int, int