code: def _assert_connectivity_correlation(
      connectivities, cov_estimator, covs
  ):
      """Verify that the estimated covariance matrix: \
          - is symmetric and positive definite
          - has values close to 1 on its diagonal
  
      If the covariance estimator is EmpiricalCovariance,
      the product of:
          - the square root of the diagonal of the true covariance matrix,
          - the estimated covariance matrix,
          - the square root of the diagonal of the true covariance matrix,
  
      should be close to the true covariance matrix.
      """
      for true_covariance_matrix, estimated_covariance_matrix in zip(
          covs, connectivities
      ):
          assert is_spd(estimated_covariance_matrix, decimal=7)
  
          assert_array_almost_equal(
              np.diag(estimated_covariance_matrix), np.ones(N_FEATURES)
          )
  
          if cov_estimator == EmpiricalCovariance():
              # square root of the diagonal of the true covariance matrix
              d = np.sqrt(np.diag(np.diag(true_covariance_matrix)))
  
              assert_array_almost_equal(
                  d.dot(estimated_covariance_matrix).dot(d),
                  true_covariance_matrix,
              )
  
imports: import copy
  import warnings
  from math import cosh, exp, log, sinh, sqrt
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from pandas import DataFrame
  from scipy import linalg
  from sklearn.covariance import EmpiricalCovariance, LedoitWolf
  from nilearn._utils.extmath import is_spd
  from nilearn.connectome.connectivity_matrices import ConnectivityMeasure, _check_spd, _check_square, _form_symmetric, _geometric_mean, _map_eigenvalues, prec_to_partial, sym_matrix_to_vec, vec_to_sym_matrix
  from nilearn.tests.test_signal import generate_signals
label_desc: Use image node_id 32 for calling a global function with example usage: _assert_connectivity_correlation(connectivities, cov_estimator, covs) without return types