code: def after_this_request(
      f: ft.AfterRequestCallable,
  ) -> ft.AfterRequestCallable:
      """Executes a function after this request.  This is useful to modify
      response objects.  The function is passed the response object and has
      to return the same or a new one.
  
      Example::
  
          @app.route('/')
          def index():
              @after_this_request
              def add_header(response):
                  response.headers['X-Foo'] = 'Parachute'
                  return response
              return 'Hello World!'
  
      This is more useful if a function other than the view function wants to
      modify a response.  For instance think of a decorator that wants to add
      some headers without converting the return value into a response object.
  
      .. versionadded:: 0.9
      """
      ctx = _cv_request.get(None)
  
      if ctx is None:
          raise RuntimeError(
              "'after_this_request' can only be used when a request"
              " context is active, such as in a view function."
          )
  
      ctx._after_request_functions.append(f)
      return f
  
imports: from __future__ import annotations
  import contextvars
  import sys
  import typing
  from functools import update_wrapper
  from types import TracebackType
  from werkzeug.exceptions import HTTPException
  from .None import typing
  from .globals import _cv_app
  from .globals import _cv_request
  from .signals import appcontext_popped
  from .signals import appcontext_pushed
label_desc: Use image node_id 1 for calling a global function with example usage: after_this_request(f) and returns: f