def _BackendPremultiplication(color):
  """Apply premultiplication and unpremultiplication to match production.

  Args:
    color: color tuple as returned by _ArgbToRgbaTuple.

  Returns:
    RGBA tuple.
  """




  alpha = color[3]
  rgb = color[0:3]
  multiplied = [(x * (alpha + 1)) >> 8 for x in rgb]
  if alpha:
    alpha_inverse = 0xffffff / alpha
    unmultiplied = [(x * alpha_inverse) >> 16 for x in multiplied]
  else:
    unmultiplied = [0] * 3

  return tuple(unmultiplied + [alpha])
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/images/images_stub.py/_BackendPremultiplication/original