code: def test_optimizer_copy(acq_func):
      """Check that base estimator, objective and target values are copied correctly"""
      # TODO: Refactor - Use PyTest
  
      base_estimator = ExtraTreesRegressor(random_state=2)
      opt = Optimizer(
          [(-2.0, 2.0)],
          base_estimator,
          acq_func=acq_func,
          n_initial_points=1,
          acq_optimizer="sampling",
      )
  
      # Run three iterations so that we have some points and objective values
      if "ps" in acq_func:
          opt.run(bench1_with_time, n_iter=3)
      else:
          opt.run(bench1, n_iter=3)
  
      opt_copy = opt.copy()
      copied_estimator = opt_copy.base_estimator
  
      if "ps" in acq_func:
          assert isinstance(copied_estimator, MultiOutputRegressor)
          # Check that `base_estimator` is not wrapped multiple times
          assert not isinstance(
              copied_estimator.estimator, MultiOutputRegressor
          )
      else:
          assert not isinstance(copied_estimator, MultiOutputRegressor)
  
      assert_array_equal(opt_copy.Xi, opt.Xi)
      assert_array_equal(opt_copy.yi, opt.yi)
  
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 8 for calling a global function with example usage: test_optimizer_copy(acq_func) without return types