def post_process_request(req, template, data, metadata=None, method=None):
    """Do any post-processing the request might need

        This typically means adding values to the template `data`
        dictionary, or changing the Jinja2 template.

        `data` and `metdata` may be updated in place.

        Always returns a tuple of ``(template, data)`` or ``(template,
        data, metadata)``, even if unchanged.

        Be aware that returning a ``(template, data, None)`` triple
        will be interpreted as using the legacy API and will indicate
        that the template is a legacy Genshi template. The same will
        happen if the third value of the tuple is a string.

        The `method` last parameter is deprecated and is now supposed
        to be passed as `'method'` in the `metadata` dict. Even
        better, use directly the `'text'` indication (`True` or
        `False`).

        Note that `template`, `data`, `content_type` will be `None` if:
         - called when processing an error page
         - the default request handler did not return any result

        :Since 1.0: Clearsilver templates are no longer supported.

        :Since 1.1.2: the rendering `method` will be passed if it is returned
           by the request handler, otherwise `method` will be `None`. For
           backward compatibility, the parameter is optional in the
           implementation's signature.

        :Since 1.3.2: Genshi templates are still supported, and if
           `process_request` used the old API (`(template, data,
           content_type)`), the `metadata` parameter passed to
           `post_process_request` will actually be the `content_type`
           value (`String` or `None`).  This support for the old API
           will be removed in Trac 1.5.1, in which `metadata` will
           always be a `dict` or `None`.

        """
