code: def test_TS_matdim_error():
      n_matrices, n_channels = 4, 3
      ts = TangentSpace()
      with pytest.raises(ValueError):
          not_square_mat = np.empty(
              (n_matrices, n_channels, n_channels + 1)
          )
          ts.transform(not_square_mat)
      with pytest.raises(ValueError):
          too_many_dim = np.empty((1, 2, 3, 4))
          ts.transform(too_many_dim)
  
file_path: pyRiemann/tests/test_tangentspace.py
imports: from conftest import get_metrics
  import numpy
  from pyriemann.tangentspace import TangentSpace, FGDA
  import pytest
  from pytest import approx
label_desc: Use image node_id 5 for calling a global function with example usage: test_TS_matdim_error() without return types