
    2Bf}w                     d   d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
 d dl	mZ d dlmZ d dlZd dlmZ d dlmZ d d	lmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ d
dlmZ ej<                  rd
dlm Z  de!fdZ"de#fdZ$dHde#de#fdZ%dejL                  ejN                  ejP                     ejR                  dejN                  ejP                     f   f   dejN                  ejP                     fdZ*dejV                  ddfdZ,de!dejV                  de!fdZ-d e!d!e!dejV                  fd"Z.dId#e!d$e!ddfd%Z/	 dJd&e#d'ej`                  e!   dejL                  ejb                  e!   ejb                  ejd                  e!e!f      f   fd(Z3	 	 	 	 	 	 dKd)ejh                  e!   d*ejh                  e!   d+ejh                  ejL                  e#e!f      d,ejh                  ejL                  e#      d-ejh                  ejL                  e5ejR                  ejh                  e!   gejh                  e5   f   f      d.ejh                  e5   d/ejV                  dejl                  e!ejV                  f   fd0Z7	 	 	 	 	 	 	 	 	 	 dLd1ejL                  e jp                  e!ejr                  f   d2ejh                  e!   d3e#d)ejh                  e!   d*ejh                  e!   d4e#d+ejL                  e#e!f   d,ejh                  e#   d5ejh                  ejL                  ee5e:f      d-ejh                  ejL                  e5ejR                  ejh                  e!   gejh                  e5   f   f      d.ejh                  e5   fd6Z;d7e!d8e!de!fd9Z<	 dMd7ejL                  e jp                  e!f   d:ejL                  e jp                  e!f   d;ejh                  e!   d/ejV                  ddf
d<Z=d=e!de!fd>Z> G d? d@ej~                  j                        ZAdAede5fdBZBdCe!de#fdDZC e
dE      dFe!dejb                  e!   fdG       ZDy)N    N)datetime)	timedelta)	lru_cache)update_wrapper)RLock)NotFound)
BuildError)	url_quote   )_app_ctx_stack)_request_ctx_stack)current_app)request)session)message_flashed)Responsereturnc                  H    t         j                  j                  d      xs dS )zGet the environment the app is running in, indicated by the
    :envvar:`FLASK_ENV` environment variable. The default is
    ``'production'``.
    	FLASK_ENV
production)osenvironget     M/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/flask/helpers.pyget_envr      s    
 ::>>+&6,6r   c                      t         j                  j                  d      } | st               dk(  S | j	                         dvS )zGet whether debug mode should be enabled for the app, indicated
    by the :envvar:`FLASK_DEBUG` environment variable. The default is
    ``True`` if :func:`.get_env` returns ``'development'``, or ``False``
    otherwise.
    FLASK_DEBUGdevelopment0falseno)r   r   r   r   lower)vals    r   get_debug_flagr'   %   s8     **..
'CyM))99;222r   defaultc                 l    t         j                  j                  d      }|s| S |j                         dv S )zGet whether the user has disabled loading dotenv files by setting
    :envvar:`FLASK_SKIP_DOTENV`. The default is ``True``, load the
    files.

    :param default: What to return if the env var isn't set.
    FLASK_SKIP_DOTENVr!   )r   r   r   r%   )r(   r&   s     r   get_load_dotenvr+   3   s1     **..,
-C99;...r   generator_or_function.c                     	 t               dt        j
                  ffd} |       }t        |       |S # t        $ rE dt        j                  dt        j                  dt        j                  f fd}t	        |       cY S w xY w)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
    argskwargsr   c                  *     | i |}t        |      S N)stream_with_context)r.   r/   genr,   s      r   	decoratorz&stream_with_context.<locals>.decoratorl   s    '88C&s++r   c               3     K   t         j                  } | t        d      | 5  d  	 E d {    t        d      rj	                          	 d d d        y 7 *# t        d      rj	                          w w xY w# 1 sw Y   y xY ww)Nz\Attempted to stream with context but there was no context in the first place to keep around.close)r   topRuntimeErrorhasattrr6   )ctxr3   s    r   	generatorz&stream_with_context.<locals>.generatorr   s      $$;J   	  J 3(IIK	  	  3(IIK )	  	 sB    B	A=AAAA=	B	AA::A==BB	)iter	TypeErrortAnyr   	Generatornext)r,   r4   r;   	wrapped_gr3   s   `   @r   r2   r2   B   s    L@() q{{  4 IOI  @	,QUU 	,aee 	, 	, i)>??@s   9 ABBr.   r   c                  ~    | st        j                         S t        |       dk(  r| d   } t        j                  |       S )ay  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
    r   r   )r   response_classlenmake_response)r.   s    r   rF   rF      s<    T ))++
