code: def normalize(image, min_val=None, max_val=None):
      "Normalize the image with given min_val and max val"
      if not isinstance(image, np.ndarray):
          image = np.array(image)
      if min_val is None and max_val is None:
          image = (image - image.min()) / (image.max() - image.min())
      else:
          image = (image - min_val) / (max_val - min_val)
      np.clip(image, 0, 1, out=image)
  
      return image
  
imports: import sys
  import os
  import tools.preprocess_utils.global_var
label_desc: Use image node_id 2 for calling a global function with example usage: normalize(image, min_val, max_val) and returns: image