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: Get the exception class being handled. For HTTP status codes
  or ``HTTPException`` subclasses, return both the exception and
  status code.
  
  :param exc_class_or_code: Any exception class, or an HTTP status
      code as an integer.
docstr_tok: ["Get","the","exception","class","being","handled",".","For","HTTP","status","codes","or","``","HTTPException","``","subclasses",",","return","both","the","exception","and","status","code",".",":","param","exc_class_or_code",":","Any","exception","class",",","or","an","HTTP","status","code","as","an","integer","."]
code: def _get_exc_class_and_code(
      exc_class_or_code: type[Exception] | int,
  ) -> tuple[type[Exception], int | None]:
      """Get the exception class being handled. For HTTP status codes
      or ``HTTPException`` subclasses, return both the exception and
      status code.
  
      :param exc_class_or_code: Any exception class, or an HTTP status
          code as an integer.
      """
      exc_class: type[Exception]
  
      if isinstance(exc_class_or_code, int):
          try:
              exc_class = default_exceptions[exc_class_or_code]
          except KeyError:
              raise ValueError(
                  f"'{exc_class_or_code}' is not a recognized HTTP"
                  " error code. Use a subclass of HTTPException with"
                  " that code instead."
              ) from None
      else:
          exc_class = exc_class_or_code
  
      if isinstance(exc_class, Exception):
          raise TypeError(
              f"{exc_class!r} is an instance, not a class. Handlers"
              " can only be registered for Exception classes or HTTP"
              " error codes."
          )
  
      if not issubclass(exc_class, Exception):
          raise ValueError(
              f"'{exc_class.__name__}' is not a subclass of Exception."
              " Handlers can only be registered for Exception classes"
              " or HTTP error codes."
          )
  
      if issubclass(exc_class, HTTPException):
          return exc_class, exc_class.code
      else:
          return exc_class, None
  
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 27 for calling the Scaffold obj's underlying member method code with example usage: obj._get_exc_class_and_code(exc_class_or_code) and returns: exc_class,  exc_class, exc_class,  None