code: def test_works_with_df_if_fold_indexes_missing():
      """This is a regression test to make sure fitting will still work even if
      training data has ids that cannot be indexed using the indexes from the cv
      (e.g. skf)
  
      Some possibilities:
      + Output of the folds are not neatly consecutive (i.e. [341, 345, 543, ...]
        instead of [0, 1, ... n])
      + Indexes just start from some number greater than the size of the input
        (see test case)
  
      Training data sometimes has ids that carry other information, and selection
      of rows based on cv should not break.
  
      This is fixed in the code using `safe_indexing`
      """
  
      np.random.seed(123)
      rf = RandomForestClassifier(n_estimators=10, random_state=42)
      lr = LogisticRegression(multi_class="ovr", solver="liblinear")
      stclf = StackingCVClassifier(
          classifiers=[rf, rf],
          meta_classifier=lr,
          random_state=42,
          use_features_in_secondary=True,
      )
  
      X_modded = pd.DataFrame(
          X_breast, index=np.arange(X_breast.shape[0]) + 1000
      )
      y_modded = pd.Series(
          y_breast, index=np.arange(y_breast.shape[0]) + 1000
      )
  
      X_train, X_test, y_train, y_test = train_test_split(
          X_modded, y_modded, test_size=0.3
      )
  
      # dense
      stclf.fit(X_train, y_train)
  
      if Version(sklearn_version) < Version("0.22"):
          assert round(stclf.score(X_train, y_train), 2) == 0.99, round(
              stclf.score(X_train, y_train), 2
          )
      else:
          assert round(stclf.score(X_train, y_train), 2) == 0.98, round(
              stclf.score(X_train, y_train), 2
          )
  
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 25 for calling a global function with example usage: test_works_with_df_if_fold_indexes_missing() without return types