code: def test_warn_on_re_ask(base_estimator, next_x):
      """Test that `Optimizer.warn_on_re_ask` logs warning when `Optimizer._ask` suggests a point
      that has already been `tell`-ed to `Optimizer`
  
      Notes
      -----
      "DUMMY"/"dummy" is invalid for `base_estimator` here because it always suggests random points
      """
      # Initialize `Optimizer` and `tell` it about `next_x`
      opt = Optimizer(
          [(-2.0, 2.0)],
          base_estimator,
          n_initial_points=1,
          random_state=1,
          warn_on_re_ask=True,
      )
      opt.tell(next_x, 1.0)
  
      # Force `Optimizer._next_x` (set by `Optimizer._tell`) to the point we just told it
      opt._next_x = next_x
  
      with pytest.warns(UserWarning, match="Repeated suggestion: .*"):
          opt.ask()
  
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 15 for calling a global function with example usage: test_warn_on_re_ask(base_estimator, next_x) without return types