code: def solarize_func(img, thresh=128):
      """
      same output as PIL.ImageOps.posterize
      """
      table = np.array(
          [el if el < thresh else 255 - el for el in range(256)]
      )
      table = table.clip(0, 255).astype(np.uint8)
      out = table[img]
      return out
  
imports: import cv2
  import numpy
  import torch
label_desc: Use image node_id 5 for calling a global function with example usage: solarize_func(img, thresh) and returns: out