class_docstr: Common behavior shared between :class:`~flask.Flask` and
  :class:`~flask.blueprints.Blueprint`.
  
  :param import_name: The import name of the module where this object
      is defined. Usually :attr:`__name__` should be used.
  :param static_folder: Path to a folder of static files to serve.
      If this is set, a static route will be added.
  :param static_url_path: URL prefix for the static route.
  :param template_folder: Path to a folder containing template files.
      for rendering. If this is set, a Jinja loader will be added.
  :param root_path: The path that static, template, and resource files
      are relative to. Typically not set, it is discovered based on
      the ``import_name``.
  
  .. versionadded:: 2.0
class_docstr_tok: ["Common","behavior","shared","between",":","class",":","`","~flask.Flask","`","and",":","class",":","`","~flask.blueprints.Blueprint","`",".",":","param","import_name",":","The","import","name","of","the","module","where","this","object","is","defined",".","Usually",":","attr",":","`","__name__","`","should","be","used",".",":","param","static_folder",":","Path","to","a","folder","of","static","files","to","serve",".","If","this","is","set",",","a","static","route","will","be","added",".",":","param","static_url_path",":","URL","prefix","for","the","static","route",".",":","param","template_folder",":","Path","to","a","folder","containing","template","files",".","for","rendering",".","If","this","is","set",",","a","Jinja","loader","will","be","added",".",":","param","root_path",":","The","path","that","static",",","template",",","and","resource","files","are","relative","to",".","Typically","not","set",",","it","is","discovered","based","on","the","``","import_name","``",".","..","versionadded",":",":","2.0"]
docstr: Register a function to be called when the request context is
  popped. Typically this happens at the end of each request, but
  contexts may be pushed manually as well during testing.
  
  .. code-block:: python
  
      with app.test_request_context():
          ...
  
  When the ``with`` block exits (or ``ctx.pop()`` is called), the
  teardown functions are called just before the request context is
  made inactive.
  
  When a teardown function was called because of an unhandled
  exception it will be passed an error object. If an
  :meth:`errorhandler` is registered, it will handle the exception
  and the teardown will not receive it.
  
  Teardown functions must avoid raising exceptions. If they
  execute code that might fail they must surround that code with a
  ``try``/``except`` block and log any errors.
  
  The return values of teardown functions are ignored.
  
  This is available on both app and blueprint objects. When used on an app, this
  executes after every request. When used on a blueprint, this executes after
  every request that the blueprint handles. To register with a blueprint and
  execute after every request, use :meth:`.Blueprint.teardown_app_request`.
docstr_tok: ["Register","a","function","to","be","called","when","the","request","context","is","popped",".","Typically","this","happens","at","the","end","of","each","request",",","but","contexts","may","be","pushed","manually","as","well","during","testing",".","..","code-block",":",":","python","with","app.test_request_context","(",")",":","...","When","the","``","with","``","block","exits","(","or","``","ctx.pop","(",")","``","is","called",")",",","the","teardown","functions","are","called","just","before","the","request","context","is","made","inactive",".","When","a","teardown","function","was","called","because","of","an","unhandled","exception","it","will","be","passed","an","error","object",".","If","an",":","meth",":","`","errorhandler","`","is","registered",",","it","will","handle","the","exception","and","the","teardown","will","not","receive","it",".","Teardown","functions","must","avoid","raising","exceptions",".","If","they","execute","code","that","might","fail","they","must","surround","that","code","with","a","``","try","``","\/","``","except","``","block","and","log","any","errors",".","The","return","values","of","teardown","functions","are","ignored",".","This","is","available","on","both","app","and","blueprint","objects",".","When","used","on","an","app",",","this","executes","after","every","request",".","When","used","on","a","blueprint",",","this","executes","after","every","request","that","the","blueprint","handles",".","To","register","with","a","blueprint","and","execute","after","every","request",",","use",":","meth",":","`",".Blueprint.teardown_app_request","`","."]
code: def teardown_request(self, f: T_teardown) -> T_teardown:
      """Register a function to be called when the request context is
      popped. Typically this happens at the end of each request, but
      contexts may be pushed manually as well during testing.
  
      .. code-block:: python
  
          with app.test_request_context():
              ...
  
      When the ``with`` block exits (or ``ctx.pop()`` is called), the
      teardown functions are called just before the request context is
      made inactive.
  
      When a teardown function was called because of an unhandled
      exception it will be passed an error object. If an
      :meth:`errorhandler` is registered, it will handle the exception
      and the teardown will not receive it.
  
      Teardown functions must avoid raising exceptions. If they
      execute code that might fail they must surround that code with a
      ``try``/``except`` block and log any errors.
  
      The return values of teardown functions are ignored.
  
      This is available on both app and blueprint objects. When used on an app, this
      executes after every request. When used on a blueprint, this executes after
      every request that the blueprint handles. To register with a blueprint and
      execute after every request, use :meth:`.Blueprint.teardown_app_request`.
      """
      self.teardown_request_funcs.setdefault(None, []).append(f)
      return f
  
imports: from __future__ import annotations
  import importlib.util
  import os
  import pathlib
  import sys
  import typing
  from collections import defaultdict
  from functools import update_wrapper
  from jinja2 import FileSystemLoader
  from werkzeug.exceptions import default_exceptions
  from werkzeug.exceptions import HTTPException
  from werkzeug.utils import cached_property
  from ..None import typing
  from ..cli import AppGroup
  from ..helpers import get_root_path
  from ..templating import _default_template_ctx_processor
label_desc: Use image node_id 21 for calling the Scaffold obj's underlying member method code with example usage: obj.teardown_request(f) and returns: f