code: def test_study_optimize_with_failed_trials() -> None:
      def objective(trial: Trial) -> float:
          x = trial.suggest_int("x", 0, 99)  # NOQA[F811]
          return np.nan
  
      study = optuna.create_study(sampler=samplers.BruteForceSampler())
      study.optimize(objective, n_trials=100)
  
      expected_suggested_values = [{"x": i} for i in range(100)]
      all_suggested_values = [t.params for t in study.trials]
      assert len(all_suggested_values) == len(expected_suggested_values)
      for a in expected_suggested_values:
          assert a in all_suggested_values
  
file_path: optuna/tests/samplers_tests/test_brute_force.py
imports: import numpy
  import pytest
  import optuna
  from optuna import samplers
  from optuna.samplers._brute_force import _TreeNode
  from optuna.trial import Trial
label_desc: Use image node_id 10 for calling a global function with example usage: test_study_optimize_with_failed_trials() and returns: np