code: def test_connectivity_measure_errors():
      # Raising error for input subjects not iterable
      conn_measure = ConnectivityMeasure()
  
      with pytest.raises(
          ValueError,
          match="'subjects' input argument must be an iterable",
      ):
          conn_measure.fit(1.0)
  
      # input subjects not 2D numpy.ndarrays
      with pytest.raises(
          ValueError, match="Each subject must be 2D numpy.ndarray."
      ):
          conn_measure.fit([np.ones((100, 40)), np.ones((10,))])
  
      # input subjects with different number of features
      with pytest.raises(
          ValueError,
          match="All subjects must have the same number of features.",
      ):
          conn_measure.fit([np.ones((100, 40)), np.ones((100, 41))])
  
      # fit_transform with a single subject and kind=tangent
      conn_measure = ConnectivityMeasure(kind="tangent")
  
      with pytest.raises(
          ValueError,
          match="Tangent space parametrization .* only be .* group of subjects",
      ):
          conn_measure.fit_transform([np.ones((100, 40))])
  
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 28 for calling a global function with example usage: test_connectivity_measure_errors() without return types