code: def _assert_connectivity_partial_correlation(connectivities, covs):
      for true_covariance_matrix, estimated_covariance_matrix in zip(
          covs, connectivities
      ):
          precision_matrix = linalg.inv(true_covariance_matrix)
  
          # square root of the diagonal elements of the precision matrix
          d = np.sqrt(np.diag(np.diag(precision_matrix)))
  
          # normalize the computed partial correlation matrix
          # necessary to ensure that the diagonal elements
          # of the partial correlation matrix are equal to 1
          normalized_partial_correlation_matrix = d.dot(
              estimated_covariance_matrix
          ).dot(d)
  
          # expected value
          partial_corrlelation_matrix = -precision_matrix + 2 * np.diag(
              np.diag(precision_matrix)
          )
  
          assert_array_almost_equal(
              normalized_partial_correlation_matrix,
              partial_corrlelation_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 33 for calling a global function with example usage: _assert_connectivity_partial_correlation(connectivities, covs) without return types