code: def clf_fit_error(spfilt, X, labels):
      sf = spfilt()
      with pytest.raises(ValueError):
          sf.fit(X, labels * 0.0)  # 1 class
      with pytest.raises(ValueError):
          sf.fit(X, labels[:1])  # unequal # of samples
      with pytest.raises(TypeError):
          sf.fit(X, "foo")  # y must be an array
      with pytest.raises(TypeError):
          sf.fit("foo", labels)  # X must be an array
      with pytest.raises(ValueError):
          sf.fit(X[:, 0], labels)
      with pytest.raises(ValueError):
          sf.fit(X, X)
  
imports: from conftest import get_metrics
  import pytest
  import numpy
  from numpy.testing import assert_array_equal
  from pyriemann.spatialfilters import Xdawn, CSP, SPoC, BilinearFilter, AJDC
label_desc: Use image node_id 3 for calling a global function with example usage: clf_fit_error(spfilt, X, labels) without return types