code: def test_svc_kernel_callable(get_mats, get_targets, metric):
      n_matrices, n_channels = 6, 3
      covmats = get_mats(n_matrices, n_channels, "spd")
      targets = get_targets(n_matrices)
  
      rsvc = SVR(kernel_fct=kernel, metric=metric).fit(covmats, targets)
      rsvc_1 = SVR(metric=metric).fit(covmats, targets)
      p1 = rsvc.predict(covmats[:-1])
      p2 = rsvc_1.predict(covmats[:-1])
      assert np.array_equal(p1, p2)
  
      def custom_kernel(X, Y, Cref, metric):
          return np.ones((len(X), len(Y)))
  
      SVR(kernel_fct=custom_kernel, metric=metric).fit(
          covmats, targets
      ).predict(covmats[:-1])
  
      def custom_kernel(X, Y, Cref):
          return np.ones((len(X), len(Y)))
  
      with pytest.raises(TypeError):
          SVR(kernel_fct=custom_kernel, metric=metric).fit(
              covmats, targets
          )
  
      custom_kernel = np.array([1, 2])
      with pytest.raises(TypeError):
          SVR(kernel_fct=custom_kernel, metric=metric).fit(
              covmats, targets
          )
  
      # check if pickleable
      pickle.dumps(rsvc)
      pickle.dumps(rsvc_1)
  
imports: import pickle
  import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from conftest import get_distances, get_means, get_metrics
  from pyriemann.regression import SVR, KNearestNeighborRegressor
  from pyriemann.utils.kernel import kernel
  from pyriemann.utils.mean import mean_covariance
label_desc: Use image node_id 12 for calling a global function with example usage: test_svc_kernel_callable(get_mats, get_targets, metric) and returns: np, np