code: def test_xdawn_covariances_filters(
      n_classes, nfilter, applyfilters, baseline, rndstate, get_labels
  ):
      n_matrices, n_channels, n_times = 3 * n_classes, 4, 128
      x = rndstate.randn(n_matrices, n_channels, n_times)
      labels = get_labels(n_matrices, n_classes)
      if baseline:
          baseline_cov = np.identity(n_channels)
      else:
          baseline_cov = None
      cov = XdawnCovariances(
          nfilter=nfilter,
          applyfilters=applyfilters,
          baseline_cov=baseline_cov,
      )
      covmats = cov.fit_transform(x, labels)
      assert cov.get_params() == dict(
          nfilter=nfilter,
          applyfilters=applyfilters,
          classes=None,
          estimator="scm",
          xdawn_estimator="scm",
          baseline_cov=baseline_cov,
      )
      protosize = n_classes * min(n_channels, nfilter)
      assert cov.P_.shape == (protosize, n_times)
      if applyfilters:
          covsize = 2 * n_classes * min(n_channels, nfilter)
      else:
          covsize = n_channels + n_classes * min(n_channels, nfilter)
      assert covmats.shape == (n_matrices, covsize, covsize)
  
imports: import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_raises
  import pytest
  from pyriemann.estimation import Covariances, ERPCovariances, XdawnCovariances, CospCovariances, HankelCovariances, Coherences, Shrinkage, BlockCovariances, Kernels
  from pyriemann.utils.test import is_sym_pos_def, is_sym_pos_semi_def
label_desc: Use image node_id 8 for calling a global function with example usage: test_xdawn_covariances_filters(n_classes, nfilter, applyfilters, baseline, rndstate, get_labels) without return types