code: def test_ajd(ajd, init, get_covmats_params):
      """Test ajd algos"""
      n_matrices, n_channels = 5, 3
      covmats, _, evecs = get_covmats_params(n_matrices, n_channels)
      if init:
          V, D = ajd(covmats)
      else:
          V, D = ajd(covmats, init=evecs)
      assert V.shape == (n_channels, n_channels)
      assert D.shape == (n_matrices, n_channels, n_channels)
  
      if ajd is rjd:
          assert V.T @ V == approx(np.eye(n_channels))
  
file_path: pyRiemann/tests/test_utils_ajd.py
imports: from numpy.testing import assert_array_equal
  import numpy
  import pytest
  from pytest import approx
  from pyriemann.utils.ajd import rjd, ajd_pham, uwedge
label_desc: Use image node_id 1 for calling a global function with example usage: test_ajd(ajd, init, get_covmats_params) without return types