code: def test_tlregressors(rndstate, reg, source_domain, target_domain):
      """Test wrapper for regressors in transfer learning"""
  
      def make_regression_transfer(n_matrices, n_channels, rs):
          X = make_matrices(n_matrices, n_channels, "spd", rs=rndstate)
          y = np.random.uniform(low=1.0, high=10.0, size=n_matrices)
          domain = np.array(
              20 * ["source_domain"] + 20 * ["target_domain"]
          )
          _, y_enc = encode_domains(X, y, domain)
          return X, y_enc
  
      n_matrices, n_channels = 40, 2
      X, y_enc = make_regression_transfer(
          n_matrices=n_matrices, n_channels=n_channels, rs=rndstate
      )
  
      tlreg = TLRegressor(target_domain="target_domain", estimator=reg)
      tlreg.domain_weight = {
          "source_domain": source_domain,
          "target_domain": target_domain,
      }
  
      # test fit
      tlreg.fit(X, y_enc)
  
      # test predict
      predicted = tlreg.predict(X)
      assert predicted.shape == (n_matrices,)
  
      # test score
      tlreg.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 8 for calling a global function with example usage: test_tlregressors(rndstate, reg, source_domain, target_domain) and returns: X,  y_enc