code: def test_study_optimize_with_nan() -> None:
      def objective(trial: Trial) -> float:
          trial.suggest_categorical("a", [0.0, float("nan")])
          return 1.0
  
      study = optuna.create_study(sampler=samplers.BruteForceSampler())
      study.optimize(objective)
  
      all_suggested_values = [t.params["a"] for t in study.trials]
      assert len(all_suggested_values) == 2
      assert 0.0 in all_suggested_values
      assert np.isnan(all_suggested_values[0]) or np.isnan(
          all_suggested_values[1]
      )
  
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 7 for calling a global function with example usage: test_study_optimize_with_nan() and returns: int