code: def scale_arr(arr, mode="minmax"):
      if mode == "minmax":
          from sklearn.preprocessing import MinMaxScaler
  
          scaled = MinMaxScaler().fit_transform(arr).astype("float32")
      elif mode == "standard":
          from sklearn.preprocessing import StandardScaler
  
          scaled = StandardScaler().fit_transform(arr).astype("float32")
      else:
          from bigdl.nano.utils.common import invalidInputError
  
          invalidInputError(False, "Unrecognized Mode")
      return scaled
  
file_path: BigDL/python/chronos/src/bigdl/chronos/detector/anomaly/util.py
imports: import numpy
  from logging import warning
label_desc: Use image node_id 3 for calling a global function with example usage: scale_arr(arr, mode) and returns: scaled