parameters: (im, opacity)
return_statement: return im
docstring: Returns an image with reduced opacity if opacity is
      within ``[0, 1]``.
  
      :param im: source image
      :type im: pil.Image
      :param opacity: opacity within ``[0, 1]``
      :type opacity: float
      :returns im: image
      :rtype: pil.Image
  
      >>> im = Image.new('RGBA', (1, 1), (255, 255, 255))
      >>> im = reduce_opacity(im, 0.5)
      >>> im.getpixel((0,0))
      (255, 255, 255, 127)
docstring_summary: Returns an image with reduced opacity if opacity is
      within ``[0, 1]``.
docstring_tokens: Returns an image with reduced opacity if opacity is within [ 0 1 ] .
function: def reduce_opacity(im, opacity):
      """Returns an image with reduced opacity if opacity is
      within ``[0, 1]``.
  
      :param im: source image
      :type im: pil.Image
      :param opacity: opacity within ``[0, 1]``
      :type opacity: float
      :returns im: image
      :rtype: pil.Image
  
      >>> im = Image.new('RGBA', (1, 1), (255, 255, 255))
      >>> im = reduce_opacity(im, 0.5)
      >>> im.getpixel((0,0))
      (255, 255, 255, 127)
      """
      if opacity < 0 or opacity > 1:
          return im
      alpha = get_alpha(im)
      alpha = ImageEnhance.Brightness(alpha).enhance(opacity)
      put_alpha(im, alpha)
      return im
function_tokens: def reduce_opacity ( im , opacity ) : if opacity < 0 or opacity > 1 : return im alpha = get_alpha ( im ) alpha = ImageEnhance . Brightness ( alpha ) . enhance ( opacity ) put_alpha ( im , alpha ) return im