code: def lighting(img, alphastd, eigval, eigvec):
      """
      Perform AlexNet-style PCA jitter on the given image.
      Args:
          image (array): list of images to perform lighting jitter.
          alphastd (float): jitter ratio for PCA jitter.
          eigval (array): eigenvalues for PCA jitter.
          eigvec (list): eigenvectors for PCA jitter.
      Returns:
          img (tensor): the jittered image.
      """
      if alphastd == 0:
          return img
      # generate alpha1, alpha2, alpha3.
      alpha = np.random.normal(0, alphastd, size=(1, 3))
      eig_vec = np.array(eigvec)
      eig_val = np.reshape(eigval, (1, 3))
      rgb = np.sum(
          eig_vec
          * np.repeat(alpha, 3, axis=0)
          * np.repeat(eig_val, 3, axis=0),
          axis=1,
      )
      for idx in range(img.shape[0]):
          img[idx] = img[idx] + rgb[2 - idx]
      return img
  
imports: import math
  import numpy
  import cv2
label_desc: Use image node_id 21 for calling a global function with example usage: lighting(img, alphastd, eigval, eigvec) and returns: img, img