code: def sparse_center_data(X, y, fit_intercept, normalize=False):
      """
      Compute information needed to center data to have mean zero along
      axis 0. Be aware that X will not be centered since it would break
      the sparsity, but will be normalized if asked so.
      """
      if fit_intercept:
          # we might require not to change the csr matrix sometimes
          # store a copy if normalize is True.
          # Change dtype to float64 since mean_variance_axis accepts
          # it that way.
          if sp.isspmatrix(X) and X.getformat() == "csr":
              X = sp.csr_matrix(X, copy=normalize, dtype=np.float64)
          else:
              X = sp.csc_matrix(X, copy=normalize, dtype=np.float64)
  
          X_offset, X_var = mean_variance_axis(X, axis=0)
          if normalize:
              # transform variance to std in-place
              X_var *= X.shape[0]
              X_std = np.sqrt(X_var, X_var)
              del X_var
              X_std[X_std == 0] = 1
              inplace_column_scale(X, 1.0 / X_std)
          else:
              X_std = np.ones(X.shape[1])
          y_offset = y.mean(axis=0)
          y = y - y_offset
      else:
          X_offset = np.zeros(X.shape[1])
          X_std = np.ones(X.shape[1])
          y_offset = (
              0.0
              if y.ndim == 1
              else np.zeros(y.shape[1], dtype=X.dtype)
          )
  
      return X, y, X_offset, y_offset, X_std
  
imports: from __future__ import division
  from abc import ABCMeta, abstractmethod
  import numbers
  import warnings
  import numpy
  import scipy.sparse
  from scipy import linalg
  from scipy import sparse
  from ..externals import six
  from ..externals.joblib import Parallel, delayed
  from ..base import BaseEstimator, ClassifierMixin, RegressorMixin
  from ..utils import check_array, check_X_y, deprecated, as_float_array
  from ..utils.validation import FLOAT_DTYPES
  from ..utils import check_random_state
  from ..utils.extmath import safe_sparse_dot
  from ..utils.sparsefuncs import mean_variance_axis, inplace_column_scale
  from ..utils.fixes import sparse_lsqr
  from ..utils.seq_dataset import ArrayDataset, CSRDataset
  from ..utils.validation import check_is_fitted
  from ..exceptions import NotFittedError
  from ..preprocessing.data import normalize
label_desc: Use image node_id 2 for calling a global function with example usage: sparse_center_data(X, y, fit_intercept, normalize) and returns: X,  y,  X_offset,  y_offset,  X_std