code: def test_ajdc_inverse_transform(rndstate):
      n_subjects, n_conditions, n_channels, n_times = 2, 2, 5, 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)
      Xt = ajdc.transform(X_new)
      Xit = ajdc.inverse_transform(Xt)
      assert_array_equal(Xit.shape, [n_matrices, n_channels, n_times])
      with pytest.raises(ValueError):  # not 3 dims
          ajdc.inverse_transform(Xt[0])
      with pytest.raises(ValueError):  # unequal # of sources
          shape = (n_matrices, ajdc.n_sources_ + 1, 1)
          ajdc.inverse_transform(rndstate.randn(*shape))
  
      Xit = ajdc.inverse_transform(Xt, supp=[ajdc.n_sources_ - 1])
      assert Xit.shape == (n_matrices, n_channels, n_times)
      with pytest.raises(ValueError):  # not a list
          ajdc.inverse_transform(Xt, supp=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 17 for calling a global function with example usage: test_ajdc_inverse_transform(rndstate) without return types