code: def test_use_given_estimator():
      """Test that gp_minimize does not use default estimator if one is passed
      in explicitly."""
      domain = [(1.0, 2.0), (3.0, 4.0)]
      noise_correct = 1e5
      noise_fake = 1e-10
      estimator = cook_estimator("GP", domain, noise=noise_correct)
      res = gp_minimize(
          branin,
          domain,
          n_calls=4,
          n_initial_points=2,
          base_estimator=estimator,
          noise=noise_fake,
      )
  
      assert res["models"][-1].noise == noise_correct
  
imports: import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from skopt import gp_minimize
  from skopt.benchmarks import bench1
  from skopt.benchmarks import bench2
  from skopt.benchmarks import bench3
  from skopt.benchmarks import bench4
  from skopt.benchmarks import branin
  from skopt.space.space import Real, Categorical, Space
  from skopt.utils import cook_estimator
label_desc: Use image node_id 9 for calling a global function with example usage: test_use_given_estimator() without return types