4yA~Aw$$T**r   endpointvaluesc                 D   t         j                  }t        j                  }|t        d      |E|j                  }t
        j                  }| dd dk(  r|| |  } n| dd } |j                  dd      }n+|j                  }|t        d      |j                  dd      }|j                  d	d      }|j                  d
d      }|j                  dd      }	|j                  j                  | |       d}
|	 |st        d      |j                  }
|	|_        	 	 |j                  | |||      }|
|
|_        	 ||dt        |       z  }|S # |
|
|_        w w xY w# t        $ r;}||d<   ||d	<   ||d
<   |	|d<   |j                  j                  || |      cY d}~S d}~ww xY w)aY  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')

    See :ref:`url-building`.

    Configuration values ``APPLICATION_ROOT`` and ``SERVER_NAME`` are only used when
    generating URLs outside of a request context.

    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).with_traceback(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
      falls back to the `Host` header, then to the IP and port of the request.
    :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
      :data:`PREFERRED_URL_SCHEME` if no request context is available.
      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.
    NzAttempted to generate a URL without the application context being pushed. This has to be executed when application context is available.r   .	_externalFzApplication 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.T_anchor_method_schemez/When specifying _scheme, _external must be True)methodforce_external#)r   r7   r   r8   url_adapterr   	blueprintpopappinject_url_defaults
ValueError
url_schemebuildr	   handle_url_build_errorr
   )rG   rH   appctxreqctxrR   blueprint_nameexternalanchorrO   scheme
old_schemerverrors                r   url_forrd      s    X F##F~
 	
 (( **BQ<3),-hZ8#AB<::k51
 ((<  ::k40ZZ	4(FZZ	4(FZZ	4(F
JJ""8V4
 JNOO ++
!'J	4""& # B %)3& 
)F#$%%I %)3& & J '{"y"y"yzz00&IIJs0   E -
E EE 	F$0FFFtemplate_name	attributec                 h    t        t        j                  j                  |       j                  |      S )aX  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
    )getattrr   	jinja_envget_templatemodule)re   rf   s     r   get_template_attributerl   Y  s(    & ;((55mDKKYWWr   messagecategoryc                     t        j                  dg       }|j                  || f       |t         d<   t        j                  t        j                         | |       y)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.
    _flashes)rm   rn   N)r   r   appendr   sendr   _get_current_object)rm   rn   flashess      r   flashru   o  sO    , kk*b)GNNHg&'!GJ'')r   with_categoriescategory_filterc                    t         j                  j                  }|4dt        v rt        j                  d      ng xt         j                  _        }rt        t        fd|            }| s|D cg c]  }|d   	 c}S |S c c}w )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 :doc:`/patterns/flashing` 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: filter of categories to limit return values.  Only
                            categories in the list will be returned.
    rp   c                     | d   v S )Nr   r   )frw   s    r   <lambda>z&get_flashed_messages.<locals>.<lambda>  s    !(? r   r   )r   r7   rt   r   rT   listfilter)rv   rw   rt   xs    `  r   get_flashed_messagesr     s|    > !$$,,G'1W'<GKK
#"	
& v?IJ%&!&&N 's   2Bdownload_nameattachment_filenameetag	add_etagsmax_agecache_timeoutr/   c           	         |t        j                  dt        d       |} |t        j                  dt        d       |}|t        j                  dt        d       |}|t        j                  }|j                  t        j                  | ||t        j                  t        j                  t        j                         |S )NzsThe 'attachment_filename' parameter has been renamed to 'download_name'. The old name will be removed in Flask 2.1.   
stacklevelzgThe 'cache_timeout' parameter has been renamed to 'max_age'. The old name will be removed in Flask 2.1.z`The 'add_etags' parameter has been renamed to 'etag'. The old name will be removed in Flask 2.1.)r   r   r   r   use_x_sendfilerD   
_root_path)warningswarnDeprecationWarningr   get_send_file_max_ageupdater   r   r   rD   	root_path)r   r   r   r   r   r   r/   s          r   _prepare_send_file_kwargsr     s     & 	
 , E		
  6		
 33
