code: def test_ajdc_transform_error(rndstate):
      n_subjects, n_conditions, n_channels, n_times = 2, 2, 4, 256
      X = rndstate.randn(n_subjects, n_conditions, n_channels, n_times)
      ajdc = AJDC(dim_red={"warm_restart": np.eye(n_channels - 1)}).fit(
          X
      )
      n_matrices = 4
      X_new = rndstate.randn(n_matrices, n_channels, n_times)
      with pytest.raises(ValueError):  # not 3 dims
          ajdc.transform(X_new[0])
      with pytest.raises(ValueError):  # unequal # of chans
          ajdc.transform(rndstate.randn(n_matrices, n_channels + 1, 1))
  
imports: from conftest import get_metrics
  import pytest
  import numpy
  from numpy.testing import assert_array_equal
  from pyriemann.spatialfilters import Xdawn, CSP, SPoC, BilinearFilter, AJDC
label_desc: Use image node_id 15 for calling a global function with example usage: test_ajdc_transform_error(rndstate) without return types