parameters: (img, gamma, gain)
return_statement: return img
docstring: Adjust gamma of the input PIL image.
  
      Args:
          img (PIL image): Image to be augmented with AdjustGamma.
          gamma (float): Non negative real number, same as gamma in the equation.
          gain (float, optional): The constant multiplier.
  
      Returns:
          img (PIL image), Augmented image.
docstring_summary: Adjust gamma of the input PIL image.
docstring_tokens: Adjust gamma of the input PIL image .
function: def adjust_gamma(img, gamma, gain):
      """
      Adjust gamma of the input PIL image.
  
      Args:
          img (PIL image): Image to be augmented with AdjustGamma.
          gamma (float): Non negative real number, same as gamma in the equation.
          gain (float, optional): The constant multiplier.
  
      Returns:
          img (PIL image), Augmented image.
  
      """
  
      if not is_pil(img):
          raise TypeError("img should be PIL image. Got {}.".format(type(img)))
  
      gamma_table = [(255 + 1 - 1e-3) * gain * pow(x / 255., gamma) for x in range(256)]
      if len(img.split()) == 3:
          gamma_table = gamma_table * 3
          img = img.point(gamma_table)
      elif len(img.split()) == 1:
          img = img.point(gamma_table)
      return img
function_tokens: def adjust_gamma ( img , gamma , gain ) : if not is_pil ( img ) : raise TypeError ( "img should be PIL image. Got {}." . format ( type ( img ) ) ) gamma_table = [ ( 255 + 1 - 1e-3 ) * gain * pow ( x / 255. , gamma ) for x in range ( 256 ) ] if len ( img . split ( ) ) == 3 : gamma_table = gamma_table * 3 img = img . point ( gamma_table ) elif len ( img . split ( ) ) == 1 : img = img . point ( gamma_table ) return img