code: def test_kernels_linear(rndstate):
      """Test that linear kernels are related to covariances"""
      n_matrices, n_channels, n_times = 3, 4, 50
      x = rndstate.randn(n_matrices, n_channels, n_times)
  
      covs = Covariances(estimator="cov").fit_transform(x)
      x = x - np.mean(x, axis=-1, keepdims=True)
      x = x / np.sqrt(n_times - 1)
      kernels = Kernels(metric="linear").fit_transform(x)
      assert_array_almost_equal(covs, kernels, 6)
  
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 17 for calling a global function with example usage: test_kernels_linear(rndstate) without return types