code: def test_gridsearch():
      iris = load_iris()
      X = iris.data
      y = iris.target
      knn = KNeighborsClassifier(n_neighbors=2)
  
      sfs1 = SFS(
          estimator=knn,
          k_features=3,
          forward=True,
          floating=False,
          cv=5,
      )
  
      pipe = Pipeline([("sfs", sfs1), ("knn", knn)])
  
      param_grid = [
          {
              "sfs__k_features": [1, 2, 3, 4],
              "sfs__estimator__n_neighbors": [1, 2, 3, 4],
          }
      ]
  
      if Version(sklearn_version) < Version("0.24.1"):
          gs = GridSearchCV(
              estimator=pipe,
              param_grid=param_grid,
              n_jobs=1,
              iid=False,
              cv=5,
              refit=False,
          )
      else:
          gs = GridSearchCV(
              estimator=pipe,
              param_grid=param_grid,
              n_jobs=1,
              cv=5,
              refit=False,
          )
  
      gs = gs.fit(X, y)
  
      assert gs.best_params_["sfs__k_features"] == 3
  
imports: import numpy
  import pandas
  from numpy import nan
  from numpy.testing import assert_almost_equal
  from packaging.version import Version
  from sklearn import __version__
  from sklearn.datasets import load_iris
  from sklearn.decomposition import PCA
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import LinearRegression
  from sklearn.metrics import accuracy_score, make_scorer, roc_auc_score
  from sklearn.model_selection import GridSearchCV, GroupKFold
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.pipeline import Pipeline
  from mlxtend.classifier import SoftmaxRegression
  from mlxtend.data import boston_housing_data
  from mlxtend.feature_selection import SequentialFeatureSelector
  from mlxtend.utils import assert_raises
label_desc: Use image node_id 34 for calling a global function with example usage: test_gridsearch() without return types