code: def test_cross_val_multiscore():
      """Test cross_val_multiscore for computing scores on decoding over time."""
      from sklearn.linear_model import (
          LinearRegression,
          LogisticRegression,
      )
      from sklearn.model_selection import (
          KFold,
          StratifiedKFold,
          cross_val_score,
      )
  
      logreg = LogisticRegression(solver="liblinear", random_state=0)
  
      # compare to cross-val-score
      X = np.random.rand(20, 3)
      y = np.arange(20) % 2
      cv = KFold(2, random_state=0, shuffle=True)
      clf = logreg
      assert_array_equal(
          cross_val_score(clf, X, y, cv=cv),
          cross_val_multiscore(clf, X, y, cv=cv),
      )
  
      # Test with search light
      X = np.random.rand(20, 4, 3)
      y = np.arange(20) % 2
      clf = SlidingEstimator(logreg, scoring="accuracy")
      scores_acc = cross_val_multiscore(clf, X, y, cv=cv)
      assert_array_equal(np.shape(scores_acc), [2, 3])
  
      # check values
      scores_acc_manual = list()
      for train, test in cv.split(X, y):
          clf.fit(X[train], y[train])
          scores_acc_manual.append(clf.score(X[test], y[test]))
      assert_array_equal(scores_acc, scores_acc_manual)
  
      # check scoring metric
      # raise an error if scoring is defined at cross-val-score level and
      # search light, because search light does not return a 1-dimensional
      # prediction.
      pytest.raises(
          ValueError,
          cross_val_multiscore,
          clf,
          X,
          y,
          cv=cv,
          scoring="roc_auc",
      )
      clf = SlidingEstimator(logreg, scoring="roc_auc")
      scores_auc = cross_val_multiscore(clf, X, y, cv=cv, n_jobs=None)
      scores_auc_manual = list()
      for train, test in cv.split(X, y):
          clf.fit(X[train], y[train])
          scores_auc_manual.append(clf.score(X[test], y[test]))
      assert_array_equal(scores_auc, scores_auc_manual)
  
      # indirectly test that cross_val_multiscore rightly detects the type of
      # estimator and generates a StratifiedKFold for classiers and a KFold
      # otherwise
      X = np.random.randn(1000, 3)
      y = np.ones(1000, dtype=int)
      y[::2] = 0
      clf = logreg
      reg = LinearRegression()
      for cross_val in (cross_val_score, cross_val_multiscore):
          manual = cross_val(clf, X, y, cv=StratifiedKFold(2))
          auto = cross_val(clf, X, y, cv=2)
          assert_array_equal(manual, auto)
  
          manual = cross_val(reg, X, y, cv=KFold(2))
          auto = cross_val(reg, X, y, cv=2)
          assert_array_equal(manual, auto)
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_array_less, assert_equal
  from mne import EpochsArray, create_info
  from mne.decoding import GeneralizingEstimator, Scaler, TransformerMixin, Vectorizer
  from mne.decoding.base import BaseEstimator, LinearModel, _get_inverse_funcs, cross_val_multiscore, get_coef
  from mne.decoding.search_light import SlidingEstimator
label_desc: Use image node_id 7 for calling a global function with example usage: test_cross_val_multiscore() without return types