code: def _normalize_for_correlation(data, axis, return_nans=False):
      """normalize the data before computing correlation
  
      The data will be z-scored and divided by sqrt(n)
      along the assigned axis
  
      Parameters
      ----------
      data: 2D array
  
      axis: int
          specify which dimension of the data should be normalized
  
      return_nans: bool, default:False
          If False, return zeros for NaNs; if True, return NaNs
  
      Returns
      -------
      data: 2D array
          the normalized data
      """
      shape = data.shape
      data = zscore(data, axis=axis, ddof=0)
      # if zscore fails (standard deviation is zero),
      # optionally set all values to be zero
      if not return_nans:
          data = np.nan_to_num(data)
      data = data / math.sqrt(shape[axis])
      return data
  
imports: import numpy
  from .None import cython_blas
  from scipy.stats.mstats import zscore
  import math
label_desc: Use image node_id 1 for calling a global function with example usage: _normalize_for_correlation(data, axis, return_nans) and returns: data