code: def test_filter_inf_trials_multiobjective(
      value: float, objective_selected: int, expected: int
  ) -> None:
      study = create_study(directions=["minimize", "maximize"])
      study.add_trial(
          create_trial(
              values=[0.0, 1.0],
              params={"x": 1.0},
              distributions={"x": FloatDistribution(0.0, 1.0)},
          )
      )
      study.add_trial(
          create_trial(
              values=[0.0, value],
              params={"x": 0.0},
              distributions={"x": FloatDistribution(0.0, 1.0)},
          )
      )
      study.add_trial(
          create_trial(
              values=[value, value],
              params={"x": 0.0},
              distributions={"x": FloatDistribution(0.0, 1.0)},
          )
      )
  
      def _target(t: FrozenTrial) -> float:
          return t.values[objective_selected]
  
      trials = _filter_nonfinite(
          study.get_trials(states=(TrialState.COMPLETE,)),
          target=_target,
      )
      assert len(trials) == expected
      assert all(
          [t.number == num for t, num in zip(trials, range(expected))]
      )
  
imports: import datetime
  import logging
  from textwrap import dedent
  from typing import cast
  import numpy
  import pytest
  from pytest import LogCaptureFixture
  import optuna
  from optuna.distributions import FloatDistribution
  from optuna.study import create_study
  from optuna.testing.visualization import prepare_study_with_trials
  from optuna.trial import create_trial
  from optuna.trial import FrozenTrial
  from optuna.trial import TrialState
  from optuna.visualization import is_available
  from optuna.visualization._utils import _check_plot_args
  from optuna.visualization._utils import _filter_nonfinite
  from optuna.visualization._utils import _is_log_scale
  from optuna.visualization._utils import _make_hovertext
label_desc: Use image node_id 6 for calling a global function with example usage: test_filter_inf_trials_multiobjective(value, objective_selected, expected) and returns: t