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:
          raise ValueError("Unrecognized Mode")
      return scaled
  
label_desc: Use image node_id 2 for calling a global function with example usage: scale_arr(arr, mode) and returns: scaled