code: def test_linear_regression_sparse_equal_dense(
      fit_intercept, csr_container
  ):
      # Test that linear regression agrees between sparse and dense
      rng = np.random.RandomState(0)
      n_samples = 200
      n_features = 2
      X = rng.randn(n_samples, n_features)
      X[X < 0.1] = 0.0
      Xcsr = csr_container(X)
      y = rng.rand(n_samples)
      params = dict(fit_intercept=fit_intercept)
      clf_dense = LinearRegression(**params)
      clf_sparse = LinearRegression(**params)
      clf_dense.fit(X, y)
      clf_sparse.fit(Xcsr, y)
      assert clf_dense.intercept_ == pytest.approx(
          clf_sparse.intercept_
      )
      assert_allclose(clf_dense.coef_, clf_sparse.coef_)
  
imports: import warnings
  import numpy
  import pytest
  from scipy import linalg, sparse
  from sklearn.datasets import load_iris, make_regression, make_sparse_uncorrelated
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model._base import _preprocess_data, _rescale_data, make_dataset
  from sklearn.preprocessing import add_dummy_feature
  from sklearn.utils._testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.fixes import COO_CONTAINERS, CSC_CONTAINERS, CSR_CONTAINERS, LIL_CONTAINERS
label_desc: Use image node_id 7 for calling a global function with example usage: test_linear_regression_sparse_equal_dense(fit_intercept, csr_container) without return types