MM#"11"11((   Mr   path_or_filemimetypeas_attachmentconditionallast_modifiedc                     t        j                  j                  di t        | t        j
                  |||||||||	|
      S )ab  Send the contents of a file to the client.

    The first argument can be a file path or a file-like object. Paths
    are preferred in most cases because Werkzeug can manage the file and
    get extra information from the path. Passing a file-like object
    requires that the file is opened in binary mode, and is mostly
    useful when building a file in memory with :class:`io.BytesIO`.

    Never pass file paths provided by a user. The path is assumed to be
    trusted, so a user could craft a path to access a file you didn't
    intend. Use :func:`send_from_directory` to safely serve
    user-requested paths from within a directory.

    If the WSGI server sets a ``file_wrapper`` in ``environ``, it is
    used, otherwise Werkzeug's built-in wrapper is used. Alternatively,
    if the HTTP server supports ``X-Sendfile``, configuring Flask with
    ``USE_X_SENDFILE = True`` will tell the server to send the given
    path, which is much more efficient than reading it in Python.

    :param path_or_file: The path to the file to send, relative to the
        current working directory if a relative path is given.
        Alternatively, a file-like object opened in binary mode. Make
        sure the file pointer is seeked to the start of the data.
    :param mimetype: The MIME type to send for the file. If not
        provided, it will try to detect it from the file name.
    :param as_attachment: Indicate to a browser that it should offer to
        save the file instead of displaying it.
    :param download_name: The default name browsers will use when saving
        the file. Defaults to the passed file name.
    :param conditional: Enable conditional and range responses based on
        request headers. Requires passing a file path and ``environ``.
    :param etag: Calculate an ETag for the file, which requires passing
        a file path. Can also be a string to use instead.
    :param last_modified: The last modified time to send for the file,
        in seconds. If not provided, it will try to detect it from the
        file path.
    :param max_age: How long the client should cache the file, in
        seconds. If set, ``Cache-Control`` will be ``public``, otherwise
        it will be ``no-cache`` to prefer conditional caching.

    .. versionchanged:: 2.0
        ``download_name`` replaces the ``attachment_filename``
        parameter. If ``as_attachment=False``, it is passed with
        ``Content-Disposition: inline`` instead.

    .. versionchanged:: 2.0
        ``max_age`` replaces the ``cache_timeout`` parameter.
        ``conditional`` is enabled and ``max_age`` is not set by
        default.

    .. versionchanged:: 2.0
        ``etag`` replaces the ``add_etags`` parameter. It can be a
        string to use instead of generating one.

    .. versionchanged:: 2.0
        Passing a file-like object that inherits from
        :class:`~io.TextIOBase` will raise a :exc:`ValueError` rather
        than sending an empty file.

    .. versionadded:: 2.0
        Moved the implementation to Werkzeug. This is now a wrapper to
        pass some Flask-specific arguments.

    .. versionchanged:: 1.1
        ``filename`` may be a :class:`~os.PathLike` object.

    .. versionchanged:: 1.1
        Passing a :class:`~io.BytesIO` object supports range requests.

    .. versionchanged:: 1.0.3
        Filenames are encoded with ASCII instead of Latin-1 for broader
        compatibility with WSGI servers.

    .. versionchanged:: 1.0
        UTF-8 filenames as specified in :rfc:`2231` are supported.

    .. versionchanged:: 0.12
        The filename is no longer automatically inferred from file
        objects. If you want to use automatic MIME and etag support,
        pass a filename via ``filename_or_fp`` or
        ``attachment_filename``.

    .. versionchanged:: 0.12
        ``attachment_filename`` is preferred over ``filename`` for MIME
        detection.

    .. versionchanged:: 0.9
        ``cache_timeout`` defaults to
        :meth:`Flask.get_send_file_max_age`.

    .. versionchanged:: 0.7
        MIME guessing and etag support for file-like objects was
        deprecated because it was unreliable. Pass a filename if you are
        able to, otherwise attach an etag yourself.

    .. versionchanged:: 0.5
        The ``add_etags``, ``cache_timeout`` and ``conditional``
        parameters were added. The default behavior is to add etags.

    .. versionadded:: 0.2
    )r   r   r   r   r   r   r   r   r   r   r   r   r   )werkzeugutils	send_filer   r   r   )r   r   r   r   r   r   r   r   r   r   r   s              r   r   r     sQ    h >>## 
