code: def add_Poisson_noise(img):
      img = np.clip((img * 255.0).round(), 0, 255) / 255.0
      vals = 10 ** (2 * random.random() + 2.0)  # [2, 4]
      if random.random() < 0.5:
          img = np.random.poisson(img * vals).astype(np.float32) / vals
      else:
          img_gray = np.dot(img[..., :3], [0.299, 0.587, 0.114])
          img_gray = np.clip((img_gray * 255.0).round(), 0, 255) / 255.0
          noise_gray = (
              np.random.poisson(img_gray * vals).astype(np.float32)
              / vals
              - img_gray
          )
          img += noise_gray[:, :, np.newaxis]
      img = np.clip(img, 0.0, 1.0)
      return img
  
imports: import random
  from functools import partial
  import albumentations
  import cv2
  import ldm.modules.image_degradation.utils_image
  import numpy
  import scipy
  import scipy.stats
  import torch
  from scipy import ndimage
  from scipy.interpolate import interp2d
  from scipy.linalg import orth
label_desc: Use image node_id 20 for calling a global function with example usage: add_Poisson_noise(img) and returns: img