code: def test_fixed_sampling() -> None:
      def objective(trial: Trial) -> float:
          x = trial.suggest_float("x", -10, 10)
          y = trial.suggest_float("y", -10, 10)
          return x**2 + y**2
  
      study0 = optuna.create_study()
      study0.sampler = RandomSampler(seed=42)
      study0.optimize(objective, n_trials=1)
      x_sampled0 = study0.trials[0].params["x"]
  
      # Fix parameter ``y`` as 0.
      study1 = optuna.create_study()
      with warnings.catch_warnings():
          warnings.simplefilter(
              "ignore", optuna.exceptions.ExperimentalWarning
          )
          study1.sampler = PartialFixedSampler(
              fixed_params={"y": 0}, base_sampler=RandomSampler(seed=42)
          )
      study1.optimize(objective, n_trials=1)
  
      x_sampled1 = study1.trials[0].params["x"]
      y_sampled1 = study1.trials[0].params["y"]
      assert x_sampled1 == x_sampled0
      assert y_sampled1 == 0
  
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 1 for calling a global function with example usage: test_fixed_sampling() and returns: unknown