code: def test_km_init_metric(
      clust, init, n_init, metric, get_mats, get_labels
  ):
      n_clusters, n_matrices, n_channels = 2, 6, 3
      covmats = get_mats(n_matrices, n_channels, "spd")
      labels = get_labels(n_matrices, n_clusters)
      if init == "ndarray":
          clf = clust(
              n_clusters=n_clusters,
              metric=metric,
              init=covmats[:n_clusters],
              n_init=n_init,
          )
      else:
          clf = clust(
              n_clusters=n_clusters,
              metric=metric,
              init=init,
              n_init=n_init,
          )
      clf.fit(covmats, labels)
      transformed = clf.transform(covmats)
      assert len(transformed) == n_matrices
  
imports: from conftest import get_metrics
  import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from pyriemann.clustering import Kmeans, KmeansPerClassTransform, Potato, PotatoField
label_desc: Use image node_id 1 for calling a global function with example usage: test_km_init_metric(clust, init, n_init, metric, get_mats, get_labels) without return types