code: def test_encode_decode_domains(rndstate):
      """Test encoding and decoding of domains for data points"""
      n_matrices, n_channels = 4, 2
      X = make_matrices(n_matrices, n_channels, "spd", rs=rndstate)
      y = np.array(
          ["left_hand", "right_hand", "left_hand", "right_hand"]
      )
      domain = np.array(2 * ["source_domain"] + 2 * ["target_domain"])
  
      X_enc, y_enc = encode_domains(X, y, domain)
      assert y_enc[0] == "source_domain/left_hand"
      assert y_enc[1] == "source_domain/right_hand"
      assert y_enc[2] == "target_domain/left_hand"
      assert y_enc[3] == "target_domain/right_hand"
  
      _, y_dec, d_dec = decode_domains(X_enc, y_enc)
      assert (y == y_dec).all()
      assert (domain == d_dec).all()
  
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 1 for calling a global function with example usage: test_encode_decode_domains(rndstate) without return types