docstr: Restore custom kernel functions of estimators for predictions
code: def _restore_base_estimators(self, kernel_cache, out, X, cv):
      """Restore custom kernel functions of estimators for predictions"""
      train_folds = {
          fold: train_index for fold, (train_index, _) in enumerate(cv)
      }
  
      for idx, fold, _, est in out:
          if idx in kernel_cache:
              if not hasattr(est, "fit_X_"):
                  raise ValueError(
                      f"estimator {self.base_estimators[idx][0]} uses a custom kernel function, "
                      "but does not have the attribute `fit_X_` after training"
                  )
  
              est.set_params(kernel=self.base_estimators[idx][1].kernel)
              est.fit_X_ = X[train_folds[fold]]
  
      return out
  
imports: import numbers
  from joblib import Parallel, delayed
  import numpy
  from scipy.stats import kendalltau, rankdata, spearmanr
  from sklearn.base import BaseEstimator, clone
  from sklearn.model_selection import check_cv
  from sklearn.utils._param_validation import Interval, StrOptions
  from .base import _fit_and_score
  from .stacking import Stacking
label_desc: Use image node_id 7 for calling the BaseEnsembleSelection obj's underlying member method code with example usage: obj._restore_base_estimators(kernel_cache, out, X, cv) and returns: out