code: def test_nearest_sym_pos_def(get_mats):
      n_matrices = 3
      mats = get_mats(n_matrices, n_channels, "spd")
      D = mats.diagonal(axis1=1, axis2=2)
      psd = np.array([mat - np.diag(d) for mat, d in zip(mats, D)])
  
      assert not is_pos_def(psd)
      assert is_sym_pos_def(nearest_sym_pos_def(mats))
      assert is_sym_pos_def(nearest_sym_pos_def(psd))
  
file_path: pyRiemann/tests/test_utils_base.py
imports: import pytest
  import numpy
  from numpy.testing import assert_array_almost_equal
  from pyriemann.utils.base import expm, invsqrtm, logm, powm, sqrtm, nearest_sym_pos_def
  from pyriemann.utils.mean import mean_riemann
  from pyriemann.utils.test import is_pos_def, is_sym_pos_def
label_desc: Use image node_id 11 for calling a global function with example usage: test_nearest_sym_pos_def(get_mats) without return types