def _parse_options(self, options):
    """Parse an options string into a tuple containing the options.

    Currently this only supports resize and crop.

    Args:
      options: A str containing the url resize and crop options.

    Returns:
      A tuple (resize, crop) parsed from the string.

    Raises:
      InvalidRequestError: The requested resize is invalid.
    """
    match = _OPTIONS_RE.search(options)
    resize = None
    crop = False
    if match:
      if match.group(1):
        resize = int(match.group(1))
      if match.group(2):
        crop = True

    # Check size against whitelist
    if resize and (resize > _SIZE_LIMIT or resize < 0):
      logging.error('Invalid resize: %r', resize)
      raise InvalidRequestError()
    return (resize, crop)
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/blob_image.py/Application._parse_options/original