code: def test_sample_weight():
      # with no weight given
      np.random.seed(123)
      meta = LogisticRegression(multi_class="ovr", solver="liblinear")
      clf1 = RandomForestClassifier(n_estimators=10)
      clf2 = GaussianNB()
      sclf = StackingCVClassifier(
          classifiers=[clf1, clf2], meta_classifier=meta, shuffle=False
      )
      prob1 = sclf.fit(X_iris, y_iris).predict_proba(X_iris)
  
      # with weight = 1
      np.random.seed(123)
      meta = LogisticRegression(multi_class="ovr", solver="liblinear")
      clf1 = RandomForestClassifier(n_estimators=10)
      clf2 = GaussianNB()
      sclf = StackingCVClassifier(
          classifiers=[clf1, clf2], meta_classifier=meta, shuffle=False
      )
      w = np.ones(len(y_iris))
      prob2 = sclf.fit(X_iris, y_iris, sample_weight=w).predict_proba(
          X_iris
      )
  
      # with random weight
      random.seed(87)
      w = np.array([random.random() for _ in range(len(y_iris))])
      np.random.seed(123)
      meta = LogisticRegression(multi_class="ovr", solver="liblinear")
      clf1 = RandomForestClassifier(n_estimators=10)
      clf2 = GaussianNB()
      sclf = StackingCVClassifier(
          classifiers=[clf1, clf2], meta_classifier=meta, shuffle=False
      )
      prob3 = sclf.fit(X_iris, y_iris, sample_weight=w).predict_proba(
          X_iris
      )
  
      diff12 = np.max(np.abs(prob1 - prob2))
      diff23 = np.max(np.abs(prob2 - prob3))
      assert diff12 < 1e-3, "max diff is %.4f" % diff12
      assert diff23 > 1e-3, "max diff is %.4f" % diff23
  
imports: import random
  import numpy
  import pandas
  import pytest
  from packaging.version import Version
  from scipy import sparse
  from sklearn import __version__
  from sklearn import datasets, exceptions
  from sklearn.base import clone
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import LogisticRegression, PassiveAggressiveClassifier
  from sklearn.metrics import roc_auc_score
  from sklearn.model_selection import GridSearchCV, KFold, cross_val_score, train_test_split
  from sklearn.naive_bayes import GaussianNB
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.svm import SVC
  from mlxtend.classifier import StackingCVClassifier
  from mlxtend.data import iris_data
  from mlxtend.externals.estimator_checks import NotFittedError
  from mlxtend.utils import assert_raises
label_desc: Use image node_id 3 for calling a global function with example usage: test_sample_weight() without return types