#%OO'' 3#''
 r   	directory	pathnamesc                     t        j                  dt        d       t        j                  j
                  | g| }|
t               |S )a2  Safely join zero or more untrusted path components to a base
    directory to avoid escaping the base directory.

    :param directory: The trusted base directory.
    :param pathnames: The untrusted path components relative to the
        base directory.
    :return: A safe path, otherwise ``None``.
    zq'flask.helpers.safe_join' is deprecated and will be removed in Flask 2.1. Use 'werkzeug.utils.safe_join' instead.   r   )r   r   r   r   r   	safe_joinr   )r   r   paths      r   r   r   v  sH     MM	>	 >>##I:	:D|jKr   r   filenamec           	          |t        j                  dt        d       |}t        j                  j
                  | |fi t        di |S )aw  Send a file from within a directory using :func:`send_file`.

    .. code-block:: python

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

    This is a secure way to serve files from a folder, such as static
    files or uploads. Uses :func:`~werkzeug.security.safe_join` to
    ensure the path coming from the client is not maliciously crafted to
    point outside the specified directory.

    If the final path does not point to an existing regular file,
    raises a 404 :exc:`~werkzeug.exceptions.NotFound` error.

    :param directory: The directory that ``path`` must be located under.
    :param path: The path to the file to send, relative to
        ``directory``.
    :param kwargs: Arguments to pass to :func:`send_file`.

    .. versionchanged:: 2.0
        ``path`` replaces the ``filename`` parameter.

    .. versionadded:: 2.0
        Moved the implementation to Werkzeug. This is now a wrapper to
        pass some Flask-specific arguments.

    .. versionadded:: 0.5
    z_The 'filename' parameter has been renamed to 'path'. The old name will be removed in Flask 2.1.r   r   r   )r   r   r   r   r   send_from_directoryr   )r   r   r   r/   s       r   r   r     sU    L 6		
 >>--44>v> r   import_namec                 t   t         j                  j                  |       }|Rt        |d      rFt        j
                  j                  t        j
                  j                  |j                              S t        j                  |       }|| dk(  rt	        j                         S t        |d      r|j                  |       }n<t        |        t         j                  |    }t        |dd      }|t        d| d      t        j
                  j                  t        j
                  j                  |            S )zFind the root path of a package, or the path that contains a
    module. If it cannot be found, returns the current working
    directory.

    Not to be confused with the value returned by :func:`find_package`.

    :meta private:
    N__file____main__get_filenamez2No root path can be found for the provided module z. 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.)sysmodulesr   r9   r   r   dirnameabspathr   pkgutil
get_loadergetcwdr   
__import__rh   r8   )r   modloaderfilepaths       r   get_root_pathr     s     ++//+
&C
73
3wwrwws||<== ,F
 ~
