def _ProcessTransforms(self, image, transforms, correct_orientation):
    """Execute PIL operations based on transform values.

    Args:
      image: PIL.Image.Image instance, image to manipulate.
      transforms: list of ImagesTransformRequest.Transform objects.
      correct_orientation: True to indicate that image orientation should be
        corrected based on its EXIF.
    Returns:
      PIL.Image.Image with transforms performed on it.

    Raises:
      BadRequestError if we are passed more than one of the same type of
      transform.
    """
    new_image = image
    if len(transforms) > images.MAX_TRANSFORMS_PER_REQUEST:
      raise apiproxy_errors.ApplicationError(
          images_service_pb.ImagesServiceError.BAD_TRANSFORM_DATA)

    orientation = 1
    if correct_orientation:


      exif = self._GetExifFromImage(image)
      if not exif or _EXIF_ORIENTATION_TAG not in exif:
        correct_orientation = False
      else:
        orientation = exif[_EXIF_ORIENTATION_TAG]

      width, height = new_image.size
      if height > width:
        orientation = 1

    for transform in transforms:







      if (correct_orientation and
          not (transform.has_crop_left_x() or
               transform.has_crop_top_y() or
               transform.has_crop_right_x() or
               transform.has_crop_bottom_y()) and
          not transform.has_horizontal_flip() and
          not transform.has_vertical_flip()):
        new_image = self._CorrectOrientation(new_image, orientation)
        correct_orientation = False

      if transform.has_width() or transform.has_height():

        new_image = self._Resize(new_image, transform)

      elif transform.has_rotate():

        new_image = self._Rotate(new_image, transform)

      elif transform.has_horizontal_flip():

        new_image = new_image.transpose(Image.FLIP_LEFT_RIGHT)

      elif transform.has_vertical_flip():

        new_image = new_image.transpose(Image.FLIP_TOP_BOTTOM)

      elif (transform.has_crop_left_x() or
            transform.has_crop_top_y() or
            transform.has_crop_right_x() or
            transform.has_crop_bottom_y()):

        new_image = self._Crop(new_image, transform)

      elif transform.has_autolevels():


        logging.info("I'm Feeling Lucky autolevels will be visible once this "
                     "application is deployed.")
      else:
        logging.warn("Found no transformations found to perform.")

      if correct_orientation:


        new_image = self._CorrectOrientation(new_image, orientation)
        correct_orientation = False




    return new_image
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/images/images_stub.py/ImagesServiceStub._ProcessTransforms/original