code: def test_get_coef_multiclass_full(n_classes, n_channels, n_times):
      """Test a full example with pattern extraction."""
      from sklearn.linear_model import LogisticRegression
      from sklearn.model_selection import StratifiedKFold
      from sklearn.pipeline import make_pipeline
  
      data = np.zeros((10 * n_classes, n_channels, n_times))
      # Make only the first channel informative
      for ii in range(n_classes):
          data[ii * 10 : (ii + 1) * 10, 0] = ii
      events = np.zeros((len(data), 3), int)
      events[:, 0] = np.arange(len(events))
      events[:, 2] = data[:, 0, 0]
      info = create_info(n_channels, 1000.0, "eeg")
      epochs = EpochsArray(data, info, events, tmin=0)
      clf = make_pipeline(
          Scaler(epochs.info),
          Vectorizer(),
          LinearModel(
              LogisticRegression(random_state=0, multi_class="ovr")
          ),
      )
      scorer = "roc_auc_ovr_weighted"
      time_gen = GeneralizingEstimator(clf, scorer, verbose=True)
      X = epochs.get_data(copy=False)
      y = epochs.events[:, 2]
      n_splits = 3
      cv = StratifiedKFold(n_splits=n_splits)
      scores = cross_val_multiscore(time_gen, X, y, cv=cv, verbose=True)
      want = (n_splits,)
      if n_times > 1:
          want += (n_times, n_times)
      assert scores.shape == want
      assert_array_less(0.8, scores)
      clf.fit(X, y)
      patterns = get_coef(clf, "patterns_", inverse_transform=True)
      assert patterns.shape == (n_classes, n_channels, n_times)
      assert_allclose(patterns[:, 1:], 0.0, atol=1e-7)
  
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 5 for calling a global function with example usage: test_get_coef_multiclass_full(n_classes, n_channels, n_times) without return types