code: def test_ajd():
      """Test approximate joint diagonalization."""
      # The implementation should obtain the same
      # results as the Matlab implementation by Pham Dinh-Tuan.
      # Generate a set of cavariances matrices for test purpose
      n_times, n_channels = 10, 3
      seed = np.random.RandomState(0)
      diags = 2.0 + 0.1 * seed.randn(n_times, n_channels)
      A = 2 * seed.rand(n_channels, n_channels) - 1
      A /= np.atleast_2d(np.sqrt(np.sum(A**2, 1))).T
      covmats = np.empty((n_times, n_channels, n_channels))
      for i in range(n_times):
          covmats[i] = np.dot(np.dot(A, np.diag(diags[i])), A.T)
      V, D = _ajd_pham(covmats)
      # Results obtained with original matlab implementation
      V_matlab = [
          [-3.507280775058041, -5.498189967306344, 7.720624541198574],
          [0.694689013234610, 0.775690358505945, -1.162043086446043],
          [-0.592603135588066, -0.598996925696260, 1.009550086271192],
      ]
      assert_array_almost_equal(V, V_matlab)
  
file_path: mne-python/mne/decoding/tests/test_csp.py
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import Epochs, io, pick_types, read_events
  from mne.decoding.csp import CSP, SPoC, _ajd_pham
label_desc: Use image node_id 6 for calling a global function with example usage: test_ajd() without return types