code: def test_kernel_ridge_sparse(sparse_container):
      X_sparse = sparse_container(X)
      pred = (
          Ridge(alpha=1, fit_intercept=False, solver="cholesky")
          .fit(X_sparse, y)
          .predict(X_sparse)
      )
      pred2 = (
          KernelRidge(kernel="linear", alpha=1)
          .fit(X_sparse, y)
          .predict(X_sparse)
      )
      assert_array_almost_equal(pred, pred2)
  
file_path: scikit-learn/sklearn/tests/test_kernel_ridge.py
imports: import numpy
  import pytest
  from sklearn.datasets import make_regression
  from sklearn.kernel_ridge import KernelRidge
  from sklearn.linear_model import Ridge
  from sklearn.metrics.pairwise import pairwise_kernels
  from sklearn.utils._testing import assert_array_almost_equal, ignore_warnings
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS
label_desc: Use image node_id 2 for calling a global function with example usage: test_kernel_ridge_sparse(sparse_container) without return types