code: def test_searchcv_runs(surrogate, n_jobs, n_points, cv=None):
      """
      Test whether the cross validation search wrapper around sklearn
      models runs properly with available surrogates and with single
      or multiple workers and different number of parameter settings
      to ask from the optimizer in parallel.
  
      Parameters
      ----------
  
      * `surrogate` [str or None]:
          A class of the scikit-optimize surrogate used. None means
          to use default surrogate.
  
      * `n_jobs` [int]:
          Number of parallel processes to use for computations.
  
      """
  
      X, y = load_iris(return_X_y=True)
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, train_size=0.75, random_state=0
      )
  
      # create an instance of a surrogate if it is not a string
      if surrogate is not None:
          optimizer_kwargs = {"base_estimator": surrogate}
      else:
          optimizer_kwargs = None
  
      opt = BayesSearchCV(
          SVC(),
          {
              "C": Real(1e-6, 1e6, prior="log-uniform"),
              "gamma": Real(1e-6, 1e1, prior="log-uniform"),
              "degree": Integer(1, 8),
              "kernel": Categorical(["linear", "poly", "rbf"]),
          },
          n_jobs=n_jobs,
          n_iter=11,
          n_points=n_points,
          cv=cv,
          optimizer_kwargs=optimizer_kwargs,
      )
  
      opt.fit(X_train, y_train)
  
      # this normally does not hold only if something is wrong
      # with the optimizaiton procedure as such
      assert opt.score(X_test, y_test) > 0.9
  
imports: import pytest
  from sklearn.datasets import load_iris, make_classification
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import Pipeline
  from sklearn.svm import SVC, LinearSVC
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.base import clone
  from sklearn.base import BaseEstimator
  from scipy.stats import rankdata
  import numpy
  from numpy.testing import assert_array_equal
  from skopt.space import Real, Categorical, Integer
  from skopt import BayesSearchCV
label_desc: Use image node_id 3 for calling a global function with example usage: test_searchcv_runs(surrogate, n_jobs, n_points, cv) without return types