def transform(self):  # type: () -> _worker.Response
        """Take a request with input data, deserialize it, make a prediction, and return a
        serialized response.

        Returns:
            sagemaker_containers.beta.framework.worker.Response: a Flask response object with
                the following args:

                * response: the serialized data to return
                * accept: the content type that the data was serialized into
        """
        request = _worker.Request()
        result = self._transform_fn(self._model, request.content, request.content_type, request.accept)

        if isinstance(result, tuple):
            # transforms tuple in Response for backwards compatibility
            return _worker.Response(response=result[0], mimetype=result[1])

        return result
def transform ( self ) : request = _worker . Request ( ) result = self . _transform_fn ( self . _model , request . content , request . content_type , request . accept ) if isinstance ( result , tuple ) : return _worker . Response ( response = result [ 0 ] , mimetype = result [ 1 ] ) return result
Take a request with input data, deserialize it, make a prediction, and return a
        serialized response.

        Returns:
            sagemaker_containers.beta.framework.worker.Response: a Flask response object with
                the following args:

                * response: the serialized data to return
                * accept: the content type that the data was serialized into