code: def test_float_to_int() -> None:
      def objective(trial: Trial) -> float:
          x = trial.suggest_int("x", -10, 10)
          y = trial.suggest_int("y", -10, 10)
          return x**2 + y**2
  
      fixed_y = 0.5
  
      # Parameters of Int-type-distribution are rounded to int-type,
      # even if they are defined as float-type.
      study = optuna.create_study()
      with warnings.catch_warnings():
          warnings.simplefilter(
              "ignore", optuna.exceptions.ExperimentalWarning
          )
          study.sampler = PartialFixedSampler(
              fixed_params={"y": fixed_y}, base_sampler=study.sampler
          )
      # Since `fixed_y` is out-of-the-range value in the corresponding suggest_int,
      # `UserWarning` will occur.
      with pytest.warns(UserWarning):
          study.optimize(objective, n_trials=1)
      assert study.trials[0].params["y"] == int(fixed_y)
  
file_path: optuna/tests/samplers_tests/test_partial_fixed.py
imports: from unittest.mock import patch
  import warnings
  import pytest
  import optuna
  from optuna.samplers import PartialFixedSampler
  from optuna.samplers import RandomSampler
  from optuna.trial import Trial
label_desc: Use image node_id 2 for calling a global function with example usage: test_float_to_int() and returns: unknown