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 rule for routing incoming requests and building
  URLs. The :meth:`route` decorator is a shortcut to call this
  with the ``view_func`` argument. These are equivalent:
  
  .. code-block:: python
  
      @app.route("/")
      def index():
          ...
  
  .. code-block:: python
  
      def index():
          ...
  
      app.add_url_rule("/", view_func=index)
  
  See :ref:`url-route-registrations`.
  
  The endpoint name for the route defaults to the name of the view
  function if the ``endpoint`` parameter isn't passed. An error
  will be raised if a function has already been registered for the
  endpoint.
  
  The ``methods`` parameter defaults to ``["GET"]``. ``HEAD`` is
  always added automatically, and ``OPTIONS`` is added
  automatically by default.
  
  ``view_func`` does not necessarily need to be passed, but if the
  rule should participate in routing an endpoint name must be
  associated with a view function at some point with the
  :meth:`endpoint` decorator.
  
  .. code-block:: python
  
      app.add_url_rule("/", endpoint="index")
  
      @app.endpoint("index")
      def index():
          ...
  
  If ``view_func`` has a ``required_methods`` attribute, those
  methods are added to the passed and automatic methods. If it
  has a ``provide_automatic_methods`` attribute, it is used as the
  default if the parameter is not passed.
  
  :param rule: The URL rule string.
  :param endpoint: The endpoint name to associate with the rule
      and view function. Used when routing and building URLs.
      Defaults to ``view_func.__name__``.
  :param view_func: The view function to associate with the
      endpoint name.
  :param provide_automatic_options: Add the ``OPTIONS`` method and
      respond to ``OPTIONS`` requests automatically.
  :param options: Extra options passed to the
      :class:`~werkzeug.routing.Rule` object.
docstr_tok: ["Register","a","rule","for","routing","incoming","requests","and","building","URLs",".","The",":","meth",":","`","route","`","decorator","is","a","shortcut","to","call","this","with","the","``","view_func","``","argument",".","These","are","equivalent",":","..","code-block",":",":","python","@","app.route","(","``","\/","''",")","def","index","(",")",":","...","..","code-block",":",":","python","def","index","(",")",":","...","app.add_url_rule","(","``","\/","''",",","view_func=index",")","See",":","ref",":","`","url-route-registrations","`",".","The","endpoint","name","for","the","route","defaults","to","the","name","of","the","view","function","if","the","``","endpoint","``","parameter","is","n't","passed",".","An","error","will","be","raised","if","a","function","has","already","been","registered","for","the","endpoint",".","The","``","methods","``","parameter","defaults","to","``","[","``","GET","''","]","``",".","``","HEAD","``","is","always","added","automatically",",","and","``","OPTIONS","``","is","added","automatically","by","default",".","``","view_func","``","does","not","necessarily","need","to","be","passed",",","but","if","the","rule","should","participate","in","routing","an","endpoint","name","must","be","associated","with","a","view","function","at","some","point","with","the",":","meth",":","`","endpoint","`","decorator",".","..","code-block",":",":","python","app.add_url_rule","(","``","\/","''",",","endpoint=","''","index","''",")","@","app.endpoint","(","``","index","''",")","def","index","(",")",":","...","If","``","view_func","``","has","a","``","required_methods","``","attribute",",","those","methods","are","added","to","the","passed","and","automatic","methods",".","If","it","has","a","``","provide_automatic_methods","``","attribute",",","it","is","used","as","the","default","if","the","parameter","is","not","passed",".",":","param","rule",":","The","URL","rule","string",".",":","param","endpoint",":","The","endpoint","name","to","associate","with","the","rule","and","view","function",".","Used","when","routing","and","building","URLs",".","Defaults","to","``","view_func.__name__","``",".",":","param","view_func",":","The","view","function","to","associate","with","the","endpoint","name",".",":","param","provide_automatic_options",":","Add","the","``","OPTIONS","``","method","and","respond","to","``","OPTIONS","``","requests","automatically",".",":","param","options",":","Extra","options","passed","to","the",":","class",":","`","~werkzeug.routing.Rule","`","object","."]
code: def add_url_rule(
      self,
      rule: str,
      endpoint: str | None = None,
      view_func: ft.RouteCallable | None = None,
      provide_automatic_options: bool | None = None,
      **options: t.Any,
  ) -> None:
      """Register a rule for routing incoming requests and building
      URLs. The :meth:`route` decorator is a shortcut to call this
      with the ``view_func`` argument. These are equivalent:
  
      .. code-block:: python
  
          @app.route("/")
          def index():
              ...
  
      .. code-block:: python
  
          def index():
              ...
  
          app.add_url_rule("/", view_func=index)
  
      See :ref:`url-route-registrations`.
  
      The endpoint name for the route defaults to the name of the view
      function if the ``endpoint`` parameter isn't passed. An error
      will be raised if a function has already been registered for the
      endpoint.
  
      The ``methods`` parameter defaults to ``["GET"]``. ``HEAD`` is
      always added automatically, and ``OPTIONS`` is added
      automatically by default.
  
      ``view_func`` does not necessarily need to be passed, but if the
      rule should participate in routing an endpoint name must be
      associated with a view function at some point with the
      :meth:`endpoint` decorator.
  
      .. code-block:: python
  
          app.add_url_rule("/", endpoint="index")
  
          @app.endpoint("index")
          def index():
              ...
  
      If ``view_func`` has a ``required_methods`` attribute, those
      methods are added to the passed and automatic methods. If it
      has a ``provide_automatic_methods`` attribute, it is used as the
      default if the parameter is not passed.
  
      :param rule: The URL rule string.
      :param endpoint: The endpoint name to associate with the rule
          and view function. Used when routing and building URLs.
          Defaults to ``view_func.__name__``.
      :param view_func: The view function to associate with the
          endpoint name.
      :param provide_automatic_options: Add the ``OPTIONS`` method and
          respond to ``OPTIONS`` requests automatically.
      :param options: Extra options passed to the
          :class:`~werkzeug.routing.Rule` object.
      """
      raise NotImplementedError
  
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 17 for calling the Scaffold obj's underlying member method code with example usage: obj.add_url_rule(rule, endpoint, view_func, provide_automatic_options) without return types