code: def test_xdawn_covariances_est(est, xdawn_est, rndstate, get_labels):
      n_classes, nfilter = 2, 3
      n_matrices, n_channels, n_times = 4, 6, 100
      x = rndstate.randn(n_matrices, n_channels, n_times)
      labels = get_labels(n_matrices, n_classes)
      cov = XdawnCovariances(
          nfilter, estimator=est, xdawn_estimator=xdawn_est
      )
      covmats = cov.fit_transform(x, labels)
      assert cov.get_params() == dict(
          nfilter=nfilter,
          applyfilters=True,
          classes=None,
          estimator=est,
          xdawn_estimator=xdawn_est,
          baseline_cov=None,
      )
      protosize = n_classes * min(n_channels, nfilter)
      assert cov.P_.shape == (protosize, n_times)
      covsize = n_channels + n_classes * min(n_channels, nfilter)
      assert covmats.shape == (n_matrices, covsize, covsize)
      assert is_spsd(covmats)
  
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 7 for calling a global function with example usage: test_xdawn_covariances_est(est, xdawn_est, rndstate, get_labels) without return types