code: def test_parallel_classification():
      # Check parallel classification.
      X_train, X_test, y_train, y_test = train_test_split(
          iris.data, iris.target, random_state=0
      )
  
      ensemble = BaggingClassifier(
          DecisionTreeClassifier(), n_jobs=3, random_state=0
      ).fit(X_train, y_train)
  
      # predict_proba
      y1 = ensemble.predict_proba(X_test)
      ensemble.set_params(n_jobs=1)
      y2 = ensemble.predict_proba(X_test)
      assert_array_almost_equal(y1, y2)
  
      ensemble = BaggingClassifier(
          DecisionTreeClassifier(), n_jobs=1, random_state=0
      ).fit(X_train, y_train)
  
      y3 = ensemble.predict_proba(X_test)
      assert_array_almost_equal(y1, y3)
  
      # decision_function
      ensemble = BaggingClassifier(
          SVC(decision_function_shape="ovr"), n_jobs=3, random_state=0
      ).fit(X_train, y_train)
  
      decisions1 = ensemble.decision_function(X_test)
      ensemble.set_params(n_jobs=1)
      decisions2 = ensemble.decision_function(X_test)
      assert_array_almost_equal(decisions1, decisions2)
  
      ensemble = BaggingClassifier(
          SVC(decision_function_shape="ovr"), n_jobs=1, random_state=0
      ).fit(X_train, y_train)
  
      decisions3 = ensemble.decision_function(X_test)
      assert_array_almost_equal(decisions1, decisions3)
  
imports: from itertools import cycle, product
  import joblib
  import numpy
  import pytest
  from sklearn.base import BaseEstimator
  from sklearn.datasets import load_diabetes, load_iris, make_hastie_10_2
  from sklearn.dummy import DummyClassifier, DummyRegressor
  from sklearn.ensemble import BaggingClassifier, BaggingRegressor, HistGradientBoostingClassifier, HistGradientBoostingRegressor
  from sklearn.feature_selection import SelectKBest
  from sklearn.linear_model import LogisticRegression, Perceptron
  from sklearn.model_selection import GridSearchCV, ParameterGrid, train_test_split
  from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import FunctionTransformer, scale
  from sklearn.random_projection import SparseRandomProjection
  from sklearn.svm import SVC, SVR
  from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_array_almost_equal, assert_array_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS
label_desc: Use image node_id 12 for calling a global function with example usage: test_parallel_classification() without return types