code: def test_multiple_asks():
      # calling ask() multiple times without a tell() inbetween should
      # be a "no op"
      base_estimator = ExtraTreesRegressor(random_state=2)
      opt = Optimizer(
          [(-2.0, 2.0)],
          base_estimator,
          n_initial_points=1,
          acq_optimizer="sampling",
      )
  
      opt.run(bench1, n_iter=3)
      # tell() computes the next point ready for the next call to ask()
      # hence there are three after three iterations
      assert_equal(len(opt.models), 3)
      assert_equal(len(opt.Xi), 3)
      opt.ask()
      assert_equal(len(opt.models), 3)
      assert_equal(len(opt.Xi), 3)
      assert_equal(opt.ask(), opt.ask())
      opt.update_next()
      assert_equal(opt.ask(), opt.ask())
  
imports: import numpy
  import pytest
  from sklearn.multioutput import MultiOutputRegressor
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_equal
  from numpy.testing import assert_raises
  from skopt import gp_minimize
  from skopt import forest_minimize
  from skopt.benchmarks import bench1, bench1_with_time
  from skopt.benchmarks import branin
  from skopt.learning import ExtraTreesRegressor, RandomForestRegressor
  from skopt.learning import GradientBoostingQuantileRegressor
  from skopt.optimizer import Optimizer
  from scipy.optimize import OptimizeResult
label_desc: Use image node_id 1 for calling a global function with example usage: test_multiple_asks() without return types