code: def test_block_covariances(rndstate):
      """Test block covariance"""
      n_matrices, n_channels, n_times = 2, 12, 100
      x = rndstate.randn(n_matrices, n_channels, n_times)
  
      cov = block_covariances(x, [12], estimator="cov")
      assert_array_almost_equal(cov, covariances(x, estimator="cov"))
  
      cov = block_covariances(x, [6, 6], estimator="cov")
      cov2 = covariances(x, estimator="cov")
      covcomp = block_diag(*(cov2[0, :6, :6], cov2[0, 6:12, 6:12]))
      assert_array_almost_equal(cov[0], covcomp)
  
      cov = block_covariances(x, [3, 5, 4], estimator="cov")
      cov2 = covariances(x, estimator="cov")
      covcomp = block_diag(
          *(cov2[0, :3, :3], cov2[0, 3:8, 3:8], cov2[0, 8:12, 8:12])
      )
      assert_array_almost_equal(cov[0], covcomp)
  
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 9 for calling a global function with example usage: test_block_covariances(rndstate) without return types