code: def test_geometric_mean_diagonal():
      n_matrices = 20
      n_features = 5
      diags = []
      for k in range(n_matrices):
          diag = np.eye(n_features)
          diag[k % n_features, k % n_features] = 1e4 + k
          diag[
              (n_features - 1) // (k + 1), (n_features - 1) // (k + 1)
          ] = (k + 1) * 1e-4
          diags.append(diag)
      geo = np.prod(np.array(diags), axis=0) ** (1 / float(len(diags)))
  
      assert_array_almost_equal(_geometric_mean(diags), geo)
  
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 12 for calling a global function with example usage: test_geometric_mean_diagonal() without return types