code: def test_nystroem_singular_kernel():
      # test that nystroem works with singular kernel matrix
      rng = np.random.RandomState(0)
      X = rng.rand(10, 20)
      X = np.vstack([X] * 2)  # duplicate samples
  
      gamma = 100
      N = Nystroem(gamma=gamma, n_components=X.shape[0]).fit(X)
      X_transformed = N.transform(X)
  
      K = rbf_kernel(X, gamma=gamma)
  
      assert_array_almost_equal(
          K, np.dot(X_transformed, X_transformed.T)
      )
      assert np.all(np.isfinite(Y))
  
imports: import re
  import numpy
  import pytest
  from sklearn.datasets import make_classification
  from sklearn.kernel_approximation import AdditiveChi2Sampler, Nystroem, PolynomialCountSketch, RBFSampler, SkewedChi2Sampler
  from sklearn.metrics.pairwise import chi2_kernel, kernel_metrics, polynomial_kernel, rbf_kernel
  from sklearn.utils._testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 19 for calling a global function with example usage: test_nystroem_singular_kernel() without return types