code: def test_mdwm(rndstate, domain_tradeoff, metric, n_jobs):
      """Test for MDWM"""
      n_classes, n_matrices = 2, 40
      X, y_enc = make_classification_transfer(
          n_matrices=n_matrices // 4,
          class_sep=5,
          class_disp=1.0,
          random_state=rndstate,
      )
  
      clf = MDWM(
          domain_tradeoff=domain_tradeoff,
          target_domain="target_domain",
          metric=metric,
          n_jobs=n_jobs,
      )
  
      # test fit
      clf.fit(X, y_enc)
      assert_array_equal(clf.classes_, ["1", "2"])
  
      X, y, domain = decode_domains(X, y_enc)
      X_source = X[domain == "source_domain"]
      y_source = y[domain == "source_domain"]
      X_target = X[domain == "target_domain"]
      y_target = y[domain == "target_domain"]
  
      if domain_tradeoff == 0.0:
          X_0 = X_source[y_source == clf.classes_[0]]
          X_1 = X_source[y_source == clf.classes_[1]]
      elif domain_tradeoff == 1.0:
          X_0 = X_target[y_target == clf.classes_[0]]
          X_1 = X_target[y_target == clf.classes_[1]]
      elif domain_tradeoff == 0.5:
          X_0 = X[y == clf.classes_[0]]
          X_1 = X[y == clf.classes_[1]]
      M_0 = mean_covariance(X_0, metric=metric)
      assert clf.covmeans_[0] == pytest.approx(M_0)
      M_1 = mean_covariance(X_1, metric=metric)
      assert clf.covmeans_[1] == pytest.approx(M_1)
  
      # test predict
      predicted = clf.predict(X)
      assert predicted.shape == (n_matrices,)
  
      # test predict_proba
      probabilities = clf.predict_proba(X)
      assert probabilities.shape == (n_matrices, n_classes)
      assert probabilities.sum(axis=1) == approx(np.ones(n_matrices))
  
      # test score
      clf.score(X, y_enc)
  
imports: import pytest
  from pytest import approx
  import numpy
  from numpy.testing import assert_array_equal
  from sklearn.model_selection import KFold, StratifiedShuffleSplit
  from sklearn.pipeline import make_pipeline, Pipeline
  from pyriemann.datasets.simulated import make_classification_transfer, make_matrices
  from pyriemann.classification import MDM, FgMDM, KNearestNeighbor, TSclassifier, SVC, MeanField
  from pyriemann.regression import KNearestNeighborRegressor, SVR
  from pyriemann.transfer import decode_domains, encode_domains, TLCenter, TLStretch, TLRotate, TLSplitter, TLClassifier, TLRegressor, MDWM
  from pyriemann.utils.distance import distance, distance_riemann
  from pyriemann.utils.mean import mean_covariance, mean_riemann
  from pyriemann.utils.utils import check_weights
label_desc: Use image node_id 9 for calling a global function with example usage: test_mdwm(rndstate, domain_tradeoff, metric, n_jobs) without return types