Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias identifier ImportFrom alias ImportFrom alias alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias ImportFrom alias alias Assign NameStore Call NameLoad Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore ListLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr CompareNotIn NameLoad TupleLoad NameLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assert CompareIsNot NameLoad NameLoad Str Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call NameLoad NameLoad NameLoad Return Call NameLoad NameLoad decorator_list Return Call NameLoad NameLoad NameLoad FunctionDef arguments args defaults body Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Raise Call NameLoad Str With NameLoad body Expr Yield NameLoad TryFinally body For NameStore NameLoad body Expr Yield NameLoad finalbody If Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad Expr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str If UnaryOpNot NameLoad body Return Call AttributeLoad NameLoad attr If CompareEq Call NameLoad NameLoad Num body Assign NameStore SubscriptLoad NameLoad Index Num Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Raise Call NameLoad Str If CompareIsNot NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body If CompareEq SubscriptLoad NameLoad Slice Num Str body If CompareIsNot NameLoad NameLoad body Assign NameStore BinOpAdd NameLoad NameLoad orelse Assign NameStore SubscriptLoad NameLoad Slice Num orelse If CompareNotIn Str NameLoad body If CompareIsNot NameLoad NameLoad body Assign NameStore BinOpAdd BinOpAdd NameLoad Str NameLoad orelse If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad orelse Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad If CompareIsNot NameLoad NameLoad body AugAssignAdd NameStore BinOpAdd Str Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad ListLoad body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareIs NameLoad NameLoad body Assign AttributeStore AttributeLoad NameLoad attr attr NameStore IfExp CompareIn Str NameLoad Call AttributeLoad NameLoad attr Str ListLoad If NameLoad body Assign NameStore Call NameLoad Call NameLoad Lambda arguments args NameParam defaults CompareIn SubscriptLoad NameLoad Index Num NameLoad NameLoad If UnaryOpNot NameLoad body Return ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad orelse ImportFrom alias Assign NameStore NameLoad Assign NameStore Call NameLoad NameLoad Str NameLoad If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot NameLoad Call NameLoad NameLoad NameLoad body Expr Call NameLoad Call NameLoad Str keyword Num If NameLoad body Expr Call NameLoad Call NameLoad Str keyword Num If CompareIsNot NameLoad NameLoad body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareIs NameLoad NameLoad BoolOpOr NameLoad NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr BoolOpOr NameLoad NameLoad Index Num If CompareIs NameLoad NameLoad body Assign NameStore Str Assign NameStore Call NameLoad If NameLoad body If CompareIs NameLoad NameLoad body If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Str Str keyword NameLoad If BoolOpAnd AttributeLoad NameLoad attr NameLoad body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore NameLoad orelse If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad BinOpAdd Call NameLoad NameLoad If BoolOpAnd NameLoad CompareIsNot NameLoad NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpBitAnd Call NameLoad IfExp Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Str NameLoad Num handlers ExceptHandler type NameLoad body Expr Call NameLoad BinOpMod Str NameLoad keyword Num If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body If CompareIn NameLoad NameLoad body Raise Call NameLoad If BoolOpOr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad CompareEq NameLoad Str Call AttributeLoad NameLoad attr Str body Raise Call NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad TryExcept body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Raise Call NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad Call NameLoad NameLoad Str body Return Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr CompareIs NameLoad NameLoad CompareEq NameLoad Str body Return Call AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Expr Call NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call NameLoad NameLoad Str NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad Str body Return Call AttributeLoad NameLoad attr NameLoad orelse If BoolOpAnd CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Return NameLoad Raise Call NameLoad BinOpMod Str AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr CompareIs NameLoad NameLoad CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse Expr Call NameLoad NameLoad Assign NameStore AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr NameLoad body Return TupleLoad NameLoad NameLoad orelse If CompareEq Call AttributeLoad NameLoad attr Str body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareEq Call AttributeLoad NameLoad attr Str body Assign NameStore NameLoad orelse If CompareEq Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Return NameLoad With AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad NameLoad NameLoad keyword Str Delete NameDel NameDel FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return BinOpAdd Str Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad NameLoad NameLoad Delete NameDel NameDel FunctionDef arguments args NameParam defaults body Expr Str Return CompareIsNot AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str If CompareNotIn NameLoad TupleLoad Str Str body Raise Call NameLoad Str Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BinOpAdd BinOpMult BinOpMult BinOpMult AttributeLoad NameLoad attr Num Num Num AttributeLoad NameLoad attr decorator_list
N/A N/A 
    flask.helpers
    ~~~~~~~~~~~~~

    Implements various helpers.

    :copyright: (c) 2015 by Armin Ronacher.
    :license: BSD, see LICENSE for more details.
 N/A os N/A sys N/A pkgutil N/A posixpath N/A mimetypes datetime timedelta time time zlib adler32 threading RLock werkzeug.routing BuildError functools update_wrapper N/A N/A werkzeug.urls url_quote N/A N/A N/A ImportError N/A urlparse quote url_quote werkzeug.datastructures Headers werkzeug.exceptions BadRequest NotFound N/A N/A werkzeug.wsgi wrap_file N/A N/A N/A ImportError N/A werkzeug.utils wrap_file jinja2 FileSystemLoader signals message_flashed globals session _request_ctx_stack _app_ctx_stack current_app request _compat string_types text_type N/A _missing N/A object N/A _os_alt_seps N/A list N/A sep N/A sep N/A N/A N/A os path sep N/A N/A os path altsep N/A sep N/A None / _endpoint_from_view_func N/A N/A view_func N/A N/A N/A Internal helper that returns the default endpoint for a given
    function.  This always is the function name.
     N/A N/A view_func None expected view func if endpoint is not provided. N/A N/A view_func __name__ N/A stream_with_context N/A N/A generator_or_function N/A N/A N/A Request contexts disappear when the response is started on the server.
    This is done for efficiency reasons and to make it less likely to encounter
    memory leaks with badly written WSGI middlewares.  The downside is that if
    you are using streamed responses, the generator cannot access request bound
    information any more.

    This function however can help you keep the context around for longer::

        from flask import stream_with_context, request, Response

        @app.route('/stream')
        def streamed_response():
            @stream_with_context
            def generate():
                yield 'Hello '
                yield request.args['name']
                yield '!'
            return Response(generate())

    Alternatively it can also be used around a specific generator::

        from flask import stream_with_context, request, Response

        @app.route('/stream')
        def streamed_response():
            def generate():
                yield 'Hello '
                yield request.args['name']
                yield '!'
            return Response(stream_with_context(generate()))

    .. versionadded:: 0.9
     N/A N/A N/A gen N/A iter generator_or_function N/A N/A N/A TypeError N/A decorator N/A N/A N/A args kwargs N/A N/A gen N/A generator_or_function args kwargs N/A N/A stream_with_context gen N/A N/A N/A update_wrapper decorator generator_or_function generator N/A N/A N/A N/A N/A ctx N/A _request_ctx_stack top N/A N/A ctx None N/A N/A N/A RuntimeError Attempted to stream with context but there was no context in the first place to keep around. N/A ctx N/A N/A N/A None N/A N/A N/A item gen N/A N/A N/A item N/A N/A N/A hasattr gen close N/A N/A N/A N/A gen close N/A N/A wrapped_g N/A generator N/A N/A next wrapped_g N/A wrapped_g N/A make_response N/A N/A N/A args N/A N/A Sometimes it is necessary to set additional headers in a view.  Because
    views do not have to return response objects but can return a value that
    is converted into a response object by Flask itself, it becomes tricky to
    add headers to it.  This function can be called instead of using a return
    and you will get a response object which you can use to attach headers.

    If view looked like this and you want to add a new header::

        def index():
            return render_template('index.html', foo=42)

    You can now do something like this::

        def index():
            response = make_response(render_template('index.html', foo=42))
            response.headers['X-Parachutes'] = 'parachutes are cool'
            return response

    This function accepts the very same arguments you can return from a
    view function.  This for example creates a response with a 404 error
    code::

        response = make_response(render_template('not_found.html'), 404)

    The other use case of this function is to force the return value of a
    view function into a response which is helpful with view
    decorators::

        response = make_response(view_function())
        response.headers['X-Parachutes'] = 'parachutes are cool'

    Internally this function does the following things:

    -   if no arguments are passed, it creates a new response argument
    -   if one argument is passed, :meth:`flask.Flask.make_response`
        is invoked with it.
    -   if more than one argument is passed, the arguments are passed
        to the :meth:`flask.Flask.make_response` function as tuple.

    .. versionadded:: 0.6
     N/A N/A args N/A N/A N/A N/A current_app response_class N/A N/A N/A len args 1 N/A N/A args N/A args N/A 0 N/A N/A N/A current_app make_response args N/A url_for N/A N/A endpoint N/A values N/A N/A Generates a URL to the given endpoint with the method provided.

    Variable arguments that are unknown to the target endpoint are appended
    to the generated URL as query arguments.  If the value of a query argument
    is ``None``, the whole pair is skipped.  In case blueprints are active
    you can shortcut references to the same blueprint by prefixing the
    local endpoint with a dot (``.``).

    This will reference the index function local to the current blueprint::

        url_for('.index')

    For more information, head over to the :ref:`Quickstart <url-building>`.

    To integrate applications, :class:`Flask` has a hook to intercept URL build
    errors through :attr:`Flask.url_build_error_handlers`.  The `url_for`
    function results in a :exc:`~werkzeug.routing.BuildError` when the current
    app does not have a URL for the given endpoint and values.  When it does, the
    :data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
    it is not ``None``, which can return a string to use as the result of
    `url_for` (instead of `url_for`'s default to raise the
    :exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
    An example::

        def external_url_handler(error, endpoint, values):
            "Looks up an external URL when `url_for` cannot build a URL."
            # This is an example of hooking the build_error_handler.
            # Here, lookup_url is some utility function you've built
            # which looks up the endpoint in some external URL registry.
            url = lookup_url(endpoint, **values)
            if url is None:
                # External lookup did not have a URL.
                # Re-raise the BuildError, in context of original traceback.
                exc_type, exc_value, tb = sys.exc_info()
                if exc_value is error:
                    raise exc_type, exc_value, tb
                else:
                    raise error
            # url_for will use this result, instead of raising BuildError.
            return url

        app.url_build_error_handlers.append(external_url_handler)

    Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
    `endpoint` and `values` are the arguments passed into `url_for`.  Note
    that this is for building URLs outside the current application, and not for
    handling 404 NotFound errors.

    .. versionadded:: 0.10
       The `_scheme` parameter was added.

    .. versionadded:: 0.9
       The `_anchor` and `_method` parameters were added.

    .. versionadded:: 0.9
       Calls :meth:`Flask.handle_build_error` on
       :exc:`~werkzeug.routing.BuildError`.

    :param endpoint: the endpoint of the URL (name of the function)
    :param values: the variable arguments of the URL rule
    :param _external: if set to ``True``, an absolute URL is generated. Server
      address can be changed via ``SERVER_NAME`` configuration variable which
      defaults to `localhost`.
    :param _scheme: a string specifying the desired URL scheme. The `_external`
      parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
      behavior uses the same scheme as the current request, or
      ``PREFERRED_URL_SCHEME`` from the :ref:`app configuration <config>` if no
      request context is available. As of Werkzeug 0.10, this also can be set
      to an empty string to build protocol-relative URLs.
    :param _anchor: if provided this is added as anchor to the URL.
    :param _method: if provided this explicitly specifies an HTTP method.
     N/A appctx N/A _app_ctx_stack top N/A reqctx N/A _request_ctx_stack top N/A N/A appctx None N/A N/A N/A RuntimeError Attempted to generate a URL without the application context being pushed. This has to be executed when application context is available. N/A N/A reqctx None N/A N/A url_adapter N/A reqctx url_adapter N/A blueprint_name N/A request blueprint N/A N/A N/A N/A reqctx request _is_old_module N/A N/A N/A N/A endpoint N/A 1 . N/A N/A N/A blueprint_name None N/A N/A endpoint N/A blueprint_name endpoint N/A N/A endpoint N/A endpoint N/A 1 N/A N/A N/A . endpoint N/A N/A N/A blueprint_name None N/A N/A endpoint N/A N/A blueprint_name . endpoint N/A N/A N/A N/A endpoint startswith . N/A N/A endpoint N/A endpoint N/A 1 N/A external N/A N/A values pop _external False N/A N/A url_adapter N/A appctx url_adapter N/A N/A url_adapter None N/A N/A N/A RuntimeError Application was not able to create a URL adapter for request independent URL generation. You might be able to fix this by setting the SERVER_NAME config variable. N/A external N/A N/A values pop _external True N/A anchor N/A N/A values pop _anchor None N/A method N/A N/A values pop _method None N/A scheme N/A N/A values pop _scheme None N/A N/A N/A N/A appctx app inject_url_defaults endpoint values N/A N/A scheme None N/A N/A N/A external N/A N/A N/A ValueError When specifying _scheme, _external must be True N/A N/A url_adapter url_scheme scheme N/A N/A N/A rv N/A N/A url_adapter build endpoint values method method force_external external N/A N/A N/A BuildError N/A error N/A N/A N/A values N/A _external external N/A N/A values N/A _anchor anchor N/A N/A values N/A _method method N/A N/A N/A N/A appctx app handle_url_build_error error endpoint values N/A N/A anchor None N/A N/A rv N/A # N/A url_quote anchor N/A rv N/A get_template_attribute N/A N/A template_name attribute N/A N/A N/A Loads a macro (or variable) a template exports.  This can be used to
    invoke a macro from within Python code.  If you for example have a
    template named :file:`_cider.html` with the following contents:

    .. sourcecode:: html+jinja

       {% macro hello(name) %}Hello {{ name }}!{% endmacro %}

    You can access this from Python code like this::

        hello = get_template_attribute('_cider.html', 'hello')
        return hello('World')

    .. versionadded:: 0.2

    :param template_name: the name of the template
    :param attribute: the name of the variable of macro to access
     N/A N/A getattr N/A N/A N/A N/A current_app jinja_env get_template template_name module attribute N/A flash N/A N/A message category N/A message N/A N/A Flashes a message to the next request.  In order to remove the
    flashed message from the session and to display it to the user,
    the template has to call :func:`get_flashed_messages`.

    .. versionchanged:: 0.3
       `category` parameter added.

    :param message: the message to be flashed.
    :param category: the category for the message.  The following values
                     are recommended: ``'message'`` for any kind of message,
                     ``'error'`` for errors, ``'info'`` for information
                     messages and ``'warning'`` for warnings.  However any
                     kind of string can be used as category.
     N/A flashes N/A N/A session get _flashes N/A N/A N/A N/A flashes append N/A category message N/A N/A session N/A _flashes flashes N/A N/A N/A message_flashed send N/A N/A current_app _get_current_object message message category category N/A get_flashed_messages N/A N/A with_categories category_filter N/A False N/A N/A N/A Pulls all flashed messages from the session and returns them.
    Further calls in the same request to the function will return
    the same messages.  By default just the messages are returned,
    but when `with_categories` is set to ``True``, the return value will
    be a list of tuples in the form ``(category, message)`` instead.

    Filter the flashed messages to one or more categories by providing those
    categories in `category_filter`.  This allows rendering categories in
    separate html blocks.  The `with_categories` and `category_filter`
    arguments are distinct:

    * `with_categories` controls whether categories are returned with message
      text (``True`` gives a tuple, where ``False`` gives just the message text).
    * `category_filter` filters the messages down to only those matching the
      provided categories.

    See :ref:`message-flashing-pattern` for examples.

    .. versionchanged:: 0.3
       `with_categories` parameter added.

    .. versionchanged:: 0.9
        `category_filter` parameter added.

    :param with_categories: set to ``True`` to also receive categories.
    :param category_filter: whitelist of categories to limit return values
     N/A flashes N/A N/A _request_ctx_stack top flashes N/A N/A flashes None N/A N/A N/A N/A _request_ctx_stack top flashes flashes N/A N/A _flashes session N/A N/A session pop _flashes N/A N/A category_filter N/A N/A flashes N/A list N/A filter N/A N/A N/A f N/A N/A N/A f N/A 0 category_filter flashes N/A N/A with_categories N/A N/A N/A N/A x N/A 1 N/A x flashes N/A flashes N/A send_file N/A N/A filename_or_fp mimetype as_attachment attachment_filename add_etags cache_timeout conditional N/A None False None True None False N/A N/A Sends the contents of a file to the client.  This will use the
    most efficient method available and configured.  By default it will
    try to use the WSGI server's file_wrapper support.  Alternatively
    you can set the application's :attr:`~Flask.use_x_sendfile` attribute
    to ``True`` to directly emit an ``X-Sendfile`` header.  This however
    requires support of the underlying webserver for ``X-Sendfile``.

    By default it will try to guess the mimetype for you, but you can
    also explicitly provide one.  For extra security you probably want
    to send certain files as attachment (HTML for instance).  The mimetype
    guessing requires a `filename` or an `attachment_filename` to be
    provided.

    Please never pass filenames to this function from user sources;
    you should use :func:`send_from_directory` instead.

    .. versionadded:: 0.2

    .. versionadded:: 0.5
       The `add_etags`, `cache_timeout` and `conditional` parameters were
       added.  The default behavior is now to attach etags.

    .. versionchanged:: 0.7
       mimetype guessing and etag support for file objects was
       deprecated because it was unreliable.  Pass a filename if you are
       able to, otherwise attach an etag yourself.  This functionality
       will be removed in Flask 1.0

    .. versionchanged:: 0.9
       cache_timeout pulls its default from application config, when None.

    :param filename_or_fp: the filename of the file to send in `latin-1`.
                           This is relative to the :attr:`~Flask.root_path`
                           if a relative path is specified.
                           Alternatively a file object might be provided in
                           which case ``X-Sendfile`` might not work and fall
                           back to the traditional method.  Make sure that the
                           file pointer is positioned at the start of data to
                           send before calling :func:`send_file`.
    :param mimetype: the mimetype of the file if provided, otherwise
                     auto detection happens.
    :param as_attachment: set to ``True`` if you want to send this file with
                          a ``Content-Disposition: attachment`` header.
    :param attachment_filename: the filename for the attachment if it
                                differs from the file's filename.
    :param add_etags: set to ``False`` to disable attaching of etags.
    :param conditional: set to ``True`` to enable conditional responses.

    :param cache_timeout: the timeout in seconds for the headers. When ``None``
                          (default), this value is set by
                          :meth:`~Flask.get_send_file_max_age` of
                          :data:`~flask.current_app`.
     N/A mtime None N/A N/A isinstance filename_or_fp string_types N/A N/A filename filename_or_fp N/A file None N/A warnings warn N/A file filename_or_fp N/A filename N/A getattr file name None N/A N/A N/A attachment_filename N/A mimetype N/A isinstance filename string_types N/A N/A N/A warn N/A DeprecationWarning The filename support for file objects passed to send_file is now deprecated.  Pass an attach_filename if you want mimetypes to be guessed. stacklevel 2 N/A add_etags N/A N/A N/A warn N/A DeprecationWarning In future flask releases etags will no longer be generated for file objects passed to the send_file function because this behavior was unreliable.  Pass filenames instead if possible, otherwise attach an etag yourself based on another value stacklevel 2 N/A N/A filename None N/A N/A N/A N/A N/A N/A os path isabs filename N/A N/A filename N/A N/A N/A os path join N/A current_app root_path filename N/A N/A N/A mimetype None N/A filename attachment_filename N/A N/A mimetype N/A N/A N/A mimetypes guess_type N/A filename attachment_filename N/A 0 N/A N/A mimetype None N/A N/A mimetype application/octet-stream N/A headers N/A Headers N/A as_attachment N/A N/A N/A attachment_filename None N/A N/A N/A filename None N/A N/A N/A TypeError filename unavailable, required for sending as attachment N/A attachment_filename N/A N/A N/A os path basename filename N/A N/A N/A headers add Content-Disposition attachment filename attachment_filename N/A N/A N/A current_app use_x_sendfile filename N/A N/A N/A file None N/A N/A N/A N/A file close N/A N/A headers N/A X-Sendfile filename N/A N/A headers N/A Content-Length N/A N/A N/A os path getsize filename N/A data None N/A N/A N/A file None N/A N/A file N/A open filename rb N/A mtime N/A N/A N/A os path getmtime filename N/A N/A headers N/A Content-Length N/A N/A N/A os path getsize filename N/A data N/A wrap_file N/A request environ file N/A rv N/A N/A current_app response_class data mimetype mimetype headers headers direct_passthrough True N/A N/A mtime None N/A N/A N/A rv last_modified N/A int mtime N/A N/A N/A rv cache_control public True N/A N/A cache_timeout None N/A N/A cache_timeout N/A N/A current_app get_send_file_max_age filename N/A N/A cache_timeout None N/A N/A N/A N/A rv cache_control max_age cache_timeout N/A N/A rv expires N/A int N/A N/A time cache_timeout N/A N/A add_etags N/A filename None N/A N/A N/A N/A N/A N/A rv set_etag N/A %s-%s-%s N/A N/A N/A N/A os path getmtime filename N/A N/A N/A os path getsize filename N/A N/A adler32 N/A N/A isinstance filename text_type N/A N/A filename encode utf-8 filename 4294967295 N/A N/A N/A OSError N/A N/A N/A warn N/A Access %s failed, maybe it does not exist, so ignore etags in headers filename stacklevel 2 N/A conditional N/A N/A rv N/A N/A rv make_conditional request N/A N/A N/A rv status_code 304 N/A N/A N/A N/A N/A rv headers pop x-sendfile None N/A rv N/A safe_join N/A N/A directory filename N/A N/A N/A Safely join `directory` and `filename`.

    Example usage::

        @app.route('/wiki/<path:filename>')
        def wiki_page(filename):
            filename = safe_join(app.config['WIKI_FOLDER'], filename)
            with open(filename, 'rb') as fd:
                content = fd.read()  # Read and process the file content...

    :param directory: the base directory.
    :param filename: the untrusted filename relative to that directory.
    :raises: :class:`~werkzeug.exceptions.NotFound` if the resulting path
             would fall out of `directory`.
     N/A filename N/A N/A posixpath normpath filename N/A sep _os_alt_seps N/A N/A N/A sep filename N/A N/A N/A NotFound N/A N/A N/A N/A N/A os path isabs filename N/A filename .. N/A N/A filename startswith ../ N/A N/A N/A NotFound N/A N/A N/A N/A os path join directory filename N/A send_from_directory N/A N/A directory filename N/A options N/A N/A Send a file from a given directory with :func:`send_file`.  This
    is a secure way to quickly expose static files from an upload folder
    or something similar.

    Example usage::

        @app.route('/uploads/<path:filename>')
        def download_file(filename):
            return send_from_directory(app.config['UPLOAD_FOLDER'],
                                       filename, as_attachment=True)

    .. admonition:: Sending files and Performance

       It is strongly recommended to activate either ``X-Sendfile`` support in
       your webserver or (if no authentication happens) to tell the webserver
       to serve files for the given path on its own without calling into the
       web application for improved performance.

    .. versionadded:: 0.5

    :param directory: the directory where all the files are stored.
    :param filename: the filename relative to that directory to
                     download.
    :param options: optional keyword arguments that are directly
                    forwarded to :func:`send_file`.
     N/A filename N/A safe_join directory filename N/A N/A N/A N/A N/A os path isabs filename N/A N/A filename N/A N/A N/A os path join N/A current_app root_path filename N/A N/A N/A N/A N/A N/A N/A os path isfile filename N/A N/A N/A NotFound N/A N/A N/A N/A TypeError ValueError N/A N/A N/A BadRequest N/A N/A N/A options setdefault conditional True N/A N/A send_file filename options N/A get_root_path N/A N/A import_name N/A N/A N/A Returns the path to a package or cwd if that cannot be found.  This
    returns the path of a package or the folder that contains a module.

    Not to be confused with the package path returned by :func:`find_package`.
     N/A mod N/A N/A N/A sys modules get import_name N/A N/A N/A mod None N/A hasattr mod __file__ N/A N/A N/A N/A N/A os path dirname N/A N/A N/A os path abspath N/A mod __file__ N/A loader N/A N/A pkgutil get_loader import_name N/A N/A N/A loader None N/A import_name __main__ N/A N/A N/A N/A os getcwd N/A N/A hasattr loader get_filename N/A N/A filepath N/A N/A loader get_filename import_name N/A N/A N/A __import__ import_name N/A mod N/A N/A sys modules N/A import_name N/A filepath N/A getattr mod __file__ None N/A N/A filepath None N/A N/A N/A RuntimeError N/A No root path can be found for the provided module "%s".  This can happen because the module came from an import hook that does not provide file name information or because it's a namespace package.  In this case the root path needs to be explicitly provided. import_name N/A N/A N/A N/A os path dirname N/A N/A N/A os path abspath filepath N/A _matching_loader_thinks_module_is_package N/A N/A loader mod_name N/A N/A N/A Given the loader that loaded a module and the module this function
    attempts to figure out if the given module is actually a package.
     N/A N/A hasattr loader is_package N/A N/A N/A N/A loader is_package mod_name N/A N/A N/A N/A N/A N/A loader __class__ __module__ _frozen_importlib N/A N/A N/A loader __class__ __name__ NamespaceLoader N/A N/A True N/A N/A AttributeError N/A %s.is_package() method is missing but is required by Flask of PEP 302 import hooks.  If you do not use import hooks and you encounter this error please file a bug against Flask. N/A N/A loader __class__ __name__ N/A find_package N/A N/A import_name N/A N/A N/A Finds a package and returns the prefix (or None if the package is
    not installed) as well as the folder that contains the package or
    module as a tuple.  The package path returned is the module that would
    have to be added to the pythonpath in order to make it possible to
    import the module.  The prefix is the path below which a UNIX like
    folder structure exists (lib, share etc.).
     N/A root_mod_name N/A N/A N/A import_name split . N/A 0 N/A loader N/A N/A pkgutil get_loader root_mod_name N/A N/A N/A loader None N/A import_name __main__ N/A N/A package_path N/A N/A os getcwd N/A N/A N/A hasattr loader get_filename N/A N/A filename N/A N/A loader get_filename root_mod_name N/A N/A N/A hasattr loader archive N/A N/A filename N/A loader archive N/A N/A N/A __import__ import_name N/A filename N/A N/A N/A sys modules N/A import_name __file__ N/A package_path N/A N/A N/A os path abspath N/A N/A N/A os path dirname filename N/A N/A _matching_loader_thinks_module_is_package loader root_mod_name N/A N/A package_path N/A N/A N/A os path dirname package_path N/A N/A site_parent site_folder N/A N/A N/A os path split package_path N/A py_prefix N/A N/A N/A os path abspath N/A sys prefix N/A N/A N/A package_path startswith py_prefix N/A N/A N/A py_prefix package_path N/A N/A N/A N/A N/A site_folder lower site-packages N/A N/A N/A parent folder N/A N/A N/A os path split site_parent N/A N/A N/A N/A folder lower lib N/A N/A base_dir parent N/A N/A N/A N/A N/A N/A N/A N/A os path basename parent lower lib N/A N/A base_dir N/A N/A N/A os path dirname parent N/A N/A base_dir site_parent N/A N/A base_dir package_path N/A N/A None package_path N/A locked_cached_property N/A object N/A N/A A decorator that converts a function into a lazy property.  The
    function wrapped is called the first time to retrieve the result
    and then that calculated result is used the next time you access
    the value.  Works like the one in Werkzeug but has a lock for
    thread safety.
     __init__ N/A N/A self func name doc N/A None None N/A N/A N/A self __name__ N/A name N/A func __name__ N/A N/A self __module__ N/A func __module__ N/A N/A self __doc__ N/A doc N/A func __doc__ N/A N/A self func func N/A N/A self lock N/A RLock N/A __get__ N/A N/A self obj type N/A None N/A N/A N/A obj None N/A N/A self N/A N/A self lock N/A N/A value N/A N/A N/A obj __dict__ get N/A self __name__ _missing N/A N/A value _missing N/A N/A value N/A N/A self func obj N/A N/A N/A obj __dict__ N/A N/A self __name__ value N/A value N/A N/A _PackageBoundObject N/A object N/A __init__ N/A N/A self import_name template_folder root_path N/A None None N/A N/A N/A self import_name import_name N/A N/A self template_folder template_folder N/A N/A root_path None N/A N/A root_path N/A get_root_path N/A self import_name N/A N/A self root_path root_path N/A N/A self _static_folder None N/A N/A self _static_url_path None N/A _get_static_folder N/A N/A self N/A N/A N/A N/A N/A self _static_folder None N/A N/A N/A N/A N/A os path join N/A self root_path N/A self _static_folder N/A _set_static_folder N/A N/A self value N/A N/A N/A N/A self _static_folder value N/A N/A static_folder N/A property _get_static_folder _set_static_folder doc 
    The absolute path to the configured static folder.
     N/A _get_static_folder _set_static_folder _get_static_url_path N/A N/A self N/A N/A N/A N/A N/A self _static_url_path None N/A N/A N/A self _static_url_path N/A N/A N/A self static_folder None N/A N/A N/A / N/A N/A N/A os path basename N/A self static_folder N/A _set_static_url_path N/A N/A self value N/A N/A N/A N/A self _static_url_path value N/A N/A static_url_path N/A property _get_static_url_path _set_static_url_path N/A _get_static_url_path _set_static_url_path has_static_folder N/A N/A self N/A N/A N/A This is ``True`` if the package bound object's container has a
        folder for static files.

        .. versionadded:: 0.5
         N/A N/A N/A self static_folder None N/A property jinja_loader N/A N/A self N/A N/A N/A The Jinja loader for this package bound object.

        .. versionadded:: 0.5
         N/A N/A N/A self template_folder None N/A N/A N/A FileSystemLoader N/A N/A N/A os path join N/A self root_path N/A self template_folder N/A locked_cached_property get_send_file_max_age N/A N/A self filename N/A N/A N/A Provides default cache_timeout for the :func:`send_file` functions.

        By default, this function returns ``SEND_FILE_MAX_AGE_DEFAULT`` from
        the configuration of :data:`~flask.current_app`.

        Static file functions such as :func:`send_from_directory` use this
        function, and :func:`send_file` calls this function on
        :data:`~flask.current_app` when the given cache_timeout is ``None``. If a
        cache_timeout is given in :func:`send_file`, that timeout is used;
        otherwise, this method is called.

        This allows subclasses to change the behavior when sending files based
        on the filename.  For example, to set the cache timeout for .js files
        to 60 seconds::

            class MyFlask(flask.Flask):
                def get_send_file_max_age(self, name):
                    if name.lower().endswith('.js'):
                        return 60
                    return flask.Flask.get_send_file_max_age(self, name)

        .. versionadded:: 0.9
         N/A N/A total_seconds N/A current_app send_file_max_age_default N/A send_static_file N/A N/A self filename N/A N/A N/A Function used internally to send static files from the static
        folder to the browser.

        .. versionadded:: 0.5
         N/A N/A N/A self has_static_folder N/A N/A N/A RuntimeError No static folder for this object N/A cache_timeout N/A N/A self get_send_file_max_age filename N/A N/A send_from_directory N/A self static_folder filename cache_timeout cache_timeout N/A open_resource N/A N/A self resource mode N/A rb N/A N/A Opens a resource from the application's resource folder.  To see
        how this works, consider the following folder structure::

            /myapplication.py
            /schema.sql
            /static
                /style.css
            /templates
                /layout.html
                /index.html

        If you want to open the :file:`schema.sql` file you would do the
        following::

            with app.open_resource('schema.sql') as f:
                contents = f.read()
                do_something_with(contents)

        :param resource: the name of the resource.  To access resources within
                         subfolders use forward slashes as separator.
        :param mode: resource file opening mode, default is 'rb'.
         N/A N/A mode N/A r rb N/A N/A N/A ValueError Resources can only be opened for reading N/A N/A open N/A N/A N/A os path join N/A self root_path resource mode N/A N/A total_seconds N/A N/A td N/A N/A N/A Returns the total seconds from a timedelta object.

    :param timedelta td: the timedelta to be converted in seconds

    :returns: number of seconds
    :rtype: int
     N/A N/A N/A N/A N/A N/A td days 60 60 24 N/A td seconds N/A