code: def test_exhaust_initial_calls(base_estimator):
      """Check that a model is fitted and used to make suggestions after adding at least
      `n_initial_points` via `tell`"""
      # TODO: Refactor - Use PyTest
  
      opt = Optimizer(
          [(-2.0, 2.0)],
          base_estimator,
          n_initial_points=2,
          acq_optimizer="sampling",
          random_state=1,
      )
  
      # Until surrogate model in `Optimizer` has been fitted (after `tell`-ing `n_initial_points`),
      #   `ask` returns random points, which is why `x0` and `x1` must be different
      x0 = opt.ask()  # Random point
      x1 = opt.ask()  # Random point
      assert x0 != x1
  
      #################### First `tell` Call ####################
      # `tell` with a dummy objective value
      r1 = opt.tell(x1, 3.0)
      assert len(r1.models) == 0
      # Surrogate model still not fitted because only 1 / `n_initial_points` has been `tell`-ed
      x2 = opt.ask()  # Random point
      assert x1 != x2
  
      #################### Second `tell` Call ####################
      r2 = opt.tell(x2, 4.0)
      # After `tell`-ing a second point, a surrogate model is fitted - Unless using "dummy" estimator
      if base_estimator.lower() == "dummy":
          assert len(r2.models) == 0
      else:
          assert len(r2.models) == 1
  
      #################### First Non-Random Point ####################
      x3 = opt.ask()
      assert x2 != x3
      x4 = opt.ask()
      r3 = opt.tell(x3, 1.0)
  
      # No new information was added, so should be the same, unless we are using the dummy estimator,
      #   which will forever return random points and never fits any models
      if base_estimator.lower() == "dummy":
          assert x3 != x4
          assert len(r3.models) == 0
      else:
          assert x3 == x4
          assert len(r3.models) == 2
  
imports: from hyperparameter_hunter.optimization.backends.skopt.engine import Optimizer
  import numpy
  import pytest
  from scipy.optimize import OptimizeResult
  from sklearn.multioutput import MultiOutputRegressor
  from sklearn.utils.testing import assert_array_equal
  from skopt.benchmarks import bench1, bench1_with_time
  from skopt.learning import ExtraTreesRegressor, RandomForestRegressor
  from skopt.learning import GradientBoostingQuantileRegressor
label_desc: Use image node_id 9 for calling a global function with example usage: test_exhaust_initial_calls(base_estimator) without return types