code: def test_preprocess_data(setup):
      n_samples = 200
      n_features = 2
      X = rng.rand(n_samples, n_features)
      y = rng.rand(n_samples)
      expected_X_mean = np.mean(X, axis=0)
      expected_X_norm = np.std(X, axis=0) * np.sqrt(X.shape[0])
      expected_y_mean = np.mean(y, axis=0)
  
      Xt, yt, X_mean, y_mean, X_norm = _preprocess_data(
          X, y, fit_intercept=False, normalize=False
      )
      assert_array_almost_equal(X_mean, np.zeros(n_features))
      assert_array_almost_equal(y_mean, 0)
      assert_array_almost_equal(X_norm, np.ones(n_features))
      assert_array_almost_equal(Xt, X)
      assert_array_almost_equal(yt, y)
  
      Xt, yt, X_mean, y_mean, X_norm = _preprocess_data(
          X, y, fit_intercept=True, normalize=False
      )
      assert_array_almost_equal(X_mean, expected_X_mean)
      assert_array_almost_equal(y_mean, expected_y_mean)
      assert_array_almost_equal(X_norm, np.ones(n_features))
      assert_array_almost_equal(Xt, X - expected_X_mean)
      assert_array_almost_equal(yt, y - expected_y_mean)
  
      Xt, yt, X_mean, y_mean, X_norm = _preprocess_data(
          X, y, fit_intercept=True, normalize=True
      )
      assert_array_almost_equal(X_mean, expected_X_mean)
      assert_array_almost_equal(y_mean, expected_y_mean)
      assert_array_almost_equal(X_norm, expected_X_norm)
      assert_array_almost_equal(
          Xt, (X - expected_X_mean) / expected_X_norm
      )
      assert_array_almost_equal(yt, y - expected_y_mean)
  
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 12 for calling a global function with example usage: test_preprocess_data(setup) without return types