human
Complete this python program:
def CreateBlobImageDispatcher(images_stub):
assistant
#Here is the Python code you requested.

    """Function to create a dynamic image serving stub.
    Args:
    images_stub: an images_stub to perform the image resizing on blobs.
    Returns:
    New dispatcher capable of dynamic image serving requests.
    """
    from google.appengine.tools import dev_appserver
    class BlobImageDispatcher(dev_appserver.URLDispatcher, ):
        'Dispatcher    that    handles    image    serving    requests.'
        _size_limit = 1600
        _mime_type_map = {images_service_pb.OutputSettings.JPEG: 'image/jpeg', images_service_pb.OutputSettings.PNG: 'image/png', images_service_pb.OutputSettings.WEBP: 'image/webp'}
        def __init__(self, images_stub):
            'Constructor.\n\n                        Args:\n                                images_stub:    an    images_stub    to    perform    the    image    resizing    on    blobs.\n                        '
            self._images_stub = images_stub
        def _TransformImage(self, blob_key, options):
            'Construct    and    execute    transform    request    to    the    images    stub.\n\n                        Args:\n                                blob_key:    blob_key    to    the    image    to    transform.\n                                options:    resize    and    crop    option    string    to    apply    to    the    image.\n\n                        Returns:\n                                The    tranformed    (if    necessary)    image    bytes.\n                        '
            (resize, crop) = self._ParseOptions(options)
            image_data = images_service_pb.ImageData()
            image_data.set_blob_key(blob_key)
            image = self._images_stub._OpenImageData(image_data)
            original_mime_type = image.format
            (width, height) = image.size
            if crop:
                crop_xform = None
                if (width > height):
                    crop_xform = images_service_pb.Transform()
                    delta = ((width - height) / (width * 2.0))
                    crop_xform.set_crop_left_x(delta)
                    crop_xform.set_crop_right_x((1.0 - delta))
                elif (width < height):
                    crop_xform = images_service_pb.Transform()
                    delta = ((height -...