code: def test_cross_val_predict():
      """Test cross_val_predict with predict_proba."""
      from sklearn.base import BaseEstimator, clone
      from sklearn.discriminant_analysis import (
          LinearDiscriminantAnalysis,
      )
      from sklearn.linear_model import LinearRegression
      from sklearn.model_selection import cross_val_predict
  
      rng = np.random.RandomState(42)
      X = rng.randn(10, 1, 3)
      y = rng.randint(0, 2, 10)
  
      estimator = SlidingEstimator(LinearRegression())
      cross_val_predict(estimator, X, y, cv=2)
  
      class Classifier(BaseEstimator):
          """Moch class that does not have classes_ attribute."""
  
          def __init__(self):
              self.base_estimator = LinearDiscriminantAnalysis()
  
          def fit(self, X, y):
              self.estimator_ = clone(self.base_estimator).fit(X, y)
              return self
  
          def predict_proba(self, X):
              return self.estimator_.predict_proba(X)
  
      with pytest.raises(AttributeError, match="classes_ attribute"):
          estimator = SlidingEstimator(Classifier())
          cross_val_predict(
              estimator, X, y, method="predict_proba", cv=2
          )
  
      estimator = SlidingEstimator(LinearDiscriminantAnalysis())
      cross_val_predict(estimator, X, y, method="predict_proba", cv=2)
  
file_path: mne-python/mne/decoding/tests/test_search_light.py
imports: import platform
  from inspect import signature
  import numpy
  import pytest
  from numpy.testing import assert_array_equal, assert_equal
  from mne.decoding.search_light import GeneralizingEstimator, SlidingEstimator
  from mne.decoding.transformer import Vectorizer
  from mne.utils import _record_warnings, check_version, use_log_level
label_desc: Use image node_id 5 for calling a global function with example usage: test_cross_val_predict() and returns: self, self