code: def test_potato_field_fit(get_mats):
      n_potatoes, n_matrices, n_channels = 2, 6, 3
      covmats1 = get_mats(n_matrices, n_channels, "spd")
      covmats2 = get_mats(n_matrices, n_channels + 1, "spd")
      covmats = [covmats1, covmats2]
      with pytest.raises(ValueError):  # n_potatoes too low
          PotatoField(n_potatoes=0).fit(covmats)
      with pytest.raises(ValueError):  # p_threshold out of bounds
          PotatoField(p_threshold=0).fit(covmats)
      with pytest.raises(ValueError):  # p_threshold out of bounds
          PotatoField(p_threshold=1).fit(covmats)
      pf = PotatoField(n_potatoes=n_potatoes)
      with pytest.raises(
          ValueError
      ):  # n_potatoes not equal to input length
          pf.fit([covmats1, covmats1, covmats2])
      with pytest.raises(ValueError):  # n_matrices not equal
          pf.fit([covmats1, covmats2[:1]])
  
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 11 for calling a global function with example usage: test_potato_field_fit(get_mats) without return types