code: def test_erp_covariances(
      estimator, svd, n_classes, rndstate, get_labels
  ):
      """Test fit ERPCovariances"""
      n_matrices, n_channels, n_times = 3 * n_classes, 3, 100
      x = rndstate.randn(n_matrices, n_channels, n_times)
      labels = get_labels(n_matrices, n_classes)
      cov = ERPCovariances(estimator=estimator, svd=svd)
      covmats = cov.fit_transform(x, labels)
      assert cov.get_params() == dict(
          classes=None, estimator=estimator, svd=svd
      )
      if svd is None:
          protosize = n_classes * n_channels
          covsize = (1 + n_classes) * n_channels
      else:
          protosize = n_classes * min(svd, n_channels)
          covsize = n_channels + n_classes * min(svd, n_channels)
      assert cov.P_.shape == (protosize, n_times)
      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 4 for calling a global function with example usage: test_erp_covariances(estimator, svd, n_classes, rndstate, get_labels) without return types