Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
http.cpython-313.pyc604 linesDownload Raw Back to __pycache__
1�

2��j����	�SSKJr SSKrSSKrSSKrSSKrSSKJ	r	 SSKJr SSKJ3r4 SSKJr SSKJr SSK
Jr SS	KJr SS5K6Jr SSK7Jr SSKJr SS
KJr SSKJr SSKJr \R2(aSSKJr \"S5r\R<"S5r\"/SQ5r \"/SQ5r!0SS_SS_SS_SS_SS_S S!_S"S#_S$S%_S&S'_S(S)_S*S+_S,S-_S.S/_S0S1_S2S3_S4S5_S6S7_0S8S9_S:S;_S<S=_S>S?_S@SA_SBSC_SDSE_SFSG_SHSI_SJSK_SLSM_SNSO_SPSQ_SRSS_STSU_SVSW_SXSY_E0SZS[_S\S]_S^S__S`Sa_SbSc_SdSe_SfSg_ShSi_SjSk_SlSm_SnSo_SpSq_SrSs_StSu_SvSw_SxSy_SzS{_ES|S}S~SS�S�S�S�S�S�S�S�S�S�.
Er""S�S�\5r#"S�S�\5r$S�S�S�jjr%\R<"S�\RL5r'S�S�jr(S�S�jr)S�S�jr*S�S�jr+S�S�jr,S�S�jr-\R<"S�\R\S�9r/\R<"S�\R\S�9r0\R<"S�\R\\Rb-5r2\R<"S�\R\5r3S�S�jr4\R<"S�\R\5r5\Rl"S�S�S�9r7\RpS�S�j5r9\RpS�S�j5r9S�S�S�jjr9\Rl"S�S�S�9r:\RpS�S�S�jj5r;\RpS�S�S�jj5r;S�S�S�jjr;\Rl"S�S�S�9r<\RpS�S�S�jj5r=\RpS�S�S�jj5r=S�S�S�jjr=S�S�S�jjr>S�S�jr?S�S�S�jjr@S�S�S�jjrAS�S�S�jjrB\RpS�S�j5rC\RpS�S�j5rCS�S�jrCS�S�jrDS�S�jrES�S�jrFS�S�S�jjrGS�S�S�jjrHS�S�S�jjrIS�S�S�jjrJS�S�S�jjrKS�S�jrLS�S�jrMS�S�jrNS�S�S�jjrO\R<"S�\RL5rP\R<"S�\RL5rQS�S�S�.rR\RR�S�/\T"S�5QS�Q\T"S�S�5Q55 S�S�S�jjrUS�S�jrVSS�KWJXrY SS�KZJ[r\ g)��)�annotationsN��date)�datetime)�time)�	timedelta)�timezone)�Enum)�sha1)�mktime)�struct_time)�quote)�unquote�)�8_dt_as_utc)�9_plain_int)�WSGIEnvironmentzM!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~z&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$))10�allowzcontent-encodingzcontent-languagezcontent-length�content-locationzcontent-md5z
content-rangezcontent-type�expiresz
last-modified)�11connectionz12keep-alivezproxy-authenticatezproxy-authorization�te�trailerztransfer-encoding�upgrade�d�Continue�ezSwitching Protocols�f�13Processing�gzEarly Hints���OK���Created���Accepted��zNon Authoritative Information��z14No Content��z
Reset Content��zPartial Content��zMulti Status��zAlready Reported��zIM Usedi,zMultiple Choicesi-zMoved Permanentlyi.�Foundi/z	See Otheri0zNot Modifiedi1z	Use Proxyi2zSwitch Proxyi3zTemporary Redirecti4zPermanent Redirecti�zBad Requesti��Unauthorizedi�zPayment Requiredi��	Forbiddeni�z	Not Foundi�zMethod Not Allowedi�zNot Acceptablei�zProxy Authentication Requiredi�zRequest Timeouti��Conflicti��Gonei�zLength Requiredi�zPrecondition Failedi�zRequest Entity Too Largei�zRequest URI Too Longi�zUnsupported Media Typei�zRequested Range Not Satisfiablei�zExpectation Failedi�zI'm a teapoti�zMisdirected Requesti�zUnprocessable Entityi��Lockedi�zFailed Dependencyi�z	Too Earlyi�zUpgrade Requiredi�zPrecondition Requiredi�zToo Many Requestsi�zRequest Header Fields Too Largez15Retry WithzUnavailable For Legal ReasonszInternal Server ErrorzNot ImplementedzBad GatewayzService UnavailablezGateway TimeoutzHTTP Version Not SupportedzVariant Also NegotiateszInsufficient Storagez
Loop DetectedzNot ExtendedzNetwork Authentication Failed)
i�i�i�i�i�i�i�i�i�i�i�i�i�c� �\rSrSrSrSrSrSrg)�COEP�{zCross Origin Embedder Policies�unsafe-nonezrequire-corp�N)�__name__�16__module__�__qualname__�__firstlineno__�__doc__�UNSAFE_NONE�REQUIRE_CORP�__static_attributes__r8��SD:\code\apps\devtools\python\user_packages\Python313\site-packages\werkzeug/http.pyr5r5{s��(��K�!�LrAr5c�$�\rSrSrSrSrSrSrSrg)�COOP�zCross Origin Opener Policiesr7zsame-origin-allow-popupszsame-originr8N)	r9r:r;r<r=r>�SAME_ORIGIN_ALLOW_POPUPS�SAME_ORIGINr@r8rArBrDrD�s��&��K�9���KrArDc���[U5nU(dgU(a[nURU5(aU$URSS5RSS5nSUS3$)a�Add double quotes around a header value. If the header contains only ASCII token17characters, it will be returned unchanged. If the header contains ``"`` or ``\``18characters, they will be escaped with an additional ``\`` character.19 20This is the reverse of :func:`unquote_header_value`.21 22:param value: The value to quote. Will be converted to a string.23:param allow_token: Disable to quote the value even if it only has token characters.24 25.. versionchanged:: 3.026    Passing bytes is not supported.27 28.. versionchanged:: 3.029    The ``extra_chars`` parameter is removed.30 31.. versionchanged:: 2.332    The value is quoted if it is the empty string.33 34.. versionadded:: 0.535z""�\�\\�"�\")�str�_token_chars�36issuperset�replace)�value�allow_token�	value_str�token_charss    rB�quote_header_valuerU�s`��*�E�37�I����"���!�!�)�,�,����!�!�$��/�7�7��U�C�I�
�y�k���rAz\\(.)c��[U5S:�a0USUSs=:XaS:XaO U$[RSUSS5$U$)a,Remove double quotes and backslash escapes from a header value.38 39This is the reverse of :func:`quote_header_value`.40 41:param value: The header value to unquote.42 43.. versionchanged:: 3.244    Removes escape preceding any character.45 46.. versionchanged:: 3.047    The ``is_filename`` parameter is removed.48�r�����rKz\g<1>r)�len�_unslash_re�sub�rQs rB�unquote_header_valuer]�sH���5�z�Q��5��8�u�R�y�7�C�7��L����x��q���5�5��LrAc��/nUbURU5 UR5HJup4UcM49USS:XaURUSU35 M+URUS[U535 ML SRU5$)a�Produce a header value and ``key=value`` parameters separated by semicolons50``;``. For example, the ``Content-Type`` header.51 52.. code-block:: python53 54    dump_options_header("text/html", {"charset": "UTF-8"})55    'text/html; charset=UTF-8'56 57This is the reverse of :func:`parse_options_header`.58 59If a value contains non-token characters, it will be quoted.60 61If a value is ``None``, the parameter is skipped.62 63In some keys for some headers, a UTF-8 value can be encoded using a special64``key*=UTF-8''value`` form, where ``value`` is percent encoded. This function will65not produce that format automatically, but if a given key ends with an asterisk66``*``, the value is assumed to have that form and will not be quoted further.67 68:param header: The primary header value.69:param options: Parameters to encode as ``key=value`` pairs.70 71.. versionchanged:: 2.372    Keys with ``None`` values are skipped rather than treated as a bare key.73 74.. versionchanged:: 2.2.375    If a key ends with ``*``, its value will not be quoted.76rX�*�=�; )�append�itemsrU�join)�header�options�segments�keyrQs     rB�dump_options_headerri�s���:�H�
��������m�m�o�77���=���r�7�c�>��O�O�s�e�1�U�G�,�-��O�O�s�e�1�%7��%>�$?�@�A�&��9�9�X��rAc�r�[U[5(ar/nUR5H[up#UcURU5 MUSS:XaURUSU35 M<URUS[	U535 M] OUVs/sHn[	U5PM nnSRU5$s snf)a�Produce a header value from a list of items or ``key=value`` pairs, separated by78commas ``,``.79 80This is the reverse of :func:`parse_list_header`, :func:`parse_dict_header`, and81:func:`parse_set_header`.82 83If a value contains non-token characters, it will be quoted.84 85If a value is ``None``, the key is output alone.86 87In some keys for some headers, a UTF-8 value can be encoded using a special88``key*=UTF-8''value`` form, where ``value`` is percent encoded. This function will89not produce that format automatically, but if a given key ends with an asterisk90``*``, the value is assumed to have that form and will not be quoted further.91 92.. code-block:: python93 94    dump_header(["foo", "bar baz"])95    'foo, "bar baz"'96 97    dump_header({"foo": "bar baz"})98    'foo="bar baz"'99 100:param iterable: The items to create a header from.101 102.. versionchanged:: 3.0103    The ``allow_token`` parameter is removed.104 105.. versionchanged:: 2.2.3106    If a key ends with ``*``, its value will not be quoted.107rXr_r`z, )�108isinstance�dictrcrbrUrd)�iterablercrhrQ�xs     rB�dump_headerro�s���@�(�D�!�!���"�.�.�*�J�C��}����S�!��R��C������u�A�e�W�-�.�����u�A�&8��&?�%@�A�B�
+�19�9��1�#�A�&���9��9�9�U����:s�B4�ds.ContentSecurityPolicyc�N�SRSUR555$)z�Dump a Content Security Policy header.109 110These are structured into policies such as "default-src 'self';111script-src 'self'".112 113.. versionadded:: 1.0.0114   Support for Content Security Policy headers was added.115 116rac3�4# �UHupUSU3v� M g7f)� Nr8)�.0rhrQs   rB�	<genexpr>�"dump_csp_header.<locals>.<genexpr>,s���G��*�#��u�A�e�W�%��s�)rdrc�res rB�dump_csp_headerrx"s���9�9�G�����G�G�GrAc�`�/nSnSnSnUHWnU(aSnX%-
nMU(aUS:XaSnOUS:XaSnX%-
nM0US:XaURU5 SnMKUS:XaSnX%-
nMY U(a/$URU5 SU5Vs/sHo"(dM[U5PM sn$s snf)a�Parse a header value that consists of a list of comma separated items according117to `RFC 9110 <https://httpwg.org/specs/rfc9110.html#abnf.extension>`__.118 119Surrounding quotes are removed from items, but internal quotes are left for120future parsing. Empty values are discarded.121 122.. code-block:: python123 124    parse_list_header('token, "quoted value"')125    ['token', 'quoted value']126 127This is the reverse of :func:`dump_header`.128 129:param value: The header value to parse.130 131.. versionchanged:: 3.2132    Quotes and escapes are kept if only part of an item is quoted. Empty133    values are omitted. An empty list is returned if the value contains an134    unclosed quoted string.135�FrITrK�,c3�@# �UHoR5v� M g7f�N)�strip)rt�items  rBru�$parse_list_header.<locals>.<genexpr>hs���/O���136�137����s�)rbr])rQrcr�escaper�chars      rB�parse_list_headerr�/s���*
�E�
�D�
�F��E�����F��L�D����t�|���������L�D���3�;��L�L����D���3�;��E����/�2
��	�	�L�L���/O��/O��/O�t�SW�"��T�"�/O����s�138B+�B+c��0n[U5H�nURS5up4nUR5nU(dM0U(dSX'M=UR5nSnUSS:XaRUSSn[R	U5nU(a"UR5upPUR
5nUS;a	[XS9n[U5X'M� U$)a�Parse a list header using :func:`parse_list_header`, then parse each item as a139``key=value`` pair.140 141.. code-block:: python142 143    parse_dict_header('a=b, c="d, e", f')144    {"a": "b", "c": "d, e", "f": None}145 146This is the reverse of :func:`dump_header`.147 148If a key does not have a value, it is ``None``.149 150This handles charsets for values as described in151`RFC 2231 <https://www.rfc-editor.org/rfc/rfc2231#section-3>`__. Only ASCII, UTF-8,152and ISO-8859-1 charsets are accepted, otherwise the value remains quoted.153 154:param value: The header value to parse.155 156.. versionchanged:: 3.2157    An empty dict is returned if the value contains an unclosed quoted158    string.159 160.. versionchanged:: 3.0161    Passing bytes is not supported.162 163.. versionchanged:: 3.0164    The ``cls`` argument is removed.165 166.. versionchanged:: 2.3167    Added support for ``key*=charset''value`` encoded items.168 169.. versionchanged:: 0.9170   The ``cls`` argument was added.171r`NrXr_>�ascii�utf-8�us-ascii�172iso-8859-1��encoding)	r��	partitionr~�_charset_value_re�match�groups�lowerrr])rQ�resultrrh�	has_valuer�r�s       rB�parse_dict_headerr�ls���F%'�F�!�%�(�� $���s� 3�����i�i�k������F�K�����
��#���r�7�c�>��c�r�(�C�%�+�+�E�2�E��"'�,�,�.���#�>�>�+��173�G�G���9��*�5�1���C)�F�MrAz([\w!#$%&'*+\-.^`|~]+)=)�flagsz[\w!#$%&'*+\-.^`|~]+z�174    ([\w!#$%&*+\-.^`|~]*)'  # charset part, could be empty175    [\w!#$%&*+\-.^`|~]*'  # don't care about language part, usually empty176    ([\w!#$%&'*+\-.^`|~]+)  # one or more token chars with percent encoding177    z\*(\d+)$c���UcS04$URS5upnUR5nUR5nU(aU(dU04$/n[RU5=nb�UR	S5R5nX$R
5Sn[RU5=nb!URXTR	545 O`USSS:XaWSn[U5nXg:aEX&US-S;aUS-
nO-X&S:Xa URXRSUS-45 X&S-SnOUS-
nXg:aMEURS5=nS:XaOX(S-SR5nGM0n	Sn178SnUGHup\USS	:Xa]USSn[RU5n
U
(a"U
R5up�U179R5n180U181(dUn182U183S184;aU185n[X�S9nUSUSs=:XaS:Xa8O O5USSRS
S5RSS5RSS5n[ R#U5n
U
(a-USU
R%5nU	R'US5U-X�'GMX�U'GM X	4$)aParse a header that consists of a value with ``key=value`` parameters separated186by semicolons ``;``. For example, the ``Content-Type`` header.187 188.. code-block:: python189 190    parse_options_header("text/html; charset=UTF-8")191    ('text/html', {'charset': 'UTF-8'})192 193    parse_options_header("")194    ("", {})195 196This is the reverse of :func:`dump_options_header`.197 198This parses valid parameter parts as described in199`RFC 9110 <https://httpwg.org/specs/rfc9110.html#parameter>`__. Invalid parts are200skipped.201 202This handles continuations and charsets as described in203`RFC 2231 <https://www.rfc-editor.org/rfc/rfc2231#section-3>`__, although not as204strictly as the RFC. Only ASCII, UTF-8, and ISO-8859-1 charsets are accepted,205otherwise the value remains quoted.206 207Clients may not be consistent in how they handle a quote character within a quoted208value. The `HTML Standard <https://html.spec.whatwg.org/#multipart-form-data>`__209replaces it with ``%22`` in multipart form data.210`RFC 9110 <https://httpwg.org/specs/rfc9110.html#quoted.strings>`__ uses backslash211escapes in HTTP headers. Both are decoded to the ``"`` character.212 213Clients may not be consistent in how they handle non-ASCII characters. HTML214documents must declare ``<meta charset=UTF-8>``, otherwise browsers may replace with215HTML character references, which can be decoded using :func:`html.unescape`.216 217:param value: The header value to parse.218:return: ``(value, options)``, where ``options`` is a dict219 220.. versionchanged:: 2.3221    Invalid parts, such as keys with no value, quoted keys, and incorrectly quoted222    values, are discarded instead of treating as ``None``.223 224.. versionchanged:: 2.3225    Only ASCII, UTF-8, and ISO-8859-1 are accepted for charset values.226 227.. versionchanged:: 2.3228    Escaped quotes in quoted values, like ``%22`` and ``\"``, are handled.229 230.. versionchanged:: 2.2231    Option names are always converted to lowercase.232 233.. versionchanged:: 2.2234    The ``multiple`` parameter was removed.235 236.. versionchanged:: 0.15237    :rfc:`2231` parameter continuations are handled.238 239.. versionadded:: 0.5240Nrz�;rrKrW>rLrJrXr_>r�r�r�r�r�rrJrIrLz%22)r�r~�_parameter_key_rer��groupr��end�_parameter_token_value_rerbrY�find�lstripr�r�rrP�_continuation_re�search�start�get)rQ�_�rest�parts�m�pk�pos�lengthr�rfr��continued_encoding�pvr�s              rB�parse_options_headerr��s���r
�}��2�v�
��_�_�S�)�N�E�d��K�K�M�E��:�:�<�D����b�y��$&�E�241�"�(�(��.�.�A�;������!�!�#�B�����	�?�D�/�4�4�T�:�:��G����b�'�'�)�_�-��b�q��S�����T����l��#��'�*�o�=��q�����c�)����b�y��q��/�%:�;�#�!�G�I�����q����l��9�9�S�>�!�C�b�(���!�G�I��%�%�'��?�B!�G��H�%)�����
�b�6�S�=��C�R��B�%�+�+�B�/�E��$�|�|�~���#�>�>�+���-��242�G�G�243&.�"��R�3���a�5�B�r�F�!�c�!��A�b��!�!�&�$�/�7�7��s�C�K�K�E�SV�W�B� �'�'��+����O�e�k�k�m�$�B�!�+�+�b�"�-��2�G�K��B�K�Q�T�>�rAz
-?\d+(\.\d+)?�_TAnyAccept�	ds.Accept)�boundc��gr}r8r\s rB�parse_accept_headerr�fs��9<rAc��gr}r8)rQ�clss  rBr�r�js��SVrAc���Uc0[R"[[[R2445nU(dU"S5$/n[
U5H�n[U5up4SU;aQURS5R5n[RU5cMM[U5nUS:dUS:�aMfOSnU(a[X45nURX645 M� U"U5$)aCParse an ``Accept`` header according to245`RFC 9110 <https://httpwg.org/specs/rfc9110.html#field.accept>`__.246 247Returns an :class:`.Accept` instance, which can sort and inspect items based on248their quality parameter. When parsing ``Accept-Charset``, ``Accept-Encoding``, or249``Accept-Language``, pass the appropriate :class:`.Accept` subclass.250 251:param value: The header value to parse.252:param cls: The :class:`.Accept` class to wrap the result in.253:return: An instance of ``cls``.254 255.. versionchanged:: 2.3256    Parse according to RFC 9110. Items with invalid ``q`` values are skipped.257N�qrr)�t�cast�typer��ds�Acceptr�r��popr~�_q_value_re�	fullmatch�floatrirb)rQr�r�rrf�q_strr�s       rBr�r�ns���"�{��f�f�T�+�&��	�	�2����4�y��
�F�!�%�(��,�T�2�
���'�>��K�K��$�*�*�,�E��$�$�U�+�3���e��A��1�u��A�����A��&�t�5�D��
�
�t�i� �/)�2�v�;�rA�_TAnyCCzds.cache_control._CacheControlc��gr}r8�rQ�	on_updates  rB�parse_cache_control_headerr��s��!rAc��gr}r8�rQr�r�s   rBr�r��s��258rAc��Uc%[R"S[R5nU(d	U"SU5$U"[	U5U5$)a�Parse a cache control header.  The RFC differs between response and259request cache control, this method does not.  It's your responsibility260to not use the wrong control statements.261 262.. versionadded:: 0.5263   The `cls` was added.  If not specified an immutable264   :class:`~werkzeug.datastructures.RequestCacheControl` is returned.265 266:param value: a cache control header to be parsed.267:param on_update: an optional callable that is called every time a value268                  on the :class:`~werkzeug.datastructures.CacheControl`269                  object is changed.270:param cls: the class for the returned object.  By default271            :class:`~werkzeug.datastructures.RequestCacheControl` is used.272:return: a `cls` object.273�
type[_TAnyCC]r8)r�r�r��RequestCacheControlr�r�s   rBr�r��sB��*�{��f�f�_�b�&<�&<�=����2�y�!�!�� ��'��3�3rA�_TAnyCSPc��gr}r8r�s  rB�parse_csp_headerr��s�� #rAc��gr}r8r�s   rBr�r��s��274rAc��Uc%[R"S[R5nUc	U"SU5$/nUR	S5HlnUR5nSU;dMUR5R	SS5upPUR
UR5UR545 Mn U"X15$)a�Parse a Content Security Policy header.275 276.. versionadded:: 1.0.0277   Support for Content Security Policy headers was added.278 279:param value: a csp header to be parsed.280:param on_update: an optional callable that is called every time a value281                  on the object is changed.282:param cls: the class for the returned object.  By default283            :class:`~werkzeug.datastructures.ContentSecurityPolicy` is used.284:return: a `cls` object.285�type[_TAnyCSP]r8r�rsr)r�r�r��ContentSecurityPolicy�splitr~rb)rQr�r�rc�policy�	directives      rBr�r��s���"�{��f�f�%�r�'?�'?�@���}��2�y�!�!��E��+�+�c�"��������&�=�%�|�|�~�3�3�C��;��I��L�L�)�/�/�+�U�[�[�]�;�<�
#��u� � rAc�~�U(d[R"SU5$[R"[U5U5$)a�Parse a set-like header and return a286:class:`~werkzeug.datastructures.HeaderSet` object:287 288>>> hs = parse_set_header('token, "quoted value"')289 290The return value is an object that treats the items case-insensitively291and keeps the order of the items:292 293>>> 'TOKEN' in hs294True295>>> hs.index('quoted value')2961297>>> hs298HeaderSet(['token', 'quoted value'])299 300To create a header from the :class:`HeaderSet` again, use the301:func:`dump_header` function.302 303:param value: a set header to be parsed.304:param on_update: an optional callable that is called every time a305                  value on the :class:`~werkzeug.datastructures.HeaderSet`306                  object is changed.307:return: a :class:`~werkzeug.datastructures.HeaderSet`308N)r��	HeaderSetr�r�s  rB�parse_set_headerr�	s/��8��|�|�D�)�,�,�
�<�<�)�%�0�)�<�<rAc���U(d[R"5$[U5nUb[R"US9$[R"[U5S5$)z�Parses an if-range header which can be an etag or a date.  Returns309a :class:`~werkzeug.datastructures.IfRange` object.310 311.. versionchanged:: 2.0312    If the value represents a datetime, it is timezone-aware.313 314.. versionadded:: 0.7315rr)r��IfRange�316parse_date�unquote_etag)rQrs  rB�parse_if_range_headerr�*sK����z�z�|���e��D����z�z�t�$�$�
�:�:�l�5�)�!�,�-�-rAc���U(aSU;ag/nSnURSS5upEUR5R5nURS5H�nUR5nSU;a gURS5(aUS:a g[	U5nSnSnOzSU;atURSS5up�U	R5n	U317R5n318[	U	5nXs:dUS:a gU319(a[	U3205S-nXx:�a gOSnUbUOSnUR
WW45 M� [R"XB5$![321a  gf=f![322a  gf=f![323a  gf=f)z�Parses a range header into a :class:`~werkzeug.datastructures.Range`324object.  If the header is missing or malformed `None` is returned.325`ranges` is a list of ``(start, stop)`` tuples where the ranges are326non-inclusive.327 328.. versionadded:: 0.7329r`Nrrr{�-rX)	r�r~r��330startswithr�331ValueErrorrbr��Range)rQ�make_inclusive�ranges�last_end�units�rngr�beginr��	begin_str�end_strs           rB�parse_range_headerr�<s����C�u�$��
�F��H����S�!�$�J�E��K�K�M���!�E��	�	�#����z�z�|���d�?���?�?�3����!�|��
�"�4�(���C��H�
�D�[�!%���C��!3��I�!���)�I��m�m�o�G�
�"�9�-����8�a�<��� �$�W�-��1�C��<�� ���!�o�s�2�H��
�
�u�c�l�#�I�L�8�8�E�"�"��;�
��
���
��
��"� �� �s6�E�E�;E)�332E�E�333E&�%E&�)334E7�6E7c�<�UcgU=(d SR5RSS5up#SU;agURSS5upEUS:XaSnO[U5nUS:Xa*[	SSU5(dg[335R"USSXaS9$SU;agURSS5upx[U5n	[U5S-n336[	X�U5(a[337R"X)X�US9$g![a gf=f![a gf=f![a gf=f)azParses a range header into a338:class:`~werkzeug.datastructures.ContentRange` object or `None` if339parsing is not possible.340 341.. versionadded:: 0.7342 343:param value: a content range header to be parsed.344:param on_update: an optional callable that is called every time a value345                  on the :class:`~werkzeug.datastructures.ContentRange`346                  object is changed.347Nrzr�/r_)r�r�)r~r�r�r�is_byte_range_validr��ContentRange)rQr�r��rangedefr��348length_strr��	start_str�stop_strr��stops           rB�parse_content_range_headerr�ws8��
�}��� �;�B�-�-�/�5�5�d�A�>����(����n�n�S�!�,�O�C��S����	��349�+�F��c�z�"�4��v�6�6�����u�d�D�&�N�N�	�C����)�)�C��+��I���9�%���(�#�a�'���5��/�/����u�T�Y�O�O���A������	��	������s5�+C.�C>�-D�.350C;�:C;�>351D�352D�353D�Dc�L�SU;a[S5eSUS3nU(aSU3nU$)z]Quote an etag.354 355:param etag: the etag to quote.356:param weak: set to `True` to tag it "weak".357rKzinvalid etag�W/)r���etag�weaks  rB�358quote_etagr��s6���d�{���(�(�
�t�f�A�;�D���D�6�{���KrAc��gr}r8�r�s rBr�r��s��14rAc��gr}r8r�s rBr�r��s��36rAc��U(dgUR5nSnURS5(aSnUSSnUSSUSSs=:XaS	:Xa359O X4$USSnX4$)360z�Unquote a single etag:361 362>>> unquote_etag('W/"bar"')363('bar', True)364>>> unquote_etag('"bar"')365('bar', False)366 367:param etag: the etag identifier to unquote.368:return: a ``(etag, weak)`` tuple.369�NNF)r�zw/TrWNrrXrK)r~r�r�s  rBr�r��so�����:�:�<�D��D����|�$�$����A�B�x���B�Q�x�4���9�#��#��:���A�b�z���:�rAc��U(d[R"5$/n/n[U5nSnXC:a�[R	X5nUcOwUR5upgnUS:Xa[R"SS9$U(aUnU(aUR
U5 OUR
U5 UR5nXC:aM�[R"X5$)zyParse an etag header.370 371:param value: the tag header to parse372:return: an :class:`~werkzeug.datastructures.ETags` object.373rr_T)�star_tag)r��ETagsrY�_etag_rer�r�rbr�)	rQ�strongr�r�r�r��is_weak�quoted�raws	         rB�parse_etagsr�s�����x�x�z��
�F�
�D�374
�e�*�C�375�C�376
�)����u�*���=��$�|�|�~�����#�:��8�8�T�*�*�
��C���K�K����M�M�#���i�i�k���)��8�8�F�!�!rAc�4�[U5R5$)zwGenerate an etag for some data.377 378.. versionchanged:: 2.0379    Use SHA-1. MD5 may not be available in some environments.380)r�	hexdigest)�datas rB�
generate_etagr�s����:���!�!rAc���Ucg[RRU5nUR381cUR
[RS9$U$![[4a gf=f)a#Parse an :rfc:`2822` date into a timezone-aware382:class:`datetime.datetime` object, or ``None`` if parsing fails.383 384This is a wrapper for :func:`email.utils.parsedate_to_datetime`. It385returns ``None`` if parsing fails instead of raising an exception,386and always returns a timezone-aware datetime object. If the string387doesn't have timezone information, it is assumed to be UTC.388 389:param value: A string with a supported date format.390 391.. versionchanged:: 2.0392    Return a timezone-aware datetime object. Use393    ``email.utils.parsedate_to_datetime``.394N��tzinfo)	�email�utils�parsedate_to_datetime�	TypeErrorr�rrPr	�utc)rQ�dts  rBr�r��sd��
�}���
�[�[�
.�
.�u�
5��395�y�y���z�z����z�.�.�
�I��

�z�"����s�A�A$�#A$c�~�[U[5(ak[U[5(d-[R"U[	5[396RS9nO[U5n[RRUSS9$[U[5(a[U5n[RRUSS9$)a�Format a datetime object or timestamp into an :rfc:`2822` date397string.398 399This is a wrapper for :func:`email.utils.format_datetime`. It400assumes naive datetime objects are in UTC instead of raising an401exception.402 403:param timestamp: The datetime or timestamp to format. Defaults to404    the current time.405 406.. versionchanged:: 2.0407    Use ``email.utils.format_datetime``. Accept ``date`` objects.408r409T)�usegmt)rkrr�combinerr	rrrr
�format_datetimer
r�410formatdate)�	timestamps rB�	http_daters��� �)�T�"�"��)�X�.�.� �(�(��D�F�8�<�<�P�I�#�9�-�I��{�{�*�*�9�T�*�B�B��)�[�)�)��9�%�	��;�;�!�!�)�D�!�9�9rAc��U(dg[U5nUS:ag[US9$![a gf=f![a gf=f)z�Parses a base-10 integer count of seconds into a timedelta.411 412If parsing fails, the return value is `None`.413 414:param value: a string consisting of an integer represented in base-10415:return: a :class:`datetime.timedelta` object or `None`.416Nr)�seconds)�intr�r�
OverflowError)rQrs  rB�	parse_ager;s[������e�*����{�����)�)�����������s�&�6�4173�3�418A�Ac��Ucg[U[5(a[UR55nO[U5nUS:a[	S5e[U5$)z�Formats the duration as a base-10 integer.419 420:param age: should be an integer number of seconds,421            a :class:`datetime.timedelta` object, or,422            if the age is unknown, `None` (default).423Nrzage cannot be negative)rkrr�
total_secondsr�rM)�ages rB�dump_ager!QsQ���{���#�y�!�!��#�#�#�%�&���#�h��424�Q�w��1�2�2��s�8�OrAc���[R"URS5URS5URS5URS5URS5UUUUS9	$)a�Convenience method for conditional requests.425 426:param environ: the WSGI environment of the request to be checked.427:param etag: the etag for the response for comparison.428:param data: or alternatively the data of the response to automatically429             generate an etag using :func:`generate_etag`.430:param last_modified: an optional date of the last modification.431:param ignore_if_range: If `False`, `If-Range` header will be taken into432                        account.433:return: `True` if the resource was modified, otherwise `False`.434 435.. versionchanged:: 2.0436    SHA-1 is used to generate an etag value for the data. MD5 may437    not be available in some environments.438 439.. versionchanged:: 1.0.0440    The check is run for methods other than ``GET`` and ``HEAD``.441�442HTTP_RANGE�
HTTP_IF_RANGE�HTTP_IF_MODIFIED_SINCE�HTTP_IF_NONE_MATCH�
HTTP_IF_MATCH)	�443http_range�
http_if_range�http_if_modified_since�http_if_none_match�
http_if_matchr�r�
last_modified�ignore_if_range)�_sansio_http�is_resource_modifiedr�)�environr�rr-r.s     rBr0r0esa��2�,�,��;�;�|�,��k�k�/�2�&�{�{�+C�D�"�;�;�';�<��k�k�/�2�
�
�#�'�444�445rAc���UVs1sHo"R5iM nnUVVs/sH.up4[U5(aUR5U;dM+X44PM0 snnUSS&gs snfs snnf)a�Remove all entity headers from a list or :class:`Headers` object.  This446operation works in-place.  `Expires` and `Content-Location` headers are447by default not removed.  The reason for this is :rfc:`2616` section44810.3.5 which specifies some entity headers that should be sent.449 450.. versionchanged:: 0.5451   added `allowed` parameter.452 453:param headers: a list or :class:`Headers` object.454:param allowed: a list of headers that should still be allowed even though455                they are entity headers.456N)r��is_entity_header)�headers�allowedrnrhrQs     rB�remove_entity_headersr6�sg�� #*�*�'�Q�w�w�y�'�G�*�"��!�J�C���$�$��	�	��w�(>�	���!��G�A�J��+��s�A"�*A'�A'c�j�UVVs/sHup[U5(aMX4PM snnUSS&gs snnf)z�Remove all HTTP/1.1 "Hop-by-Hop" headers from a list or457:class:`Headers` object.  This operation works in-place.458 459.. versionadded:: 0.5460 461:param headers: a list or :class:`Headers` object.462N)�is_hop_by_hop_header)r4rhrQs   rB�remove_hop_by_hop_headersr9�s4��(/��'.���6J�3�6O����w��G�A�J��s�/�/c�0�UR5[;$)z�Check if a header is an entity header.463 464.. versionadded:: 0.5465 466:param header: the header to test.467:return: `True` if it's an entity header, `False` otherwise.468)r��_entity_headersrws rBr3r3�s���<�<�>�_�,�,rAc�0�UR5[;$)z�Check if a header is an HTTP/1.1 "Hop-by-Hop" header.469 470.. versionadded:: 0.5471 472:param header: the header to test.473:return: `True` if it's an HTTP/1.1 "Hop-by-Hop" header, `False` otherwise.474)r��_hop_by_hop_headersrws rBr8r8�s���<�<�>�0�0�0rAc���[U[5(aURS5nOUnU(aURS5R	5n[475R"X!S9$)aParse a cookie from a string or WSGI environ.476 477The same key can be provided multiple times, the values are stored478in-order. The default :class:`MultiDict` will have the first value479first, and all values can be retrieved with480:meth:`MultiDict.getlist`.481 482:param header: The cookie header as a string, or a WSGI environ dict483    with a ``HTTP_COOKIE`` key.484:param cls: A dict-like class to store the parsed cookies in.485    Defaults to :class:`MultiDict`.486 487.. versionchanged:: 3.0488    Passing bytes, and the ``charset`` and ``errors`` parameters, were removed.489 490.. versionchanged:: 1.0491    Returns a :class:`MultiDict` instead of a ``TypeConversionDict``.492 493.. versionchanged:: 0.5494    Returns a :class:`TypeConversionDict` instead of a regular dict. The ``cls``495    parameter was added.496�HTTP_COOKIE�latin1)�cookier�)rkrlr��encode�decoder/�parse_cookie)rer�rAs   rBrDrD�sO��4�&�$������M�*����
����x�(�/�/�1���$�$�F�<�<rAz#[\w!#$%&'()*+\-./:<=>?@\[\]^`{|}~]*s[\x00-\x19\",;\\\x7f-\xff]s\"s\\)�"�\c#�P# �UHnURSS5SU-4v� M g7f)r�bigs\%03oN)�to_bytes)rt�vs  rBruru�s+����
6���Z�Z��5��9�q�=�)�
6�s�$&� s,;��c
��Ub497[USS9nU(aAURS5SRS5RS5R	S5n[U[5(a[UR55nUb![U[5(d[U5nOFUbCU(a<[[R"[RS9R5U-5nU498b!U499R!5n500U501S	;a[#S5025eU(aSn[$R'U5(d:[(R+SUR55R	S5nS
US
3nUR5R	S5SU3/nSU4SU4SU4SU4SU4SU4SU5034SU44H=up�UbUSLaMUSLaUR-U
5 M'UR-U
SU35 M? SR/U5n[1U5nU	(a9UU	:�a3[1U5n[2R4"SUSUSUU-504SUSU	S3S S!9 U$)"ar505Create a Set-Cookie header without the ``Set-Cookie`` prefix.506 507The return value is usually restricted to ascii as the vast majority508of values are properly escaped, but that is no guarantee. It's509tunneled through latin1 as required by :pep:`3333`.510 511The return value is not ASCII safe if the key contains unicode512characters.  This is technically against the specification but513happens in the wild.  It's strongly recommended to not use514non-ASCII values for the keys.515 516:param max_age: should be a number of seconds, or `None` (default) if517                the cookie should last only as long as the client's518                browser session.  Additionally `timedelta` objects519                are accepted, too.520:param expires: should be a `datetime` object or unix timestamp.521:param path: limits the cookie to a given path, per default it will522             span the whole domain.523:param domain: Use this if you want to set a cross-domain cookie. For524               example, ``domain="example.com"`` will set a cookie525               that is readable by the domain ``www.example.com``,526               ``foo.example.com`` etc. Otherwise, a cookie will only527               be readable by the domain that set it.528:param secure: The cookie will only be available via HTTPS529:param httponly: disallow JavaScript to access the cookie.  This is an530                 extension to the cookie standard and probably not531                 supported by all browsers.532:param charset: the encoding for string values.533:param sync_expires: automatically set expires if max_age is defined534                     but expires not.535:param max_size: Warn if the final header value exceeds this size. The536    default, 4093, should be safely `supported by most browsers537    <cookie_>`_. Set to 0 to disable this check.538:param samesite: Limits the scope of the cookie such that it will539    only be attached to requests if those requests are same-site.540:param partitioned: Opts the cookie into partitioned storage. This541    will also set secure to True542 543.. _`cookie`: http://browsercookielimits.squawky.net/544 545.. versionchanged:: 3.1546    The ``partitioned`` parameter was added.547 548.. versionchanged:: 3.0549    Passing bytes, and the ``charset`` parameter, were removed.550 551.. versionchanged:: 2.3.3552    The ``path`` parameter is ``/`` by default.553 554.. versionchanged:: 2.3.1555    The value allows more characters without quoting.556 557.. versionchanged:: 2.3558    ``localhost`` and other names without a dot are allowed for the domain. A559    leading dot is ignored.560 561.. versionchanged:: 2.3562    The ``path`` parameter is ``None`` by default.563 564.. versionchanged:: 1.0.0565    The string ``'None'`` is accepted for ``samesite``.566z%!$&'()*+,/:=@)�safe�:r�.�idnar�)�tz>�Lax�None�Strictz,SameSite must be 'Strict', 'Lax', or 'None'.Tc�0�[UR5$r})�_cookie_slash_mapr�)r�s rB�<lambda>�dump_cookie.<locals>.<lambda>`s��'����	�2rArKr@r`�Domain�ExpireszMax-Age�Secure�HttpOnly�Path�SameSite�PartitionedFrazThe 'z%' cookie is too large: the value was z bytes but the header required z! extra bytes. The final size was z bytes but the limit is z> bytes. Browsers may silently ignore cookies larger than this.rW)�567stacklevel)rr�r�rBrCrkrrrrMrr�nowr	rr�titler��_cookie_no_quote_rer��_cookie_slash_rer[rbrdrY�warnings�warn)rhrQ�max_ager�path�domain�secure�httponly�sync_expires�max_size�samesite�partitioned�buf�krJ�rv�cookie_size�568value_sizes                  rB�dump_cookierw�sg��X���T� 0�1��
��!�!�#�&�q�)�0�0��5�<�<�V�D�K�K�G�T���'�9�%�%��g�+�+�-�.�����'�3�'�'���(�G��	�	���H�L�L�H�L�L�9�C�C�E��O�P�����>�>�#���4�4��K�L�L�����(�(��/�/� �$�$�2�E�L�L�N�569�570�&��/�	��E�7�!����j�j�l�!�!�(�+�
,�A�e�W�5�5716�C�572�6��	�G��	�G��	�6��	�X��	���	�X��	��$�	���
�9��U�573����9��J�J�q�M���574�575�a�S��!��:��#	�&576���3��B�577�b�'�K��K�(�*���Z�578��
�
��C�5�=�j�\�J � +�j� 8�9�:��=� 8��579�C9�
9��	580��IrAc��USLUSL:wagUcUSL=(d US:�$UcSUs=:*=(a U:$s $X:�agSUs=:*=(a U:$s $)z[Checks if a given byte content range is valid for the given length.581 582.. versionadded:: 0.7583NFrr8)r�r�r�s   rBr�r��sn��	��
�4�4�<�(��	����~�,��1��,�	���E� � �D� � � � �	�����������rA)�datastructures)�http)T)rQzt.AnyrR�bool�returnrM)rQrMr|rM)re�584str | Nonerfzt.Mapping[str, t.Any]r|rM)rmz$dict[str, t.Any] | t.Iterable[t.Any]r|rM)rerpr|rM)rQrMr|z	list[str])rQrMr|zdict[str, str | None])rQr}r|ztuple[str, dict[str, str]])rQr}r|r�)rQr}r�ztype[_TAnyAccept]r|r�r})rQr}r�ztype[_TAnyAccept] | Noner|r�)rQr}r��9t.Callable[[ds.cache_control._CacheControl], None] | Noner|zds.RequestCacheControl)N.)rQr}r�r~r�r�r|r�r�)rQr}r�r~r�ztype[_TAnyCC] | Noner|r�)rQr}r��3t.Callable[[ds.ContentSecurityPolicy], None] | Noner|rp)rQr}r�rr�r�r|r�)rQr}r�rr�ztype[_TAnyCSP] | Noner|r�)rQr}r�z't.Callable[[ds.HeaderSet], None] | Noner|zds.HeaderSet)rQr}r|z585ds.IfRange)rQr}r�r{r|zds.Range | None)rQr}r�z*t.Callable[[ds.ContentRange], None] | Noner|zds.ContentRange | None)F)r�rMr�r{r|rM)r�rMr|ztuple[str, bool])r�rUr|ztuple[None, None])r�r}r|z$tuple[str, bool] | tuple[None, None])rQr}r|zds.ETags)r�bytesr|rM)rQr}r|zdatetime | None)rz2datetime | date | int | float | struct_time | Noner|rM)rQr}r|ztimedelta | None)r �timedelta | int | Noner|r})NNNT)r1rr�r}rzbytes | Noner-zdatetime | str | Noner.r{r|r{))rr)r4�"ds.Headers | list[tuple[str, str]]r5zt.Iterable[str]r|rU)r4r�r|rU)rerMr|r{)rezWSGIEnvironment | str | Noner�z#type[ds.MultiDict[str, str]] | Noner|zds.MultiDict[str, str])rzNNr�NFFTi�NF)rhrMrQrMrir�rz#str | datetime | int | float | Nonerjr}rkr}rlr{rmr{rnr{rorrpr}rqr{r|rM)r��586int | Noner�r�r�r�r|r{)]�587__future__r�email.utilsr�re�typingr�rgrrrrr	�enumr588�hashlibrrr
�urllib.parserr�	_internalrr�
TYPE_CHECKING�_typeshed.wsgir�	frozensetrN�compiler�r;r=�HTTP_STATUS_CODESr5rDrU�ArZr]rirorxr�r��ASCIIr�r��VERBOSEr�r�r�r��TypeVarr��overloadr�r�r�r�r�r�r�r�r�r�r�rrr�rrr!r0r6r9r3r8rDrerfrX�update�rangerwr�rzryr��sansiorzr/r8rArB�<module>r�s9	��"��	������������� �!�!��?�?�.��S����:�:�?�@����
�� �	���A���A��	�A���A���	A�589��A���
A���A��	(�A���A���A��	�A���A��	�A���A��	�A� �	�!A�"��#A�$��%A�&��'A�(��)A�*��+A�,�	�-A�.�	�/A�0��1A�2��3A�4�	�5A�6��7A�8��9A�:�	�;A�<�	�=A�>�	(�?A�@�	�AA�B��CA�D��EA�F�	�GA�H�	�IA�J�	#�KA�L�	�MA�N�	!�OA�P�	*�QA�R�	�SA�T��UA�V�	�WA�X�	�YA�Z��[A�\�	�]A�^��_A�`�	�aA�b�	 �cA�d�	�eA�f�	*�gA�h590�	(�	 �	�	�	�	�	%�	"�	�	�	�	(�AA��H"�4�"� �4� �!�H�j�j��2�4�4�(���&+�\-�`591H�:�zH�X�J�J�9����J���J�J�'>�b�h�h�O���J�J��592�H�H�r�z�z��
���:�:�k�2�8�8�4��X�v�j�j�)�2�8�8�4���i�i�
�[�9�����<��<����V��V�8<�2��2�4�2��2�j�)�)�I�%E�593F�����LP�!��!�H�!��!��!����LP�����H��594��
�	���LP� $�4��4�H�4�595�4�
�	4�<
�9�9�Z�'A�B�����FJ�#��#�B�#��#��#����FJ�����B��596���	���FJ�!%�!!��!!�B�!!�597�!!��	!!�L:>�=��=�6�=��=�B.�&/3�8#��8#�'+�8#��8#�z=A�3��3�9�3��3�l����4��4����6��6��598��)��2"�:"��<EI�:�A�:��:�@�,�,��+/� �#�
�#�599�#��#�)�	#�600�#�601�
#�P ?��
/��
��602��0603�-�1�04�"=�(�"=�	,�"=��"=�J�j�j�!G����N���:�:�<�b�d�d�C��!�'�2������
6�u�T�{�
6�U�
6�U�4��%5�
6����&*�37���������X�	�X��X�$�X�1�	X�604�X�
�
X�
�X��X��X��X��X��X�	�X�v���'��1;��	��&#�(rA
codekingpro/portable-devtools · Team Ai