code: def adjust_gamma(
      tens: Tensor, gamma: float, gain: float = 1
  ) -> Tensor:
      r"""
          Perform gamma correction on an image.
  
          Also known as Power Law Transform. Intensities in RGB mode are adjusted
          based on the following equation:
          .. math::
              I_{\text{out}} = 255 \times \text{gain} \times \left(\frac{I_{\text{in}}}{255}\right)^{\gamma}
          See `Gamma Correction`_ for more details.
          .. _Gamma Correction: https://en.wikipedia.org/wiki/Gamma_correction
  
      Args:
          tens (Tensor): Any valid ``caer.Tensor``.
          gamma (float): Non negative real number, same as :math:`\gamma` in the equation.
              gamma larger than 1 make the shadows darker,
              while gamma smaller than 1 make dark regions lighter.
          gain (float): The constant multiplier.
  
      Examples::
  
          >> tens = caer.data.sunrise(rgb=True)
          >> filtered = caer.transforms.adjust_gamma(tens, gamma=1.5, rgb=True)
          >> filtered
          (427, 640, 3)
  
      """
      tens = to_tensor(tens, enforce_tensor=True)
      cspace = tens.cspace
  
      if gamma < 0:
          raise ValueError("Gamma should be a non-negative real number")
  
      # from here
      # https://stackoverflow.com/questions/33322488/how-to-change-image-illumination-in-opencv-python/41061351
      table = np.array(
          [
              ((i / 255.0) ** gamma) * 255 * gain
              for i in np.arange(0, 256)
          ]
      ).astype("uint8")
  
      tens = cv.LUT(tens, table)
      return to_tensor(tens, cspace=cspace)
  
file_path: caer/caer/transforms/color.py
imports: import numpy
  import random
  import cv2
  import math
  from ..coreten import Tensor, to_tensor
  from ..annotations import Union, List, Tuple
  from .functional import is_list, _hls, _exposure_process
label_desc: Use image node_id 8 for calling a global function with example usage: adjust_gamma(tens, gamma, gain) and returns: to_tensor