Executes actions of the "after" and "after_METHOD" groups.
    A "response" var will be injected in the current context.

def exec_after_request_actions(actions, response, **kwargs):
    """Executes actions of the "after" and "after_METHOD" groups.
    A "response" var will be injected in the current context.
    """
    current_context["response"] = response
    groups = ("after_" + flask.request.method.lower(), "after")
    try:
        rv = execute_actions(actions, limit_groups=groups, **kwargs)
    except ReturnValueException as e:
        rv = e.value
    if rv:
        return rv
    return response