code: def test_sample_weight():
      lr = LinearRegression()
      svr_lin = SVR(kernel="linear", gamma="auto")
      ridge = Ridge(random_state=1)
      svr_rbf = SVR(kernel="rbf", gamma="auto")
      stack = StackingCVRegressor(
          regressors=[svr_lin, lr, ridge],
          meta_regressor=svr_rbf,
          cv=KFold(4, shuffle=True, random_state=7),
      )
      pred1 = stack.fit(X1, y, sample_weight=w).predict(X1)
      mse = 0.21  # 0.20770
      got = np.mean((stack.predict(X1) - y) ** 2)
      assert round(got, 2) == mse, "Expected %.2f, but got %.5f" % (
          mse,
          got,
      )
      pred2 = stack.fit(X1, y).predict(X1)
      maxdiff = np.max(np.abs(pred1 - pred2))
      assert maxdiff > 1e-3, "max diff is %.4f" % maxdiff
  
imports: import random
  import numpy
  import pytest
  from packaging.version import Version
  from scipy import sparse
  from sklearn import __version__
  from sklearn.base import clone
  from sklearn.linear_model import Lasso, LinearRegression, Ridge
  from sklearn.model_selection import GridSearchCV, KFold, train_test_split
  from sklearn.neighbors import KNeighborsRegressor
  from sklearn.svm import SVR
  from mlxtend.externals.estimator_checks import NotFittedError
  from mlxtend.regressor import StackingCVRegressor
  from mlxtend.utils import assert_raises
label_desc: Use image node_id 15 for calling a global function with example usage: test_sample_weight() without return types