code: def test_rbf_sampler():
      # test that RBFSampler approximates kernel on random data
      # compute exact kernel
      gamma = 10.0
      kernel = rbf_kernel(X, Y, gamma=gamma)
  
      # approximate kernel mapping
      rbf_transform = RBFSampler(
          gamma=gamma, n_components=1000, random_state=42
      )
      X_trans = rbf_transform.fit_transform(X)
      Y_trans = rbf_transform.transform(Y)
      kernel_approx = np.dot(X_trans, Y_trans.T)
  
      error = kernel - kernel_approx
      assert np.abs(np.mean(error)) <= 0.01  # close to unbiased
      np.abs(error, out=error)
      assert np.max(error) <= 0.1  # nothing too far off
      assert np.mean(error) <= 0.05
  
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 10 for calling a global function with example usage: test_rbf_sampler() without return types