code: def test_sparse_preprocess_data_with_return_mean(setup):
      n_samples = 200
      n_features = 2
      # random_state not supported yet in sparse.rand
      X = sparse.rand(
          n_samples, n_features, density=0.5
      )  # , random_state=rng
      X = sparse.csr_matrix(X)
      y = rng.rand(n_samples)
  
      error_msg = re.escape("Does not support sparse input!")
      with pytest.raises(NotImplementedError, match=error_msg):
          Xt, yt, X_mean, y_mean, X_norm = _preprocess_data(
              X,
              y,
              fit_intercept=False,
              normalize=False,
              return_mean=True,
          )
  
      error_msg = re.escape("Does not support sparse input!")
      with pytest.raises(NotImplementedError, match=error_msg):
          Xt, yt, X_mean, y_mean, X_norm = _preprocess_data(
              X,
              y,
              fit_intercept=True,
              normalize=False,
              return_mean=True,
              check_input=False,
          )
  
      error_msg = re.escape("Does not support sparse input!")
      with pytest.raises(NotImplementedError, match=error_msg):
          Xt, yt, X_mean, y_mean, X_norm = _preprocess_data(
              X,
              y,
              fit_intercept=True,
              normalize=True,
              return_mean=True,
              check_input=False,
          )
  
imports: import re
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_almost_equal, assert_allclose
  from scipy import sparse
  from scipy import linalg
  from sklearn.datasets import make_sparse_uncorrelated, make_regression, load_iris
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model._base import make_dataset
  from sklearn.utils import check_random_state
  from ..None import LinearRegression
  from .._base import _preprocess_data, _rescale_data
label_desc: Use image node_id 15 for calling a global function with example usage: test_sparse_preprocess_data_with_return_mean(setup) without return types