code: def _handle_zeros_in_scale(scale, copy=True):
      """Makes sure that whenever scale is zero, we handle it correctly.
  
      This happens in most scalers when we have constant features.
      """
  
      # if we are fitting on 1D arrays, scale might be a scalar
      if np.isscalar(scale):  # pragma: no cover
          if scale == 0.0:
              scale = 1.0
          return scale
      elif (
          hasattr(scale, "ndim") and scale.ndim == 0
      ):  # pragma: no cover
          # scalar that is tensor
          return mt.where(scale == 0.0, 1.0, scale)
      elif isinstance(scale, (np.ndarray, TENSOR_TYPE)):
          if copy:
              # New array to avoid side-effects
              scale = scale.copy()
          scale[scale == 0.0] = 1.0
          return scale
  
file_path: mars/mars/learn/preprocessing/_data.py
imports: import numpy
  from sklearn.base import TransformerMixin
  from sklearn.utils.validation import check_is_fitted, FLOAT_DTYPES
  from ...None import tensor
  from ...tensor.core import TENSOR_TYPE
  from ..base import BaseEstimator
  from ..utils.validation import check_array
label_desc: Use image node_id 1 for calling a global function with example usage: _handle_zeros_in_scale(scale, copy) and returns: scale, mt, scale