code: def test_spatial_filters(
      spfilt, n_channels, get_mats, rndstate, get_labels, n_classes
  ):
      if n_classes == 2:
          n_matrices, n_times = 10, 256
      else:
          n_matrices, n_times = 9, 256
      labels = get_labels(n_matrices, n_classes)
      if spfilt is Xdawn:
          X = rndstate.randn(n_matrices, n_channels, n_times)
      elif spfilt in (CSP, SPoC, BilinearFilter):
          X = get_mats(n_matrices, n_channels, "spd")
      elif spfilt is AJDC:
          n_subjects, n_conditions = 2, 2
          X = rndstate.randn(
              n_subjects, n_conditions, n_channels, n_times
          )
  
      clf_fit(spfilt, X, labels, n_channels, n_times)
      clf_fit_independence(spfilt, X, labels, n_channels)
      if spfilt is CSP:
          clf_fit_error(spfilt, X, labels)
      clf_transform(spfilt, X, labels, n_matrices, n_channels, n_times)
      if spfilt in (CSP, SPoC, BilinearFilter):
          clf_transform_error(spfilt, X, labels, n_channels)
  
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 1 for calling a global function with example usage: test_spatial_filters(spfilt, n_channels, get_mats, rndstate, get_labels, n_classes) without return types