code: def test_covariances_cospectrum(rndstate):
      """Test cospectrum"""
      x = rndstate.randn(3, 1000)
      cospectrum(x)
      cospectrum(x, fs=128, fmin=2, fmax=40)
  
      # test equivalence between pyriemann and scipy for cospectra
      fs, window, overlap = 128, 256, 0.75
      cosp_pr, freqs_pr = cospectrum(
          x, fs=fs, window=window, overlap=overlap
      )
      cosp_pr = cosp_pr[0, 1] / np.linalg.norm(
          cosp_pr[0, 1]
      )  # unit norm
      freqs_sp, cross_sp = csd(
          x[0],
          x[1],
          fs=fs,
          nperseg=window,
          noverlap=int(overlap * window),
          window=np.hanning(window),
          detrend=False,
          scaling="spectrum",
      )
      cosp_sp = cross_sp.real / np.linalg.norm(
          cross_sp.real
      )  # unit norm
      # compare frequencies
      assert_array_almost_equal(freqs_pr, freqs_sp, 6)
      # compare co-spectra
      assert_array_almost_equal(cosp_pr, cosp_sp, 6)
  
imports: from numpy.testing import assert_array_almost_equal
  import numpy
  from scipy.linalg import block_diag
  from scipy.signal import welch, csd, coherence
  from sklearn.covariance import empirical_covariance
  import pytest
  from pyriemann.utils.covariance import covariances, covariances_EP, covariances_X, eegtocov, cross_spectrum, cospectrum, coherence, normalize, get_nondiag_weight, block_covariances, _complex_estimator
  from pyriemann.utils.test import is_real, is_hermitian, is_sym_pos_def, is_herm_pos_def
label_desc: Use image node_id 12 for calling a global function with example usage: test_covariances_cospectrum(rndstate) without return types