2yy{v~&&&{3 	;kk+&3
D1
 ? #  77??277??8455r   c            	       $    e Zd ZdZ	 	 ddej
                  ej                  gej                  f   dej                  e   dej                  e   ddf fdZ	dde
d	edej                  f fd
Zde
dej                  ddf fdZde
ddf fdZ xZS )locked_cached_propertyzA :func:`property` that is only evaluated once. Like
    :class:`werkzeug.utils.cached_property` except access uses a lock
    for thread safety.

    .. versionchanged:: 2.0
        Inherits from Werkzeug's ``cached_property`` (and ``property``).
    Nfgetnamedocr   c                 H    t         |   |||       t               | _        y )N)r   r   )super__init__r   lock)selfr   r   r   	__class__s       r   r   zlocked_cached_property.__init__  s"     	Dc2G	r   objtypec                 r    || S | j                   5  t        | 	  ||      cd d d        S # 1 sw Y   y xY w)N)r   )r   r   __get__)r   r   r   r   s      r   r   zlocked_cached_property.__get__  s9    ;KYY 	37?3T?2	3 	3 	3s   -6valuec                 h    | j                   5  t        | 	  ||       d d d        y # 1 sw Y   y xY wr1   )r   r   __set__)r   r   r   r   s      r   r   zlocked_cached_property.__set__  s-    YY 	(GOC'	( 	( 	(s   (1c                 f    | j                   5  t        | 	  |       d d d        y # 1 sw Y   y xY wr1   )r   r   
__delete__)r   r   r   s     r   r   z!locked_cached_property.__delete__  s,    YY 	$Gs#	$ 	$ 	$s   '0)NNr1   )__name__
__module____qualname____doc__r>   Callabler?   Optionalstrr   objectr   r   r   r   __classcell__)r   s   @r   r   r     s     !%#	jj!%%!%%( jjo ZZ_	
 
36 3 3 3(6 (!%% (D ($f $ $ $r   r   tdc                 ~    t        j                  dt        d       | j                  dz  dz  dz  | j                  z   S )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

    .. deprecated:: 2.0
        Will be removed in Flask 2.1. Use
        :meth:`timedelta.total_seconds` instead.
    zf'total_seconds' is deprecated and will be removed in Flask 2.1. Use 'timedelta.total_seconds' instead.r   r   <      )r   r   r   daysseconds)r   s    r   total_secondsr     s>     MM	7	 77R<"r!BJJ..r   r   c                     t         j                  t         j                  fD ]  }	 t        j                  ||         y y# t        $ r Y )w xY w)zDetermine if the given string is an IP address.

    :param value: value to check
    :type value: str

    :return: True if string is an IP address
    :rtype: bool
    TF)socketAF_INETAF_INET6	inet_ptonOSError)r   familys     r   is_ipr   )  sS     >>6??3 	VU+    		s   ?	A
A)maxsizer   c                 l    | g}d| v r,|j                  t        | j                  d      d                |S )NrJ   r   )extend_split_blueprint_path
rpartition)r   outs     r   r   r   =  s5    vC
d{

()=a)@ABJr   )T)rm   )Fr   )NNNNNN)
NFNNTTNNNNr1   )Er   r   r   r   typingr>   r   r   r   	functoolsr   r   	threadingr   werkzeug.utilsr   werkzeug.exceptionsr   werkzeug.routingr	   werkzeug.urlsr
   globalsr   r   r   r   r   signalsr   TYPE_CHECKINGwrappersr   r   r   boolr'   r+   UnionIteratorAnyStrr   r2   r?   rF   rd   rl   ru   IterableListTupler   r   intDictr   PathLikeBinaryIOfloatr   r   r   r   r   cached_propertyr   r   r   r   r   r   r   <module>r      s   	   
      $   ( ' # # '     $??"7 73 3/T /T /L77	

188ajjajj.B)BCCL ZZ	L^.+ .+: .+bTc TQUU Ts TnX# X# X!%% X,3 # d B GI((45JJsO(WWQVVC[!&&c!2334(X &*+/+/+/ 	%)3::c?3C3 **QWWT3Y'
(3 zz!''$-(	3
 ZZ	QZZC 11::c? BCCD3 ::c?3 ee3 VVCJ3p !%%)+/#"&?C 	%)C''"++sAJJ67CjjoC C ::c?	C
 CC C ''$)
C zz$C ::agghU&:;<C ZZ	QZZC 11::c? BCCDC ::c?CL # # 4 !%1wwr{{C'(1
''"++s"
#1 jjo1 ee	1
 1h.6s .6s .6b$X^^;; $D/i /C /*  ( 4 s  r   