

def render_response(self, response, renderer=None, renderer_kwargs=None):
    '\n        Renders an unrendered response (a bare value, a (response, status, headers)-:obj:`tuple`, or an :class:`~flask.ext.pushrod.renderers.UnrenderedResponse` object).\n\n        :throws RendererNotFound: If a usable renderer could not be found (explicit renderer argument points to an invalid render, or no acceptable mime types can be used as targets and there is no default renderer)\n        :param response: The response to render\n        :param renderer: The renderer(s) to use (defaults to using :meth:`get_renderer_for_request`)\n        :param renderer_kwargs: Any extra arguments to pass to the renderer\n\n        .. note::\n           For convenience, a bare string (:obj:`unicode`, :obj:`str`, or any other :obj:`basestring` derivative), or a derivative of :class:`werkzeug.wrappers.BaseResponse` (such as :class:`flask.Response`) is passed through unchanged.\n        .. note::\n           A renderer may mark itself as unable to render a specific response by returning :obj:`None`, in which case the next possible renderer is attempted.\n        '
    if renderer:
        if hasattr(renderer, '__iter__'):
            renderers = renderer
        else:
            renderers = [renderer]
    else:
        renderers = self.get_renderers_for_request()
    if (renderer_kwargs is None):
        renderer_kwargs = {
            
        }
    if isinstance(response, tuple):
        (response, status, headers) = response
    else:
        status = headers = None
    if isinstance(response, (basestring, BaseResponse)):
        return response
    if (not isinstance(response, UnrenderedResponse)):
        response = UnrenderedResponse(response, status, headers)
    for renderer in renderers:
        rendered = renderer(response, **renderer_kwargs)
        if (rendered is not NotImplemented):
            return rendered
    raise RendererNotFound()

dataset/ETHPy150Open teozkr/Flask-Pushrod/flask_pushrod/resolver.py Pushrod.render_response/original