code: def test_metric_string_error(get_mats):
      """Test generic kernel function error raise"""
      n_matrices, n_channels = 5, 3
      X = get_mats(n_matrices, n_channels, "spd")
      with pytest.raises(ValueError):
          kernel(X, metric="foo")
  
file_path: pyRiemann/tests/test_utils_kernel.py
imports: import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal
  import pytest
  from pyriemann.utils.base import logm
  from pyriemann.utils.kernel import kernel, kernel_euclid, kernel_logeuclid, kernel_riemann
  from pyriemann.utils.mean import mean_covariance
  from pyriemann.utils.test import is_sym_pos_semi_def
label_desc: Use image node_id 5 for calling a global function with example usage: test_metric_string_error(get_mats) without return types