code: def test_metric_str(classif, metric, get_mats, get_labels):
      n_matrices, n_channels, n_classes = 6, 3, 2
      labels = get_labels(n_matrices, n_classes)
      covmats = get_mats(n_matrices, n_channels, "spd")
      clf = classif(metric=metric)
  
      if classif in [SVC, FgMDM, TSclassifier] and metric not in [
          "riemann",
          "euclid",
          "logeuclid",
      ]:
          with pytest.raises((KeyError, ValueError)):
              clf.fit(covmats, labels).predict(covmats)
      else:
          clf.fit(covmats, labels).predict(covmats)
  
imports: import pickle
  import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from pytest import approx
  from scipy.stats import mode
  from sklearn.dummy import DummyClassifier
  from conftest import get_distances, get_means, get_metrics
  from pyriemann.estimation import Covariances
  from pyriemann.utils.kernel import kernel
  from pyriemann.utils.mean import mean_covariance
  from pyriemann.classification import _mode_2d, MDM, FgMDM, KNearestNeighbor, TSclassifier, SVC, MeanField, class_distinctiveness
label_desc: Use image node_id 14 for calling a global function with example usage: test_metric_str(classif, metric, get_mats, get_labels) without return types