Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/werkzeug/__pycache__/datastructures.cpython-37.pyc

1146 lines
98 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>/<2F>]qf<00>@sFdZddlZddlZddlZddlmZddlmZddlm Z ddl
m Z ddl
m Z dd l
m Z dd
l
mZdd l
mZdd l
mZdd l
mZddl
mZddl
mZddl
mZddl
mZddl
mZddlmZddlmZe<03>d<15>Zdd<17>Zdd<19>Zdd<1B>ZGdd<1D>de <20>Z!Gdd<1F>de!e"<22>Z#Gd d!<21>d!e <20>Z$Gd"d#<23>d#e$<24>Z%Gd$d%<25>d%e <20>Z&Gd&d'<27>d'e'<27>Z(Gd(d)<29>d)e$e(<28>Z)Gd*d+<2B>d+e <20>Z*ed,d-d.d/d0g<05>Gd1d2<64>d2e(<28><03>Z+Gd3d4<64>d4e <20>Z,ed,d-d.d/d0g<05>Gd5d6<64>d6e+<2B><03>Z-d7d8<64>Z.d9d:<3A>Z/ed,d-d.g<03>Gd;d<<3C>d<e <20><03>Z0Gd=d><3E>d>e <20>Z1Gd?d@<40>d@e1e0<65>Z2ed,d-d.d/d0g<05>GdAdB<64>dBe%e+<2B><04>Z3GdCdD<64>dDe+<2B>Z4GdEdF<64>dFe$e'<27>Z5GdGdH<64>dHe%e+<2B>Z6GdIdJ<64>dJe%e-<2D>Z7ed-g<01>GdKdL<64>dLe#<23><03>Z8GdMdN<64>dNe8<65>Z9GdOdP<64>dPe8<65>Z:GdQdR<64>dRe8<65>Z;dSdT<64>Z<GdUdV<64>dVe&e'<27>Z=GdWdX<64>dXe$e=<3D>Z>GdYdZ<64>dZe=<3D>Z?e@e<<3C>e=_<Gd[d\<5C>d\e&e'<27>ZAGd]d^<5E>d^e jB<6A>ZCGd_d`<60>d`e jDe jE<6A>ZFGdadb<64>dbe <20>ZGGdcdd<64>dde <20>ZHGdedf<64>dfe <20>ZIGdgdh<64>dhe$e'<27>ZJGdidj<64>dje&e'<27>ZKGdkdl<64>dle <20>ZLddmlMmNZNddnlMmOZOddolMmPZPddplMmQZQddqlMmRZRddrlMmSZSddslMmTZTddtlMmUZUddulMmVZVddvlMmWZWdS)wz<77>
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: 2007 Pallets
:license: BSD-3-Clause
<EFBFBD>N)<01>deepcopy)<01>repeat<61>)<01>
exceptions)<01>BytesIO)<01>collections_abc)<01> integer_types)<01> iteritems)<01>iterkeys)<01> iterlists)<01>
itervalues)<01>make_literal_wrapper)<01>PY2)<01> string_types)<01> text_type)<01> to_native)<01>_missing)<01>get_filesystem_encodingz[_-]cCstd|jj<00><01>dS)Nz%r objects are immutable)<03> TypeError<6F> __class__<5F>__name__)<01>self<6C>r<00>=/tmp/pip-install-c3kgu56x/Werkzeug/werkzeug/datastructures.py<70> is_immutable$srccs<>t|t<01>r(x<>t|dd<02>D]
}|VqWnht|t<03>r|x\t|<00>D]:\}}t|ttf<02>rlx"|D]}||fVqXWq<||fVq<Wnx|D]
}|Vq<>WdS)zyIterates over the items of a mapping yielding keys and values
without dropping any from more complex structures.
T)<01>multiN)<06>
isinstance<EFBFBD> MultiDictr <00>dict<63>tuple<6C>list)<04>mapping<6E>item<65>key<65>valuerrr<00>iter_multi_items(s
 


r%cs0ts dd<02>Sdd<04><00>dd<06><00><01><00><01>fdd<08>}|S) NcSs|S)Nr)<01>xrrr<00><lambda>=<00>z$native_itermethods.<locals>.<lambda>csBd<01>}d<02><00><01><00>fdd<04>}||_d|<02>f|_t|||<03>dS)Nzview%szview_%scst|<00><00>f|<01>|<02>S)N)<01> ViewItems)r<00>a<>kw)<02>name<6D> repr_namerr<00>
viewmethodCsz=native_itermethods.<locals>.setviewmethod.<locals>.viewmethodz$`%s()` object providing a view on %s)r<00>__doc__<5F>setattr)<04>clsr,Zviewmethod_namer.r)r,r-r<00> setviewmethod?s
z)native_itermethods.<locals>.setviewmethodcsFt||<01><02>t|d|<00><00><00>fdd<03>}||_d||_t|||<02>dS)Nziter%scst<00>|f|<01>|<02><01>S)N)r )rr*r+)<01>
itermethodrr<00>
listmethodQsz=native_itermethods.<locals>.setitermethod.<locals>.listmethodz+Like :py:meth:`iter%s`, but returns a list.)<04>getattrr0rr/)r1r,r4r)r3r<00> setitermethodMs 
 
z)native_itermethods.<locals>.setitermethodcs&x <20>D]}<01>||<01><00>||<01>qW|S)Nr)r1r,)<03>namesr6r2rr<00>wrapXs

z native_itermethods.<locals>.wrap)r)r7r8r)r7r6r2r<00>native_itermethods;s  r9c@sxeZdZdZdZdd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>ZeZ d d <0C>Z
d d<0E>Z e Z dd<10>Z dd<12>Zddd<15>Zdd<17>Zddd<19>ZdS)<1C>ImmutableListMixinzOMakes a :class:`list` immutable.
.. versionadded:: 0.5
:private:
NcCs&|jdk r|jStt|<00><01>}|_|S)N)<03> _hash_cache<68>hashr)r<00>rvrrr<00>__hash__ks
zImmutableListMixin.__hash__cCst|<00>t|<00>ffS)N)<02>typer )r<00>protocolrrr<00> __reduce_ex__qsz ImmutableListMixin.__reduce_ex__cCs t|<00>dS)N)r)rr#rrr<00> __delitem__tszImmutableListMixin.__delitem__cCs t|<00>dS)N)r)r<00>otherrrr<00>__iadd__wszImmutableListMixin.__iadd__cCs t|<00>dS)N)r)rr#r$rrr<00> __setitem__|szImmutableListMixin.__setitem__cCs t|<00>dS)N)r)rr"rrr<00>appendszImmutableListMixin.appendcCs t|<00>dS)N)r)r<00>iterablerrr<00>extend<6E>szImmutableListMixin.extendcCs t|<00>dS)N)r)r<00>posr$rrr<00>insert<72>szImmutableListMixin.insert<72><74><EFBFBD><EFBFBD><EFBFBD>cCs t|<00>dS)N)r)r<00>indexrrr<00>pop<6F>szImmutableListMixin.popcCs t|<00>dS)N)r)rrrr<00>reverse<73>szImmutableListMixin.reversecCs t|<00>dS)N)r)r<00>cmpr#rNrrr<00>sort<72>szImmutableListMixin.sort)rK)NNN)r<00>
__module__<EFBFBD> __qualname__r/r;r>rArBrD<00>__imul__rErF<00>removerHrJrMrNrPrrrrr:as
r:c@seZdZdZdd<03>ZdS)<05> ImmutableListzJAn immutable :class:`list`.
.. versionadded:: 0.5
:private:
cCsd|jjt<02>|<00>fS)Nz%s(%s))rrr <00>__repr__)rrrrrV<00>szImmutableList.__repr__N)rrQrRr/rVrrrrrU<00>srUcs~eZdZdZdZed<19>fdd<04> <09>Zdd<06>Zdd<08>Zd d
<EFBFBD>Z dd d <0C>Z
d d<0E>Z ddd<10>Z dd<12>Z dd<14>Zdd<16>Zdd<18>Z<10>ZS)<1C>ImmutableDictMixinzOMakes a :class:`dict` immutable.
.. versionadded:: 0.5
:private:
Ncs(t||<00><02>|<00>}|<03>t|t|<02><01><02>|S)N)<05>super<65>__new__<5F>__init__<5F>zipr)r1<00>keysr$<00>instance)rrr<00>fromkeys<79>szImmutableDictMixin.fromkeyscCst|<00>t|<00>ffS)N)r?r)rr@rrrrA<00>sz ImmutableDictMixin.__reduce_ex__cCst|<00>S)N)r )rrrr<00>_iter_hashitems<6D>sz"ImmutableDictMixin._iter_hashitemscCs*|jdk r|jStt|<00><03><00><01>}|_|S)N)r;r<<00> frozensetr_)rr=rrrr><00>s
zImmutableDictMixin.__hash__cCs t|<00>dS)N)r)rr#<00>defaultrrr<00>
setdefault<EFBFBD>szImmutableDictMixin.setdefaultcOs t|<00>dS)N)r)r<00>args<67>kwargsrrr<00>update<74>szImmutableDictMixin.updatecCs t|<00>dS)N)r)rr#rarrrrM<00>szImmutableDictMixin.popcCs t|<00>dS)N)r)rrrr<00>popitem<65>szImmutableDictMixin.popitemcCs t|<00>dS)N)r)rr#r$rrrrE<00>szImmutableDictMixin.__setitem__cCs t|<00>dS)N)r)rr#rrrrB<00>szImmutableDictMixin.__delitem__cCs t|<00>dS)N)r)rrrr<00>clear<61>szImmutableDictMixin.clear)N)N)N)rrQrRr/r;<00> classmethodr^rAr_r>rbrerMrfrErBrg<00> __classcell__rr)rrrW<00>s

rWc@sJeZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z ddd<10>Z
dS)<12>ImmutableMultiDictMixinzTMakes a :class:`MultiDict` immutable.
.. versionadded:: 0.5
:private:
cCst|<00>tt|dd<02><02>ffS)NT)r)r?r r )rr@rrrrA<00>sz%ImmutableMultiDictMixin.__reduce_ex__cCs t|dd<02>S)NT)r)r )rrrrr_<00>sz'ImmutableMultiDictMixin._iter_hashitemscCs t|<00>dS)N)r)rr#r$rrr<00>add<64>szImmutableMultiDictMixin.addcCs t|<00>dS)N)r)rrrr<00> popitemlist<73>sz#ImmutableMultiDictMixin.popitemlistcCs t|<00>dS)N)r)rr#rrr<00>poplist<73>szImmutableMultiDictMixin.poplistcCs t|<00>dS)N)r)rr#<00>new_listrrr<00>setlist<73>szImmutableMultiDictMixin.setlistNcCs t|<00>dS)N)r)rr#<00> default_listrrr<00>setlistdefault<6C>sz&ImmutableMultiDictMixin.setlistdefault)N) rrQrRr/rAr_rkrlrmrorqrrrrrj<00>srjcsleZdZdZdZ<04>fdd<04>Zd<0E>fdd<06> Zef<01>fdd<08> Zed <09>Z ed
<EFBFBD>Z
ed <0B>Z ed <0C>Z ed <0A>Z [<05>ZS)<0F>UpdateDictMixinzbMakes dicts call `self.on_update` on modifications.
.. versionadded:: 0.5
:private:
Ncs<00><01>fdd<02>}<01>|_|S)Ncs.ttt|<00><02><01>||<02>}|jdk r*|<00>|<00>|S)N)r5rXrr<00> on_update)rrcr+r=)rr,rr<00>oncall<6C>s

z,UpdateDictMixin.calls_update.<locals>.oncall)r)r,rt)r)r,r<00> calls_update<74>szUpdateDictMixin.calls_updatecs6||k}tt|<00><02>||<02>}|r2|jdk r2|<00>|<00>|S)N)rXrrrbrs)rr#ra<00>modifiedr=)rrrrbs

zUpdateDictMixin.setdefaultcsP||k}|tkr"tt|<00><02>|<01>}ntt|<00><02>||<02>}|rL|jdk rL|<00>|<00>|S)N)rrXrrrMrs)rr#rarvr=)rrrrM s
zUpdateDictMixin.poprErBrgrfre)N)rrQrRr/rsrurbrrMrErBrgrfrerirr)rrrr<00>s

rrc@seZdZdZddd<04>ZdS)<06>TypeConversionDictz<74>Works like a regular dict but the :meth:`get` method can perform
type conversions. :class:`MultiDict` and :class:`CombinedMultiDict`
are subclasses of this class and provide the same feature.
.. versionadded:: 0.5
NcCsTy ||}Wntk
r |SX|dk rPy ||<04>}Wntk
rN|}YnX|S)a<>Return the default value if the requested data doesn't exist.
If `type` is provided and is a callable it should convert the value,
return it or raise a :exc:`ValueError` if that is not possible. In
this case the function will return the default as if the value was not
found:
>>> d = TypeConversionDict(foo='42', bar='blub')
>>> d.get('foo', type=int)
42
>>> d.get('bar', -1, type=int)
-1
:param key: The key to be looked up.
:param default: The default value to be returned if the key can't
be looked up. If not further specified `None` is
returned.
:param type: A callable that is used to cast the value in the
:class:`MultiDict`. If a :exc:`ValueError` is raised
by this callable the default value is returned.
N)<02>KeyError<6F>
ValueError)rr#rar?r=rrr<00>get%s  
zTypeConversionDict.get)NN)rrQrRr/rzrrrrrwsrwc@s eZdZdZdd<03>Zdd<05>ZdS)<07>ImmutableTypeConversionDictzpWorks like a :class:`TypeConversionDict` but does not support
modifications.
.. versionadded:: 0.5
cCst|<00>S)z<>Return a shallow mutable copy of this object. Keep in mind that
the standard library's :func:`copy` function is a no-op for this class
like for any other python immutable type (eg: :class:`tuple`).
)rw)rrrr<00>copyMsz ImmutableTypeConversionDict.copycCs|S)Nr)rrrr<00>__copy__Tsz$ImmutableTypeConversionDict.__copy__N)rrQrRr/r|r}rrrrr{Fsr{c@s,eZdZdd<02>Zdd<04>Zdd<06>Zdd<08>Zd S)
r)cOs"||_||_||_||_||_dS)N)<05>_ViewItems__multi_dict<63>_ViewItems__method<6F>_ViewItems__repr_name<6D> _ViewItems__a<5F>_ViewItems__kw)rZ
multi_dict<EFBFBD>methodr-r*r+rrrrZYs
zViewItems.__init__cCst|j|j<02>|j|j<04>S)N)r5r~rr<>r<>)rrrrZ __get_items`szViewItems.__get_itemscCsd|jt|<00><02><00>fS)Nz%s(%r))r<>r <00>_ViewItems__get_items)rrrrrVcszViewItems.__repr__cCs t|<00><01><00>S)N)<02>iterr<72>)rrrr<00>__iter__fszViewItems.__iter__N)rrQrRrZr<>rVr<>rrrrr)Xsr)r\<00>values<65>items<6D>lists<74>
listvaluesc@s<>eZdZdZd9dd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Z d:dd<10>Z
dd<12>Z d;dd<14>Z d<dd<16>Z d=dd<19>Zdd<1B>Zdd<1D>ZeZdd<1F>Zd d!<21>Zd"d#<23>Zd>d$d%<25>Zd?d'd(<28>Zd)d*<2A>Zefd+d,<2C>Zd-d.<2E>Zd/d0<64>Zd1d2<64>Zd3d4<64>Zd5d6<64>Zd7d8<64>ZdS)@raA :class:`MultiDict` is a dictionary subclass customized to deal with
multiple values for the same key which is for example used by the parsing
functions in the wrappers. This is necessary because some HTML form
elements pass multiple values for the same key.
:class:`MultiDict` implements all standard dictionary methods.
Internally, it saves all values for a key as a list, but the standard dict
access methods will only return the first value for a key. If you want to
gain access to the other values, too, you have to use the `list` methods as
explained below.
Basic Usage:
>>> d = MultiDict([('a', 'b'), ('a', 'c')])
>>> d
MultiDict([('a', 'b'), ('a', 'c')])
>>> d['a']
'b'
>>> d.getlist('a')
['b', 'c']
>>> 'a' in d
True
It behaves like a normal dict thus all dict functions will only return the
first value when multiple values for one key are found.
From Werkzeug 0.3 onwards, the `KeyError` raised by this class is also a
subclass of the :exc:`~exceptions.BadRequest` HTTP exception and will
render a page for a ``400 BAD REQUEST`` if caught in a catch-all for HTTP
exceptions.
A :class:`MultiDict` can be constructed from an iterable of
``(key, value)`` tuples, a dict, a :class:`MultiDict` or from Werkzeug 0.2
onwards some keyword parameters.
:param mapping: the initial value for the :class:`MultiDict`. Either a
regular dict, an iterable of ``(key, value)`` tuples
or `None`.
NcCs<>t|t<01>r&t<02>|dd<02>t|<01>D<00><01>n<>t|t<02>r<>i}xHt|<01>D]<\}}t|ttf<02>rlt|<04>dkrbq>t|<04>}n|g}|||<q>Wt<02>||<02>n8i}x&|p<>dD]\}}|<02> |g<00><02>
|<04>q<>Wt<02>||<02>dS)Ncss"|]\}}||dd<00>fVqdS)Nr)<03>.0<EFBFBD>k<>lrrr<00> <genexpr><3E>sz%MultiDict.__init__.<locals>.<genexpr>rr) rrrrZr r rr <00>lenrbrF)rr!<00>tmpr#r$rrrrZ<00>s 

 
 zMultiDict.__init__cCs t|<00><01><00>S)N)rr<>)rrrr<00> __getstate__<5F>szMultiDict.__getstate__cCst<00>|<00>t<00>||<01>dS)N)rrgre)rr$rrr<00> __setstate__<5F>s
zMultiDict.__setstate__cCs6||kr(t<00>||<01>}t|<02>dkr(|dSt<03>|<01><01>dS)z<>Return the first data value for this key;
raises KeyError if not found.
:param key: The key to be looked up.
:raise KeyError: if the key does not exist.
rN)r<00> __getitem__r<5F>r<00>BadRequestKeyError)rr#<00>lstrrrr<><00>s
  zMultiDict.__getitem__cCst<00>|||g<01>dS)z<>Like :meth:`add` but removes an existing key first.
:param key: the key for the value.
:param value: the value to set.
N)rrE)rr#r$rrrrE<00>szMultiDict.__setitem__cCst<00>||g<00><03>|<02>dS)z<>Adds a new value for the key.
.. versionadded:: 0.6
:param key: the key for the value.
:param value: the value to add.
N)rrbrF)rr#r$rrrrk<00>sz MultiDict.addc Cstyt<00>||<01>}Wntk
r$gSX|dkr6t|<03>Sg}x4|D],}y|<04>||<05><01>Wq@tk
rjYq@Xq@W|S)aZReturn the list of items for a given key. If that key is not in the
`MultiDict`, the return value will be an empty list. Just as `get`
`getlist` accepts a `type` parameter. All items will be converted
with the callable defined there.
:param key: The key to be looked up.
:param type: A callable that is used to cast the value in the
:class:`MultiDict`. If a :exc:`ValueError` is raised
by this callable the value will be removed from the list.
:return: a :class:`list` of all the values for the key.
N)rr<>rxr rFry)rr#r?r=<00>resultr"rrr<00>getlist<73>s 

zMultiDict.getlistcCst<00>||t|<02><01>dS)aRemove the old values for a key and add new ones. Note that the list
you pass the values in will be shallow-copied before it is inserted in
the dictionary.
>>> d = MultiDict()
>>> d.setlist('foo', ['1', '2'])
>>> d['foo']
'1'
>>> d.getlist('foo')
['1', '2']
:param key: The key for which the values are set.
:param new_list: An iterable with the new values for the key. Old values
are removed first.
N)rrEr )rr#rnrrrro<00>szMultiDict.setlistcCs||kr|||<n||}|S)aGReturns the value for the key if it is in the dict, otherwise it
returns `default` and sets that value for `key`.
:param key: The key to be looked up.
:param default: The default value to be returned if the key is not
in the dict. If not further specified it's `None`.
r)rr#rarrrrb<00>s
zMultiDict.setdefaultcCs4||kr$t|pd<01>}t<01>|||<02>n t<01>||<01>}|S)a<>Like `setdefault` but sets multiple values. The list returned
is not a copy, but the list that is actually used internally. This
means that you can put new values into the dict by appending items
to the list:
>>> d = MultiDict({"foo": 1})
>>> d.setlistdefault("foo").extend([2, 3])
>>> d.getlist("foo")
[1, 2, 3]
:param key: The key to be looked up.
:param default_list: An iterable of default values. It is either copied
(in case it was a list) or converted into a list
before returned.
:return: a :class:`list`
r)r rrEr<>)rr#rprrrrq s
  zMultiDict.setlistdefaultFccsHxBtt|<00>D]4\}}|r2x&|D]}||fVqWq ||dfVq WdS)aReturn an iterator of ``(key, value)`` pairs.
:param multi: If set to `True` the iterator returned will have a pair
for each value of each key. Otherwise it will only
contain pairs for the first value of each key.
rN)r r)rrr#r<>r$rrrr<>!s

zMultiDict.itemsccs*x$tt|<00>D]\}}|t|<02>fVq WdS)zuReturn a iterator of ``(key, values)`` pairs, where values is the list
of all values associated with the key.N)r rr )rr#r<>rrrr<>0szMultiDict.listscCs
tt|<00>S)N)r
r)rrrrr\7szMultiDict.keysccs"xtt|<00>D]}|dVq WdS)zAReturns an iterator of the first value on every key's value list.rN)r r)rr<>rrrr<><szMultiDict.valuescCs
tt|<00>S)aReturn an iterator of all values associated with a key. Zipping
:meth:`keys` and this is the same as calling :meth:`lists`:
>>> d = MultiDict({"foo": [1, 2, 3]})
>>> zip(d.keys(), d.listvalues()) == d.lists()
True
)r r)rrrrr<>As zMultiDict.listvaluescCs
|<00>|<00>S)z%Return a shallow copy of this object.)r)rrrrr|LszMultiDict.copycCs|<00>t|jdd<02>|<01><02>S)z"Return a deep copy of this object.F)<01>flat)rr<00>to_dict)r<00>memorrrrPszMultiDict.deepcopyTcCs|rtt|<00><01>St|<00><02><00>S)a<>Return the contents as regular dict. If `flat` is `True` the
returned dict will only have the first item present, if `flat` is
`False` all values will be returned as lists.
:param flat: If set to `False` the dict returned will have lists
with all the values in it. Otherwise it will only
contain the first value for each key.
:return: a :class:`dict`
)rr r<>)rr<>rrrr<>Ts
 zMultiDict.to_dictcCs(x"t|<01>D]\}}t<01>|||<03>q
WdS)a<>update() extends rather than replaces existing key lists:
>>> a = MultiDict({'x': 1})
>>> b = MultiDict({'x': 2, 'y': 3})
>>> a.update(b)
>>> a
MultiDict([('y', 3), ('x', 1), ('x', 2)])
If the value list for a key in ``other_dict`` is empty, no new values
will be added to the dict and the key will not be created:
>>> x = {'empty_list': []}
>>> y = MultiDict()
>>> y.update(x)
>>> y
MultiDict([])
N)r%rrk)r<00>
other_dictr#r$rrrrebszMultiDict.updatecCsZy*t<00>||<01>}t|<03>dkr$t<03>|<01><01>|dStk
rT|tk rF|St<03>|<01><01>YnXdS)a<>Pop the first item for a list on the dict. Afterwards the
key is removed from the dict, so additional values are discarded:
>>> d = MultiDict({"foo": [1, 2, 3]})
>>> d.pop("foo")
1
>>> "foo" in d
False
:param key: the key to pop.
:param default: if provided the value to return if the key was
not in the dictionary.
rN)rrMr<>rr<>rxr)rr#rar<>rrrrMws  
z MultiDict.popc
Cspy8t<00>|<00>}t|d<00>dkr&t<03>|<01><01>|d|ddfStk
rj}zt<03>|jd<00><01>Wdd}~XYnXdS)zPop an item from the dict.rrN)rrfr<>rr<>rxrc)rr"<00>errrrf<00>s

zMultiDict.popitemcCst<00>||g<00>S)z<>Pop the list for a key from the dict. If the key is not in the dict
an empty list is returned.
.. versionchanged:: 0.5
If the key does no longer exist a list is returned instead of
raising an error.
)rrM)rr#rrrrm<00>szMultiDict.poplistc
CsBy
t<00>|<00>Stk
r<}zt<03>|jd<00><01>Wdd}~XYnXdS)z*Pop a ``(key, list)`` tuple from the dict.rN)rrfrxrr<>rc)rr<>rrrrl<00>s
zMultiDict.popitemlistcCs|<00><00>S)N)r|)rrrrr}<00>szMultiDict.__copy__cCs |j|d<01>S)N)r<>)r)rr<>rrr<00> __deepcopy__<5F>szMultiDict.__deepcopy__cCsd|jjtt|dd<03><02>fS)Nz%s(%r)T)r)rrr r )rrrrrV<00>szMultiDict.__repr__)N)N)N)N)F)N)T) rrQrRr/rZr<>r<>r<>rErkr<>rorbrqr<>r<>r\r<>r<>r<>r|rr<>rerrMrfrmrlr}r<>rVrrrrrjs8(




 

  
rc@s$eZdZdZdZdd<04>Zdd<06>ZdS)<08> _omd_bucketa Wraps values in the :class:`OrderedMultiDict`. This makes it
possible to keep an order over multiple different keys. It requires
a lot of extra memory and slows down access a lot, but makes it
possible to access elements in O(1) and iterate in O(n).
)<04>prevr#r$<00>nextcCsF|j|_||_||_d|_|jdkr*||_|jdk r<||j_||_dS)N)<06> _last_bucketr<74>r#r$r<><00> _first_bucket)r<00>omdr#r$rrrrZ<00>s

z_omd_bucket.__init__cCsH|jr|j|j_|jr |j|j_|j|kr2|j|_|j|krD|j|_dS)N)r<>r<>r<>r<>)rr<>rrr<00>unlink<6E>s



z_omd_bucket.unlinkN)rrQrRr/<00> __slots__rZr<>rrrrr<><00>s r<>c@s<>eZdZdZd2dd<04>Zdd<06>ZdZdd<08>Zd d
<EFBFBD>Zd d <0C>Z d d<0E>Z
dd<10>Z dd<12>Z dd<14>Z dd<16>ZeZdd<18>Zd3dd<1B>Zdd<1D>Zdd<1F>Zd d!<21>Zd4d"d#<23>Zd$d%<25>Zd5d&d'<27>Zd(d)<29>Zd*d+<2B>Zefd,d-<2D>Zd.d/<2F>Zd0d1<64>ZdS)6<>OrderedMultiDictaNWorks like a regular :class:`MultiDict` but preserves the
order of the fields. To convert the ordered multi dict into a
list you can use the :meth:`items` method and pass it ``multi=True``.
In general an :class:`OrderedMultiDict` is an order of magnitude
slower than a :class:`MultiDict`.
.. admonition:: note
Due to a limitation in Python you cannot convert an ordered
multi dict into a regular dict by using ``dict(multidict)``.
Instead you have to use the :meth:`to_dict` method, otherwise
the internal bucket objects are exposed.
NcCs.t<00>|<00>d|_|_|dk r*t<04>||<01>dS)N)rrZr<>r<>r<>re)rr!rrrrZ<00>s
 zOrderedMultiDict.__init__c
Cs<>t|t<01>stSt|t<03>r<>t|dd<02>}t|dd<02>}y6x0|D](\}}t|<03>\}}||ks\||kr8dSq8WWntk
rzdSXy t|<03>Wntk
r<EFBFBD>dSXdSt|<00>t|<01>kr<>dSx&t|<00>D]\}} |<01> |<08>| kr<>dSq<>WdS)NT)rF)
rr<00>NotImplementedr<64>r r<><00> StopIterationr<6E>r r<>)
rrCZiter1Ziter2Zk1Zv1Zk2Zv2r#r<>rrr<00>__eq__<5F>s.

     zOrderedMultiDict.__eq__cCs |<00>|<01> S)N)r<>)rrCrrr<00>__ne__
szOrderedMultiDict.__ne__cCst|<00>tt|dd<02><02>ffS)NT)r)r?r r )rr@rrrrA szOrderedMultiDict.__reduce_ex__cCstt|dd<02><02>S)NT)r)r r )rrrrr<>szOrderedMultiDict.__getstate__cCs,t<00>|<00>x|D]\}}|<00>||<03>qWdS)N)rrgrk)rr<>r#r$rrrr<>s
zOrderedMultiDict.__setstate__cCs(||krt<00>||<01>djSt<03>|<01><01>dS)Nr)rr<>r$rr<>)rr#rrrr<>szOrderedMultiDict.__getitem__cCs|<00>|<01>|<00>||<02>dS)N)rmrk)rr#r$rrrrEs
zOrderedMultiDict.__setitem__cCs|<00>|<01>dS)N)rM)rr#rrrrB!szOrderedMultiDict.__delitem__cCsdd<02>t|<00>D<00>S)Ncss|]\}}|VqdS)Nr)r<>r#r$rrrr<>%sz(OrderedMultiDict.keys.<locals>.<genexpr>)r )rrrrr\$szOrderedMultiDict.keyscCsdd<02>t|<00>D<00>S)Ncss|]\}}|VqdS)Nr)r<>r#r$rrrr<>*sz*OrderedMultiDict.values.<locals>.<genexpr>)r )rrrrr<>)szOrderedMultiDict.valuesFccsp|j}|r.x`|dk r*|j|jfV|j}q Wn>t<04>}x6|dk rj|j|krb|<03>|j<01>|j|jfV|j}q6WdS)N)r<>r#r$r<><00>setrk)rr<00>ptr<74> returned_keysrrrr<>,s
 

 zOrderedMultiDict.itemsccsNt<00>}|j}x<|dk rH|j|kr@|j|<00>|j<02>fV|<01>|j<02>|j}qWdS)N)r<>r<>r#r<>rkr<>)rr<>r<>rrrr<>:s

 zOrderedMultiDict.listsccs xt|<00>D]\}}|Vq
WdS)N)r )r<00>_keyr<79>rrrr<>CszOrderedMultiDict.listvaluescCs t<00>||g<00><03>t|||<02><03>dS)N)rrbrFr<>)rr#r$rrrrkGszOrderedMultiDict.addc Cs|yt<00>||<01>}Wntk
r$gSX|dkr<dd<02>|D<00>Sg}x6|D].}y|<04>||j<04><01>WqFtk
rrYqFXqFW|S)NcSsg|]
}|j<00>qSr)r$)r<>r&rrr<00>
<listcomp>Psz,OrderedMultiDict.getlist.<locals>.<listcomp>)rr<>rxrFr$ry)rr#r?r=r<>r"rrrr<>Js

zOrderedMultiDict.getlistcCs(|<00>|<01>x|D]}|<00>||<03>qWdS)N)rmrk)rr#rnr$rrrroYs

zOrderedMultiDict.setlistcCs td<01><01>dS)Nz5setlistdefault is unsupported for ordered multi dicts)r)rr#rprrrrq^szOrderedMultiDict.setlistdefaultcCs(x"t|<01>D]\}}t<01>|||<03>q
WdS)N)r%r<>rk)rr!r#r$rrrreaszOrderedMultiDict.updatecCs4t<00>||d<01>}x|D]}|<03>|<00>qWdd<03>|D<00>S)NrcSsg|]
}|j<00>qSr)r$)r<>r&rrrr<>isz,OrderedMultiDict.poplist.<locals>.<listcomp>)rrMr<>)rr#<00>buckets<74>bucketrrrrmes
zOrderedMultiDict.poplistcCs^yt<00>||<01>}Wn*tk
r:|tk r,|St<04>|<01><01>YnXx|D]}|<04>|<00>qBW|djS)Nr)rrMrxrrr<>r<>r$)rr#rar<>r<>rrrrMks
zOrderedMultiDict.popc
Cslyt<00>|<00>\}}Wn2tk
rD}zt<03>|jd<00><01>Wdd}~XYnXx|D]}|<04>|<00>qLW||djfS)Nr)rrfrxrr<>rcr<>r$)rr#r<>r<>r<>rrrrfvs"
zOrderedMultiDict.popitemc
Cspyt<00>|<00>\}}Wn2tk
rD}zt<03>|jd<00><01>Wdd}~XYnXx|D]}|<04>|<00>qLW|dd<03>|D<00>fS)NrcSsg|]
}|j<00>qSr)r$)r<>r&rrrr<><00>sz0OrderedMultiDict.popitemlist.<locals>.<listcomp>)rrfrxrr<>rcr<>)rr#r<>r<>r<>rrrrls"
zOrderedMultiDict.popitemlist)N)F)N)N)rrQrRr/rZr<>r>r<>rAr<>r<>r<>rErBr\r<>r<>r<>r<>r<>rkr<>rorqrermrrMrfrlrrrrr<><00>s4

 

  r<>cCst|tdd<02>|<01><02>D<00><01><01>S)Ncss"|]\}}|<01>dd<01>|fVqdS)<03>_<>-N)<01>replace)r<>r<><00>vrrrr<><00>sz&_options_header_vkw.<locals>.<genexpr>)<03>dump_options_headerrr<>)r$r+rrr<00>_options_header_vkw<6B>sr<>cCs*t|t<01>r|<00>d<01>}t|t<03>s&t|<00>}|S)Nzlatin-1)r<00>bytes<65>decoder)r$rrr<00>_unicodify_header_value<75>s



r<>c@s&eZdZdZdDdd<04>ZdEdd<07>Zdd <09>ZdZd
d <0B>ZdFd d <0A>Z dGdd<0F>Z
dd<11>Z dHdd<13>Z dIdd<15>Z dd<17>Zdd<19>ZdJdd<1C>Zdd<1E>Zdefdd <20>Zd!d"<22>Zd#d$<24>ZeZd%d&<26>Zd'd(<28>Zd)d*<2A>Zd+d,<2C>Zd-d.<2E>Zd/d0<64>Zd1d2<64>Zd3d4<64>Zd5d6<64>ZdKd8d9<64>Z d:d;<3B>Z!d<d=<3D>Z"d>d?<3F>Z#d@dA<64>Z$dBdC<64>Z%dS)L<>Headersa<73>An object that stores some headers. It has a dict-like interface
but is ordered and can store the same keys multiple times.
This data structure is useful if you want a nicer way to handle WSGI
headers which are stored as tuples in a list.
From Werkzeug 0.3 onwards, the :exc:`KeyError` raised by this class is
also a subclass of the :class:`~exceptions.BadRequest` HTTP exception
and will render a page for a ``400 BAD REQUEST`` if caught in a
catch-all for HTTP exceptions.
Headers is mostly compatible with the Python :class:`wsgiref.headers.Headers`
class, with the exception of `__getitem__`. :mod:`wsgiref` will return
`None` for ``headers['missing']``, whereas :class:`Headers` will raise
a :class:`KeyError`.
To create a new :class:`Headers` object pass it a list or dict of headers
which are used as default values. This does not reuse the list passed
to the constructor for internal usage.
:param defaults: The list of default values for the :class:`Headers`.
.. versionchanged:: 0.9
This data structure now stores unicode values similar to how the
multi dicts do it. The main difference is that bytes can be set as
well which will automatically be latin1 decoded.
.. versionchanged:: 0.9
The :meth:`linked` function was removed without replacement as it
was an API that does not support the changes to the encoding model.
NcCs8g|_|dk r4t|ttf<02>r*|j<00>|<01>n
|<00>|<01>dS)N)<05>_listrr r<>rH)r<00>defaultsrrrrZ<00>s
zHeaders.__init__FcCs<>|s2t|t<01>r|j|St|t<03>r2|<00>|j|<00>St|t<05>sFt<06>|<01><01>|<01><08>}x"|jD]\}}|<04><08>|krV|SqVW|r|t <09><00>t<06>|<01><01>dS)N)
rrr<><00>slicerrrr<><00>lowerrx)rr#<00> _get_mode<64>ikeyr<79>r<>rrrr<><00>s




 zHeaders.__getitem__cCs |j|jkot|j<02>t|j<02>kS)N)rr<>r<>)rrCrrrr<><00>szHeaders.__eq__cCs |<00>|<01> S)N)r<>)rrCrrrr<><00>szHeaders.__ne__cCsdy|j|dd<02>}Wntk
r&|SX|r6|<05>d<03>}|dkrB|Sy||<05>Stk
r^|SXdS)a]Return the default value if the requested data doesn't exist.
If `type` is provided and is a callable it should convert the value,
return it or raise a :exc:`ValueError` if that is not possible. In
this case the function will return the default as if the value was not
found:
>>> d = Headers([('Content-Length', '42')])
>>> d.get('Content-Length', type=int)
42
If a headers object is bound you must not add unicode strings
because no encoding takes place.
.. versionadded:: 0.9
Added support for `as_bytes`.
:param key: The key to be looked up.
:param default: The default value to be returned if the key can't
be looked up. If not further specified `None` is
returned.
:param type: A callable that is used to cast the value in the
:class:`Headers`. If a :exc:`ValueError` is raised
by this callable the default value is returned.
:param as_bytes: return bytes instead of unicode strings.
T)r<><00>latin1N)r<>rx<00>encodery)rr#rar?<00>as_bytesr=rrrrz<00>s
z Headers.getc Csr|<01><00>}g}x`|D]X\}}|<06><00>|kr|r4|<07>d<01>}|dk r`y ||<07>}Wntk
r^wYnX|<05>|<07>qW|S)a<>Return the list of items for a given key. If that key is not in the
:class:`Headers`, the return value will be an empty list. Just as
:meth:`get` :meth:`getlist` accepts a `type` parameter. All items will
be converted with the callable defined there.
.. versionadded:: 0.9
Added support for `as_bytes`.
:param key: The key to be looked up.
:param type: A callable that is used to cast the value in the
:class:`Headers`. If a :exc:`ValueError` is raised
by this callable the value will be removed from the list.
:return: a :class:`list` of all the values for the key.
:param as_bytes: return bytes instead of unicode strings.
r<>N)r<>r<>ryrF)rr#r?r<>r<>r<>r<>r<>rrrr<>s 
 zHeaders.getlistcCs
|<00>|<01>S)z<>Return a list of all the values for the named field.
This method is compatible with the :mod:`wsgiref`
:meth:`~wsgiref.headers.Headers.get_all` method.
)r<>)rr,rrr<00>get_all!szHeaders.get_allccs,x&|D]\}}|r|<02><00>}||fVqWdS)N)r<>)rr<>r#r$rrrr<>)sz Headers.itemsccs"xt||<01>D]\}}|Vq WdS)N)r )rr<>r#r<>rrrr\/sz Headers.keysccs xt|<00>D]\}}|Vq
WdS)N)r )rr<>r$rrrr<>3szHeaders.valuescCszt|t<01>rXxjt|<01>D]>\}}t|ttf<02>rFx&|D]}|<00>||<04>q0Wq|<00>||<03>qWnx|D]\}}|<00>||<03>q^WdS)zXExtend the headers with a dict or an iterable yielding keys and
values.
N)rrr rr rk)rrGr#r$r<>rrrrH7s

zHeaders.extendTcCsj|rt|ttf<02>r|j|=dS|<01><04>}g}x,|jD]"\}}|<04><04>|kr2|<03>||f<02>q2W||jdd<00><dS)N)rrr<>r<>r<>rF)rr#<00>_index_operation<6F>newr<77>r<>rrrrBFs zHeaders.__delitem__cCs|j|dd<02>S)zBRemove a key.
:param key: The key to be removed.
F)r<>)rB)rr#rrrrTQszHeaders.removecCsf|dkr|j<00><01>St|t<03>r(|j<00>|<01>Sy||}|<00>|<01>Wn"tk
r`|tk rZ|S<00>YnX|S)aQRemoves and returns a key or index.
:param key: The key to be popped. If this is an integer the item at
that position is removed, if it's a string the value for
that key is. If the key is omitted or `None` the last
item is removed.
:return: an item.
N)r<>rMrrrTrxr)rr#rar=rrrrMXs 

 z Headers.popcCs|<00><00>S)z7Removes a key or index and returns a (key, value) item.)rM)rrrrrfnszHeaders.popitemcCs,y|j|dd<02>Wntk
r&dSXdS)zCheck if a key is present.T)r<>F)r<>rx)rr#rrr<00> __contains__rs
zHeaders.__contains__cCs
t|j<01>S)zYield ``(key, value)`` tuples.)r<>r<>)rrrrr<>|szHeaders.__iter__cCs
t|j<01>S)N)r<>r<>)rrrr<00>__len__<5F>szHeaders.__len__cKs<|rt||<03>}t|<01>}t|<02>}|<00>|<02>|j<03>||f<02>dS)aAdd a new header tuple to the list.
Keyword arguments can specify additional parameters for the header
value, with underscores converted to dashes::
>>> d = Headers()
>>> d.add('Content-Type', 'text/plain')
>>> d.add('Content-Disposition', 'attachment', filename='foo.png')
The keyword argument dumping uses :func:`dump_options_header`
behind the scenes.
.. versionadded:: 0.4.1
keyword arguments were added for :mod:`wsgiref` compatibility.
N)r<>r<><00>_validate_valuer<65>rF)rr<><00>_valuer+rrrrk<00>s 

z Headers.addcCs.t|t<01>std<01><01>d|ks"d|kr*td<04><01>dS)NzValue should be unicode.<2E>
<EFBFBD> zGDetected newline in header value. This is a potential security problem)rrrry)rr$rrrr<><00>s

zHeaders._validate_valuecKs|j||f|<03>dS)z<>Add a new header tuple to the list.
An alias for :meth:`add` for compatibility with the :mod:`wsgiref`
:meth:`~wsgiref.headers.Headers.add_header` method.
N)rk)rr<>r<>Z_kwrrr<00>
add_header<EFBFBD>szHeaders.add_headercCs|jdd<01>=dS)zClears all headers.N)r<>)rrrrrg<00>sz Headers.clearc s<>|rt||<03>}t|<01>}t|<02>}|<00>|<02>|jsB|j<03>||f<02>dSt|j<03>}|<01><06><00>xHt|<04>D](\}\}}|<06><06><00>kr^||f|j|<Pq^W|j<03>||f<02>dS<00>fdd<03>|D<00>|j|dd<01><dS)a0Remove all header tuples for `key` and add a new one. The newly
added key either appears at the end of the list if there was no
entry or replaces the first one.
Keyword arguments can specify additional parameters for the header
value, with underscores converted to dashes. See :meth:`add` for
more information.
.. versionchanged:: 0.6.1
:meth:`set` now accepts the same arguments as :meth:`add`.
:param key: The key to be inserted.
:param value: The value to be inserted.
Ncs g|]}|d<00><00><00>kr|<01>qS)r)r<>)r<><00>t)r<>rrr<><00>szHeaders.set.<locals>.<listcomp>r)r<>r<>r<>r<>rFr<>r<><00> enumerate)rr<>r<>r+<00>listiter<65>idxZold_keyZ
_old_valuer)r<>rr<><00>s"


 z Headers.setcCs ||kr||S|<00>||<02>|S)aGReturns the value for the key if it is in the dict, otherwise it
returns `default` and sets that value for `key`.
:param key: The key to be looked up.
:param default: The default value to be returned if the key is not
in the dict. If not further specified it's `None`.
)r<>)rr#rarrrrb<00>s zHeaders.setdefaultcstt|ttf<02>rdt|t<02>r|g}dd<02>|D<00>}<02>fdd<02>|D<00>t|t<02>rX|d<00>j|<qp|<02>j|<n <0C><00>||<02>dS)z=Like :meth:`set` but also supports index/slice based setting.cSs g|]\}}t|<01>t|<02>f<02>qSr)r<>)r<>r<>r<>rrrr<><00>sz'Headers.__setitem__.<locals>.<listcomp>csg|]\}}<02><00>|<02><01>qSr)r<>)r<>r<>r<>)rrrr<><00>srN)rr<>rr<>r<>)rr#r$r)rrrE<00>s

 zHeaders.__setitem__<5F>
iso-8859-1cCs"ddlm}|dtdd<05>|<00><03>S)zXConvert the headers into a list suitable for WSGI.
.. deprecated:: 0.9
r)<01>warnzf'to_list' deprecated as of version 0.9 and will be removed in version 1.0. Use 'to_wsgi_list' instead.<2E>)<01>
stacklevel)<04>warningsr<73><00>DeprecationWarning<6E> to_wsgi_list)r<00>charsetr<74>rrr<00>to_list<73>s  zHeaders.to_listcCstrdd<02>|D<00>St|<00>S)z<>Convert the headers into a list suitable for WSGI.
The values are byte strings in Python 2 converted to latin1 and unicode
strings in Python 3 for the WSGI server to encode.
:return: list
cSs"g|]\}}t|<01>|<02>d<00>f<02>qS)r<>)rr<>)r<>r<>r<>rrrr<>sz(Headers.to_wsgi_list.<locals>.<listcomp>)rr )rrrrr<><00>szHeaders.to_wsgi_listcCs |<00>|j<01>S)N)rr<>)rrrrr| sz Headers.copycCs|<00><00>S)N)r|)rrrrr}szHeaders.__copy__cCs@g}x&|<00><00>D]\}}|<01>d||f<00>qW|<01>d<02>d<02>|<01>S)z9Returns formatted headers suitable for HTTP transmission.z%s: %sz
)r<>rF<00>join)r<00>strsr#r$rrr<00>__str__s

zHeaders.__str__cCsd|jjt|<00>fS)Nz%s(%r))rrr )rrrrrVszHeaders.__repr__)N)F)NNF)NF)F)F)T)r<>)&rrQrRr/rZr<>r<>r>r<>rzr<>r<>r<>r\r<>rHrBrTrrMrfr<><00>has_keyr<79>r<>rkr<>r<>rgr<>rbrEr<>r<>r|r}r<>rVrrrrr<><00>sD 


'



 # 
 r<>c@s^eZdZdZdd<03>Zdd<05>ZeZdd<07>ZeZZ dd <09>Z
d
d <0B>Z dd d<0E>Z dd<10>Z dd<12>ZdS)<15>ImmutableHeadersMixinz<6E>Makes a :class:`Headers` immutable. We do not mark them as
hashable though since the only usecase for this datastructure
in Werkzeug is a view on a mutable structure.
.. versionadded:: 0.5
:private:
cKs t|<00>dS)N)r)rr#rdrrrrB'sz!ImmutableHeadersMixin.__delitem__cCs t|<00>dS)N)r)rr#r$rrrrE*sz!ImmutableHeadersMixin.__setitem__cCs t|<00>dS)N)r)rr"rrrrk/szImmutableHeadersMixin.addcCs t|<00>dS)N)r)rrGrrrrH4szImmutableHeadersMixin.extendcCs t|<00>dS)N)r)rrIr$rrrrJ7szImmutableHeadersMixin.insertrKcCs t|<00>dS)N)r)rrLrrrrM:szImmutableHeadersMixin.popcCs t|<00>dS)N)r)rrrrrf=szImmutableHeadersMixin.popitemcCs t|<00>dS)N)r)rr#rarrrrb@sz ImmutableHeadersMixin.setdefaultN)rK)rrQrRr/rBrEr<>rkrTr<>rHrJrMrfrbrrrrr<>s
r<>c@sFeZdZdZdd<03>Zdd<05>ZdZddd <09>Zd
d <0B>Zd d <0A>Z dd<0F>Z
dS)<11>EnvironHeadersa<73>Read only version of the headers from a WSGI environment. This
provides the same interface as `Headers` and is constructed from
a WSGI environment.
From Werkzeug 0.3 onwards, the `KeyError` raised by this class is also a
subclass of the :exc:`~exceptions.BadRequest` HTTP exception and will
render a page for a ``400 BAD REQUEST`` if caught in a catch-all for
HTTP exceptions.
cCs
||_dS)N)<01>environ)rr<>rrrrZOszEnvironHeaders.__init__cCs |j|jkS)N)r<>)rrCrrrr<>RszEnvironHeaders.__eq__NFcCsJt|t<01>st|<01><01>|<01><03><00>dd<02>}|dkr8t|j|<00>St|jd|<00>S)Nr<4E>r<>)<02> CONTENT_TYPE<50>CONTENT_LENGTH<54>HTTP_)rrrx<00>upperr<72>r<>r<>)rr#r<>rrrr<>Ws 
zEnvironHeaders.__getitem__cCsttt|<00><01><01>S)N)r<>r r<>)rrrrr<>aszEnvironHeaders.__len__ccsxxrt|j<01>D]d\}}|<01>d<01>rJ|dkrJ|dd<00><00>dd<05><02><04>t|<02>fVq |dkr |r |<01>dd<05><02><04>t|<02>fVq WdS)Nr<4E>)ZHTTP_CONTENT_TYPEZHTTP_CONTENT_LENGTH<54>r<>r<>)r<>r<>)r r<><00>
startswithr<EFBFBD><00>titler<65>)rr#r$rrrr<>fs  zEnvironHeaders.__iter__cCstd|jj<00><01>dS)Nzcannot create %r copies)rrr)rrrrr|sszEnvironHeaders.copy)F) rrQrRr/rZr<>r>r<>r<>r<>r|rrrrr<>Ds 
 r<>c@s<>eZdZdZdd<03>Zd'dd<06>Zedd<08><00>Zd d
<EFBFBD>Zd(d d <0C>Z d)d d<0E>Z
dd<10>Z dd<12>Z e Z d*dd<15>Zdd<17>Zdd<19>Zdd<1B>Zdd<1D>Zd+dd <20>Zd!d"<22>Zd#d$<24>ZeZd%d&<26>ZdS),<2C>CombinedMultiDicta>A read only :class:`MultiDict` that you can pass multiple :class:`MultiDict`
instances as sequence and it will combine the return values of all wrapped
dicts:
>>> from werkzeug.datastructures import CombinedMultiDict, MultiDict
>>> post = MultiDict([('foo', 'bar')])
>>> get = MultiDict([('blub', 'blah')])
>>> combined = CombinedMultiDict([get, post])
>>> combined['foo']
'bar'
>>> combined['blub']
'blah'
This works for all read operations and will raise a `TypeError` for
methods that usually change data which isn't possible.
From Werkzeug 0.3 onwards, the `KeyError` raised by this class is also a
subclass of the :exc:`~exceptions.BadRequest` HTTP exception and will
render a page for a ``400 BAD REQUEST`` if caught in a catch-all for HTTP
exceptions.
cCst|<00>|jffS)N)r?<00>dicts)rr@rrrrA<00>szCombinedMultiDict.__reduce_ex__NcCs|pg|_dS)N)r<>)rr<>rrrrZ<00>szCombinedMultiDict.__init__cCstd|j<00><01>dS)Nz&cannot create %r instances by fromkeys)rr)r1rrrr^<00>szCombinedMultiDict.fromkeyscCs.x|jD]}||kr||SqWt<01>|<01><01>dS)N)r<>rr<>)rr#<00>drrrr<><00>s  zCombinedMultiDict.__getitem__c CsPxJ|jD]@}||kr|dk r@y |||<00>Stk
r>wYnX||SqW|S)N)r<>ry)rr#rar?r<>rrrrz<00>s   zCombinedMultiDict.getcCs*g}x |jD]}|<03>|<04>||<02><02>q W|S)N)r<>rHr<>)rr#r?r=r<>rrrr<><00>s zCombinedMultiDict.getlistcCs(t<00>}x|jD]}|<01>t|<02><01>qW|S)aThis function exists so __len__ can be implemented more efficiently,
saving one list creation from an iterator.
Using this for Python 2's ``dict.keys`` behavior would be useless since
`dict.keys` in Python 2 returns a list, while we have a set here.
)r<>r<>rer
)rr=r<>rrr<00>
_keys_impl<EFBFBD>s zCombinedMultiDict._keys_implcCs t|<00><01><00>S)N)r<>r<>)rrrrr\<00>szCombinedMultiDict.keysFccs^t<00>}xR|jD]H}xBt||<01>D]4\}}|r6||fVq||kr|<02>|<04>||fVqWqWdS)N)r<>r<>r rk)rr<00>foundr<64>r#r$rrrr<><00>s  
zCombinedMultiDict.itemsccs xt|<00>D]\}}|Vq
WdS)N)r )rr<>r$rrrr<><00>szCombinedMultiDict.valuescCsDi}x6|jD],}x&t|<02>D]\}}|<01>|g<00><02>|<04>qWq Wt|<01>S)N)r<>r rbrHr )rr=r<>r#r<>rrrr<><00>s
 zCombinedMultiDict.listscCsdd<02>|<00><00>D<00>S)Ncss|]}|dVqdS)rNr)r<>r&rrrr<><00>sz/CombinedMultiDict.listvalues.<locals>.<genexpr>)r<>)rrrrr<><00>szCombinedMultiDict.listvaluescCst|<00>S)a0Return a shallow mutable copy of this object.
This returns a :class:`MultiDict` representing the data at the
time of copying. The copy will no longer reflect changes to the
wrapped dicts.
.. versionchanged:: 0.15
Return a mutable :class:`MultiDict`.
)r)rrrrr|<00>s
zCombinedMultiDict.copyTcCs,i}x"t|j<01>D]}|<02>|<03>|<01><01>qW|S)a<>Return the contents as regular dict. If `flat` is `True` the
returned dict will only have the first item present, if `flat` is
`False` all values will be returned as lists.
:param flat: If set to `False` the dict returned will have lists
with all the values in it. Otherwise it will only
contain the first item for each key.
:return: a :class:`dict`
)<04>reversedr<64>rer<>)rr<>r=r<>rrrr<><00>s
zCombinedMultiDict.to_dictcCs t|<00><01><00>S)N)r<>r<>)rrrrr<><00>szCombinedMultiDict.__len__cCs x|jD]}||krdSqWdS)NTF)r<>)rr#r<>rrrr<><00>s zCombinedMultiDict.__contains__cCsd|jj|jfS)Nz%s(%r))rrr<>)rrrrrV<00>szCombinedMultiDict.__repr__)N)NN)N)F)T)rrQrRr/rArZrhr^r<>rzr<>r<>r\r<>r<>r<>r<>r<>r|r<>r<>r<>r<>rVrrrrr<>ws(
 
 

r<>c@seZdZdZddd<04>ZdS)<06> FileMultiDictz<74>A special :class:`MultiDict` that has convenience methods to add
files to it. This is used for :class:`EnvironBuilder` and generally
useful for unittesting.
.. versionadded:: 0.5
NcCslt|t<01>r|}nLt|t<02>r0|dkr&|}t|d<02>}|rN|dkrNt<04>|<03>dpLd}t||||<04>}|<00>||<05>dS)aPAdds a new file to the dict. `file` can be a file name or
a :class:`file`-like or a :class:`FileStorage` object.
:param name: the name of the field.
:param file: a filename or :class:`file`-like object
:param filename: an optional filename
:param content_type: an optional content type
N<>rbrzapplication/octet-stream)r<00> FileStorager<00>open<65> mimetypes<65>
guess_typerk)rr,<00>file<6C>filename<6D> content_typer$rrr<00>add_file s


 zFileMultiDict.add_file)NN)rrQrRr/r<>rrrrr<>sr<>c@s(eZdZdZdd<03>Zdd<05>Zdd<07>ZdS) <09> ImmutableDictz;An immutable :class:`dict`.
.. versionadded:: 0.5
cCsd|jjt<02>|<00>fS)Nz%s(%s))rrrrV)rrrrrV*szImmutableDict.__repr__cCst|<00>S)z<>Return a shallow mutable copy of this object. Keep in mind that
the standard library's :func:`copy` function is a no-op for this class
like for any other python immutable type (eg: :class:`tuple`).
)r)rrrrr|-szImmutableDict.copycCs|S)Nr)rrrrr}4szImmutableDict.__copy__N)rrQrRr/rVr|r}rrrrr<>$sr<>c@s eZdZdZdd<03>Zdd<05>ZdS)<07>ImmutableMultiDictz@An immutable :class:`MultiDict`.
.. versionadded:: 0.5
cCst|<00>S)z<>Return a shallow mutable copy of this object. Keep in mind that
the standard library's :func:`copy` function is a no-op for this class
like for any other python immutable type (eg: :class:`tuple`).
)r)rrrrr|>szImmutableMultiDict.copycCs|S)Nr)rrrrr}EszImmutableMultiDict.__copy__N)rrQrRr/r|r}rrrrr<>8sr<>c@s(eZdZdZdd<03>Zdd<05>Zdd<07>ZdS) <09>ImmutableOrderedMultiDictzGAn immutable :class:`OrderedMultiDict`.
.. versionadded:: 0.6
cCstt|dd<02><02>S)NT)r)r<>r )rrrrr_Osz)ImmutableOrderedMultiDict._iter_hashitemscCst|<00>S)z<>Return a shallow mutable copy of this object. Keep in mind that
the standard library's :func:`copy` function is a no-op for this class
like for any other python immutable type (eg: :class:`tuple`).
)r<>)rrrrr|RszImmutableOrderedMultiDict.copycCs|S)Nr)rrrrr}Ysz"ImmutableOrderedMultiDict.__copy__N)rrQrRr/r_r|r}rrrrr<>Isr<>c@s<>eZdZdZd"dd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Z dd<10>Z
dd<12>Z dd<14>Z dd<16>Z dd<18>Zdd<1A>Zdd<1C>Zd#dd<1F>Zed d!<21><00>ZdS)$<24>Accepta<74>An :class:`Accept` object is just a list subclass for lists of
``(value, quality)`` tuples. It is automatically sorted by specificity
and quality.
All :class:`Accept` objects work similar to a list but provide extra
functionality for working with the data. Containment checks are
normalized to the rules of that header:
>>> a = CharsetAccept([('ISO-8859-1', 1), ('utf-8', 0.7)])
>>> a.best
'ISO-8859-1'
>>> 'iso-8859-1' in a
True
>>> 'UTF8' in a
True
>>> 'utf7' in a
False
To get the quality for an item you can use normal item lookup:
>>> print a['utf-8']
0.7
>>> a['utf7']
0
.. versionchanged:: 0.5
:class:`Accept` objects are forced immutable now.
rcsf|dkrt<00><01><00>d<01>_nHt|t<04>r:|j<02>_t<00><01>|<01>n(d<02>_t|<01>fdd<04>dd<05>}t<00><01>|<01>dS)NFTcs<00><00>|d<00>|d|dfS)Nrr)<01> _specificity)r&)rrrr'<00>r(z!Accept.__init__.<locals>.<lambda>)r#rN)r rZ<00>providedrr<><00>sorted)rr<>r)rrrZ|s


zAccept.__init__cCs
|dkfS)z3Returns a tuple describing the value's specificity.<2E>*r)rr$rrrr<><00>szAccept._specificitycCs|dkp|<02><00>|<01><00>kS)z-Check if a value matches a given accept item.r)r<>)rr$r"rrr<00>_value_matches<65>szAccept._value_matchescCs t|t<01>r|<00>|<01>St<03>||<01>S)z<>Besides index lookup (getting item n) you can also pass it a string
to get the quality for the item. If the item is not in the list, the
returned quality is ``0``.
)rr<00>qualityr r<>)rr#rrrr<><00>s

zAccept.__getitem__cCs&x |D]\}}|<00>||<02>r|SqWdS)z<>Returns the quality of the key.
.. versionadded:: 0.6
In previous versions you had to use the item-lookup syntax
(eg: ``obj[key]`` instead of ``obj.quality(key)``)
r)r)rr#r"rrrrr<00>s zAccept.qualitycCs&x |D]\}}|<00>||<02>rdSqWdS)NTF)r)rr$r"<00>_qualityrrrr<><00>s zAccept.__contains__cCs d|jjd<02>dd<04>|D<00><01>fS)Nz%s([%s])z, css|]\}}d||fVqdS)z(%r, %s)Nr)r<>r&<00>yrrrr<><00>sz"Accept.__repr__.<locals>.<genexpr>)rrr<>)rrrrrV<00>szAccept.__repr__cCsHt|t<01>r<x(t|<00>D]\}\}}|<00>||<03>r|SqWt|<01><01>t<05>||<01>S)z<>Get the position of an entry or raise :exc:`ValueError`.
:param key: The key to be looked up.
.. versionchanged:: 0.5
This used to raise :exc:`IndexError`, which was inconsistent
with the list API.
)rrr<>rryr rL)rr#r<>r"rrrrrL<00>s
 z Accept.indexcCs$y
|<00>|<01>Stk
rdSXdS)zaGet the position of an entry or return -1.
:param key: The key to be looked up.
rKN)rLry)rr#rrr<00>find<6E>s
z Accept.findccsx|D]}|dVqWdS)zIterate over all values.rNr)rr"rrrr<><00>s
z Accept.valuescCs>g}x.|D]&\}}|dkr&d||f}|<01>|<02>q
Wd<03>|<01>S)z2Convert the header set into an HTTP header string.rz%s;q=%s<>,)rFr<>)rr<>r$rrrr<00> to_header<65>s  zAccept.to_headercCs|<00><00>S)N)r)rrrrr<><00>szAccept.__str__cCs*x$|D]\}}|<00>||<02>r||fSqWdS)N)r)r<00>match<63> client_itemrrrr<00>_best_single_match<63>s zAccept._best_single_matchNc Csn|}d}d}x\|D]T}|<00>|<06>}|s&q|\}} |<00>|<08>}
| dks| |krJq| |ksZ|
|kr|}| }|
}qW|S)aVReturns the best match from a list of possible matches based
on the specificity and quality of the client. If two items have the
same quality and specificity, the one is returned that comes first.
:param matches: a list of matches to check for
:param default: the value that is returned if none match
rK)rKr)r r<>) r<00>matchesrar<>Z best_qualityZbest_specificityZ server_itemr r
rZ specificityrrr<00>
best_match<EFBFBD>s 


zAccept.best_matchcCs|r|ddSdS)zThe best match as value.rNr)rrrr<00>bestsz Accept.best)r)N)rrQrRr/rZr<>rr<>rr<>rVrLrr<>rr<>r r <00>propertyrrrrrr<>]s 
  
 
r<>c@sDeZdZdZdd<03>Zdd<05>Zedd<07><00>Zedd <09><00>Zed
d <0B><00>Z d S) <0A>
MIMEAcceptzRLike :class:`Accept` but with special methods and behavior for
mimetypes.
cCstdd<02>|<01>dd<04>D<00><01>S)Ncss|]}|dkVqdS)rNr)r<>r&rrrr<> sz*MIMEAccept._specificity.<locals>.<genexpr><3E>/r)r<00>split)rr$rrrr<> szMIMEAccept._specificitycCs<>dd<02>}d|krtd|<00><01>||<01>\}}|dkrD|dkrDtd|<00><01>d|krPdS||<02>\}}|dkrp|dkrpdS||ko<>dknp<>||ko<>dknp<>||ko<>|dkp<>|dkp<>||kS)NcSs |<00><00>}|dkrdS|<00>dd<04>S)Nr)rrrr)r<>r)r&rrr<00>
_normalizesz-MIMEAccept._value_matches.<locals>._normalizerzinvalid mimetype %rrF)ry)rr$r"rZ
value_typeZ value_subtypeZ item_typeZ item_subtyperrrrs     0zMIMEAccept._value_matchescCsd|kpd|kp|jS)z!True if this object accepts HTML.z text/htmlzapplication/xhtml+xml)<01> accept_xhtml)rrrr<00> accept_html,szMIMEAccept.accept_htmlcCsd|kpd|kS)z"True if this object accepts XHTML.zapplication/xhtml+xmlzapplication/xmlr)rrrrr3szMIMEAccept.accept_xhtmlcCsd|kS)z!True if this object accepts JSON.zapplication/jsonr)rrrr<00> accept_json8szMIMEAccept.accept_jsonN)
rrQrRr/r<>rrrrrrrrrrs   rc@seZdZdZdd<03>ZdS)<05>LanguageAcceptz:Like :class:`Accept` but with normalization for languages.cCs dd<02>}|dkp||<01>||<02>kS)NcSst<00>|<00><02><00>S)N)<03>_locale_delim_rerr<>)<01>languagerrrrBsz1LanguageAccept._value_matches.<locals>._normalizerr)rr$r"rrrrrAszLanguageAccept._value_matchesN)rrQrRr/rrrrrr>src@seZdZdZdd<03>ZdS)<05> CharsetAcceptz9Like :class:`Accept` but with normalization for charsets.cCs dd<02>}|dkp||<01>||<02>kS)NcSs*y t<00>|<00>jStk
r$|<00><04>SXdS)N)<05>codecs<63>lookupr,<00> LookupErrorr<72>)r,rrrrLs z0CharsetAccept._value_matches.<locals>._normalizerr)rr$r"rrrrrKszCharsetAccept._value_matchesN)rrQrRr/rrrrrrHsrcs0t<00><00><01>fdd<02><08><01>fdd<02><08>fdd<02>d<05><00>S)z|Return a new property object for a cache header. Useful if you
want to add support for a cache extension in a subclass.cs|<00><00><01><00><02>S)N)<01>_get_cache_value)r&)<03>emptyr#r?rrr'Yr(z cache_property.<locals>.<lambda>cs|<00><00>|<01><01>S)N)<01>_set_cache_value)r&r<>)r#r?rrr'Zr(cs
|<00><00><00>S)N)<01>_del_cache_value)r&)r#rrr'[r(zaccessor for %r)r)r#rr?r)rr#r?r<00>cache_propertyUs
 
r"c@szeZdZdZeddd<04>Zedde<06>Zedde<08>Z eddd<04>Z
dd
d <0B>Z d d <0A>Z dd<0F>Z dd<11>Zdd<13>Zdd<15>Zdd<17>ZdS)<19> _CacheControlaVSubclass of a dict that stores values for a Cache-Control header. It
has accessors for all the cache-control directives specified in RFC 2616.
The class does not differentiate between request and response directives.
Because the cache-control directives in the HTTP header use dashes the
python descriptors use underscores for that.
To get a header of the :class:`CacheControl` object again you can convert
the object into a string or call the :meth:`to_header` method. If you plan
to subclass it and add your own items have a look at the sourcecode for
that class.
.. versionchanged:: 0.4
Setting `no_cache` or `private` to boolean `True` will set the implicit
none-value which is ``*``:
>>> cc = ResponseCacheControl()
>>> cc.no_cache = True
>>> cc
<ResponseCacheControl 'no-cache'>
>>> cc.no_cache
'*'
>>> cc.no_cache = None
>>> cc
<ResponseCacheControl ''>
In versions before 0.5 the behavior documented here affected the now
no longer existing `CacheControl` class.
zno-cacherNzno-storezmax-agerKz no-transformrcCs$t<00>||p d<01>||_|dk |_dS)Nr)rrZrsr<>)rr<>rsrrrrZ<00>sz_CacheControl.__init__cCs^|tkr||kS||krZ||}|dkr,|S|dk rVy ||<04>}Wntk
rTYnX|SdS)z+Used internally by the accessor properties.N)<02>boolry)rr#rr?r$rrrr<00>s z_CacheControl._get_cache_valuecCsV|tkr$|rd||<qR|<00>|d<01>n.|dkr8|<00>|<01>n|dkrJd||<n|||<dS)z+Used internally by the accessor properties.NT)r$rM)rr#r$r?rrrr <00>s
 
z_CacheControl._set_cache_valuecCs||kr||=dS)z+Used internally by the accessor properties.Nr)rr#rrrr!<00>sz_CacheControl._del_cache_valuecCst|<00>S)z6Convert the stored values into a cache control header.)<01> dump_header)rrrrr<00>sz_CacheControl.to_headercCs|<00><00>S)N)r)rrrrr<><00>sz_CacheControl.__str__cCs(d|jjd<02>dd<04>t|<00><04><00>D<00><01>fS)Nz<%s %s><3E> css|]\}}d||fVqdS)z%s=%rNr)r<>r<>r<>rrrr<><00>sz)_CacheControl.__repr__.<locals>.<genexpr>)rrr<>rr<>)rrrrrV<00>sz_CacheControl.__repr__)rN)rrQrRr/r"<00>no_cacher$<00>no_store<72>intZmax_age<67> no_transformrZrr r!rr<>rVrrrrr#`s    
r#c@s@eZdZdZedde<05>Zedde<05>Zeddd<06>Zedde <09>Z
dS)<08>RequestCacheControla A cache control for requests. This is immutable and gives access
to all the request-relevant cache control headers.
To get a header of the :class:`RequestCacheControl` object again you can
convert the object into a string or call the :meth:`to_header` method. If
you plan to subclass it and add your own items have a look at the sourcecode
for that class.
.. versionadded:: 0.5
In previous versions a `CacheControl` class existed that was used
both for request and response.
z max-stalerz min-freshz no-transformNzonly-if-cached) rrQrRr/r"r)Z max_stale<6C> min_freshr*r$Zonly_if_cachedrrrrr+<00>s
    r+c@sLeZdZdZedde<05>Zeddd<03>Zedde<05>Zedde<05>Z eddd<03>Z
dS) <09>ResponseCacheControla*A cache control for responses. Unlike :class:`RequestCacheControl`
this is mutable and gives access to response-relevant cache control
headers.
To get a header of the :class:`ResponseCacheControl` object again you can
convert the object into a string or call the :meth:`to_header` method. If
you plan to subclass it and add your own items have a look at the sourcecode
for that class.
.. versionadded:: 0.5
In previous versions a `CacheControl` class existed that was used
both for request and response.
<20>publicN<63>privaterzmust-revalidatezproxy-revalidatezs-maxage) rrQrRr/r"r$r.r/Zmust_revalidateZproxy_revalidateZs_maxagerrrrr-<00>s      r-c@s"eZdZdZddd<04>Zdd<06>ZdS)<08> CallbackDictzwA dict that calls a function passed every time something is changed.
The function is passed the dict instance.
NcCst<00>||p d<01>||_dS)Nr)rrZrs)r<00>initialrsrrrrZ<00>szCallbackDict.__init__cCsd|jjt<02>|<00>fS)Nz<%s %s>)rrrrV)rrrrrV<00>szCallbackDict.__repr__)NN)rrQrRr/rZrVrrrrr0<00>s
r0c@s<>eZdZdZd*dd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Z dd<10>Z
dd<12>Z d+dd<15>Z dd<17>Z dd<19>Zdd<1B>Zdd<1D>Zdd<1F>Zd d!<21>Zd"d#<23>Zd$d%<25>Zd&d'<27>Zd(d)<29>ZdS),<2C> HeaderSeta<74>Similar to the :class:`ETags` class this implements a set-like structure.
Unlike :class:`ETags` this is case insensitive and used for vary, allow, and
content-language headers.
If not constructed using the :func:`parse_set_header` function the
instantiation works like this:
>>> hs = HeaderSet(['foo', 'bar', 'baz'])
>>> hs
HeaderSet(['foo', 'bar', 'baz'])
NcCs.t|pd<01>|_tdd<03>|jD<00><01>|_||_dS)NrcSsg|] }|<01><00><00>qSr)r<>)r<>r&rrrr<>sz&HeaderSet.__init__.<locals>.<listcomp>)r <00>_headersr<73><00>_setrs)r<00>headersrsrrrrZszHeaderSet.__init__cCs|<00>|f<01>dS)zAdd a new header to the set.N)re)r<00>headerrrrrk sz HeaderSet.addcCsl|<01><00>}||jkrt|<01><01>|j<01>|<02>x,t|j<05>D]\}}|<02><00>|kr2|j|=Pq2W|jdk rh|<00>|<00>dS)aCRemove a header from the set. This raises an :exc:`KeyError` if the
header is not in the set.
.. versionchanged:: 0.5
In older versions a :exc:`IndexError` was raised instead of a
:exc:`KeyError` if the object was missing.
:param header: the header to be removed.
N)r<>r4rxrTr<>r3rs)rr6r#r<>rrrrT s

  
zHeaderSet.removecCs\d}x:|D]2}|<03><00>}||jkr
|j<02>|<03>|j<01>|<04>d}q
W|rX|jdk rX|<00>|<00>dS)z<>Add all the headers from the iterable to the set.
:param iterable: updates the set with the items from the iterable.
FTN)r<>r4r3rFrkrs)rrGZ inserted_anyr6r#rrrre"s

  zHeaderSet.updatecCs$y
|<00>|<01>Stk
rYnXdS)zdLike :meth:`remove` but ignores errors.
:param header: the header to be discarded.
N)rTrx)rr6rrr<00>discard1s
zHeaderSet.discardcCs4|<01><00>}x&t|j<02>D]\}}|<03><00>|kr|SqWdS)z<>Return the index of the header in the set or return -1 if not found.
:param header: the header to be looked up.
rK)r<>r<>r3)rr6r<>r"rrrr;s
 zHeaderSet.findcCs|<00>|<01>}|dkrt|<01><01>|S)z<>Return the index of the header in the set or raise an
:exc:`IndexError`.
:param header: the header to be looked up.
r)r<00>
IndexError)rr6r=rrrrLFs
zHeaderSet.indexcCs.|j<00><01>|jdd<01>=|jdk r*|<00>|<00>dS)zClear the set.N)r4rgr3rs)rrrrrgQs
 
zHeaderSet.clearFcCs|rt|j<01>St|j<02>S)a<>Return the set as real python set type. When calling this, all
the items are converted to lowercase and the ordering is lost.
:param preserve_casing: if set to `True` the items in the set returned
will have the original case like in the
:class:`HeaderSet`, otherwise they will
be lowercase.
)r<>r3r4)rZpreserve_casingrrr<00>as_setXs 
zHeaderSet.as_setcCsd<01>tt|j<03><02>S)z2Convert the header set into an HTTP header string.z, )r<><00>map<61>quote_header_valuer3)rrrrreszHeaderSet.to_headercCs
|j|S)N)r3)rr<>rrrr<>iszHeaderSet.__getitem__cCs4|j<00>|<01>}|j<02>|<02><04><00>|jdk r0|<00>|<00>dS)N)r3rMr4rTr<>rs)rr<>r=rrrrBls 
zHeaderSet.__delitem__cCsL|j|}|j<01>|<03><03><00>||j|<|j<01>|<02><03><00>|jdk rH|<00>|<00>dS)N)r3r4rTr<>rkrs)rr<>r$<00>oldrrrrErs 


zHeaderSet.__setitem__cCs|<01><00>|jkS)N)r<>r4)rr6rrrr<>zszHeaderSet.__contains__cCs
t|j<01>S)N)r<>r4)rrrrr<>}szHeaderSet.__len__cCs
t|j<01>S)N)r<>r3)rrrrr<><00>szHeaderSet.__iter__cCs
t|j<01>S)N)r$r4)rrrr<00> __nonzero__<5F>szHeaderSet.__nonzero__cCs|<00><00>S)N)r)rrrrr<><00>szHeaderSet.__str__cCsd|jj|jfS)Nz%s(%r))rrr3)rrrrrV<00>szHeaderSet.__repr__)NN)F)rrQrRr/rZrkrTrer7rrLrgr9rr<>rBrEr<>r<>r<>r=r<>rVrrrrr2<00>s( 

  
r2c@s<>eZdZdZd dd<05>Zd!dd<07>Zdd <09>Zd
d <0B>Zd d <0A>Zdd<0F>Z dd<11>Z
dd<13>Z d"dd<15>Z dd<17>Z e Zdd<19>Zdd<1B>Zdd<1D>Zdd<1F>ZdS)#<23>ETagszYA set that can be used to check if one etag is present in a collection
of etags.
NFcCs,t| r |pd<01>|_t|pd<01>|_||_dS)Nr)r`<00>_strong<6E>_weak<61>star_tag)rZ strong_etagsZ
weak_etagsrArrrrZ<00>szETags.__init__cCst|j<01>}|r|<02>|j<03>|S)zoConvert the `ETags` object into a python set. Per default all the
weak etags are not part of this set.)r<>r?rer@)r<00> include_weakr=rrrr9<00>s
 z ETags.as_setcCs
||jkS)zCheck if an etag is weak.)r@)r<00>etagrrr<00>is_weak<61>sz ETags.is_weakcCs
||jkS)zCheck if an etag is strong.)r?)rrCrrr<00> is_strong<6E>szETags.is_strongcCs|<00>|<01>p|<00>|<01>S)zCCheck if an etag is part of the set including weak and strong tags.)rD<00>contains)rrCrrr<00> contains_weak<61>szETags.contains_weakcCs|jr
dS|<00>|<01>S)zxCheck if an etag is part of the set ignoring weak tags.
It is also possible to use the ``in`` operator.
T)rArE)rrCrrrrF<00>szETags.containscCs$t|<01>\}}|r|<00>|<01>S|<00>|<01>S)z<>When passed a quoted tag it will check if this tag is part of the
set. If the tag is weak it is checked against weak and strong tags,
otherwise strong only.)<03> unquote_etagrGrF)rrCZweakrrr<00> contains_raw<61>s 
zETags.contains_rawcCs0|jr
dSd<02>dd<04>|jD<00>dd<04>|jD<00><00>S)z0Convert the etags set into a HTTP header string.rz, cSsg|] }d|<00>qS)z"%s"r)r<>r&rrrr<><00>sz#ETags.to_header.<locals>.<listcomp>cSsg|] }d|<00>qS)zW/"%s"r)r<>r&rrrr<><00>s)rAr<>r?r@)rrrrr<00>szETags.to_headercCsF||g<02>d<00>dkrtd<02><01>|dkr*t|<02>}|r<||jkr<dS||jkS)Nrz-either tag or data required, but at least oneT)<05>countr<00> generate_etagr@r?)rrC<00>datarBrrr<00>__call__<5F>s
zETags.__call__cCst|jp|jp|j<03>S)N)r$rAr?r@)rrrr<00>__bool__<5F>szETags.__bool__cCs|<00><00>S)N)r)rrrrr<><00>sz ETags.__str__cCs
t|j<01>S)N)r<>r?)rrrrr<><00>szETags.__iter__cCs
|<00>|<01>S)N)rF)rrCrrrr<><00>szETags.__contains__cCsd|jjt|<00>fS)Nz<%s %r>)rr<00>str)rrrrrV<00>szETags.__repr__)NNF)F)NNF)rrQrRr/rZr9rDrErGrFrIrrMrNr=r<>r<>r<>rVrrrrr><00>s 

 
r>c@s2eZdZdZd dd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>ZdS) <0C>IfRangez<65>Very simple object that represents the `If-Range` header in parsed
form. It will either have neither a etag or date or one of either but
never both.
.. versionadded:: 0.7
NcCs||_||_dS)N)rC<00>date)rrCrQrrrrZ<00>szIfRange.__init__cCs,|jdk rt|j<00>S|jdk r(t|j<02>SdS)z-Converts the object back into an HTTP header.N<>)rQ<00> http_daterC<00>
quote_etag)rrrrr<00>s




zIfRange.to_headercCs|<00><00>S)N)r)rrrrr<><00>szIfRange.__str__cCsd|jjt|<00>fS)Nz<%s %r>)rrrO)rrrrrV<00>szIfRange.__repr__)NN)rrQrRr/rZrr<>rVrrrrrP<00>s

rPc@sHeZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z dd<0F>Z
dS)<11>RangeaXRepresents a ``Range`` header. All methods only support only
bytes as the unit. Stores a list of ranges if given, but the methods
only work if only one range is provided.
:raise ValueError: If the ranges provided are invalid.
.. versionchanged:: 0.15
The ranges passed in are validated.
.. versionadded:: 0.7
cCsT||_||_xB|D]:\}}|dks:|dk r|dks:||krtd<02>||f<02><01><01>qWdS)Nrz{} is not a valid range.)<04>units<74>rangesry<00>format)rrVrW<00>start<72>endrrrrZ s
 zRange.__init__cCsl|jdks |dks t|j<02>dkr$dS|jd\}}|dkrN|}|dkrN||7}t|||<01>rh|t||<01>fSdS)z<>If the range is for bytes, the length is not None and there is
exactly one range and it is satisfiable it returns a ``(start, stop)``
tuple, otherwise `None`.
r<>Nrr)rVr<>rW<00>is_byte_range_valid<69>min)r<00>lengthrYrZrrr<00>range_for_length s  zRange.range_for_lengthcCs.|<00>|<01>}|dk r*t|j|d|d|<01>SdS)z<>Creates a :class:`~werkzeug.datastructures.ContentRange` object
from the current range and given content length.
Nrr)r^<00> ContentRangerV)rr]<00>rngrrr<00>make_content_range% s
zRange.make_content_rangecCsjg}xP|jD]F\}}|dkr<|<01>|dkr0d|nt|<02><01>q |<01>d||df<00>q Wd|jd<07>|<01>fS)z-Converts the object back into an HTTP header.Nrz%s-z%s-%srz%s=%sr)rWrFrOrVr<>)rrW<00>beginrZrrrr- s  zRange.to_headercCs4|<00>|<01>}|dk r0d|j|d|dd|fSdS)z\Converts the object into `Content-Range` HTTP header,
based on given length
Nz %s %d-%d/%drr)r^rV)rr]r^rrr<00>to_content_range_header7 s

zRange.to_content_range_headercCs|<00><00>S)N)r)rrrrr<>E sz Range.__str__cCsd|jjt|<00>fS)Nz<%s %r>)rrrO)rrrrrVH szRange.__repr__N) rrQrRr/rZr^rarrcr<>rVrrrrrU<00>s  
rUc@szeZdZdZddd<04>Zdd<06>Zed<07>Zed<08>Zed <09>Zed
<EFBFBD>Z [dd d <0A>Z
dd<0F>Z dd<11>Z dd<13>Z e Zdd<15>Zdd<17>ZdS)r_zDRepresents the content range header.
.. versionadded:: 0.7
NcCs.t|||<04>std<01><01>||_|<00>||||<01>dS)NzBad range provided)r[<00>AssertionErrorrsr<>)rrVrY<00>stopr]rsrrrrZR szContentRange.__init__cs"<00>fdd<02>}<01>fdd<04>}t||<02>S)Ncs
t|<00><00>S)N)r5)r)r,rr<00>fgetX sz-ContentRange._callback_property.<locals>.fgetcs$t|<00>|<01>|jdk r |<00>|<00>dS)N)r0rs)rr$)r,rr<00>fset[ s 
z-ContentRange._callback_property.<locals>.fset)r)r,rfrgr)r,r<00>_callback_propertyW s  zContentRange._callback_property<74>_units<74>_start<72>_stop<6F>_lengthr<68>cCsDt|||<03>std<01><01>||_||_||_||_|jdk r@|<00>|<00>dS)z#Simple method to update the ranges.zBad range providedN)r[rdrirjrkrlrs)rrYrer]rVrrrr<>m s
zContentRange.setcCs|jdddd<02>dS)zcSets the units to `None` which indicates that the header should
no longer be used.
N)rV)r<>)rrrr<00>unsetw szContentRange.unsetcCsV|jdkrdS|jdkrd}n|j}|jdkr<d|j|fSd|j|j|jd|fS)NrRrz%s */%sz %s %s-%s/%sr)rVr]rYre)rr]rrrr} s


zContentRange.to_headercCs
|jdk S)N)rV)rrrrr=<00> szContentRange.__nonzero__cCs|<00><00>S)N)r)rrrrr<><00> szContentRange.__str__cCsd|jjt|<00>fS)Nz<%s %r>)rrrO)rrrrrV<00> szContentRange.__repr__)NN)Nr<4E>)rrQrRr/rZrhrVrYrer]r<>rmrr=rNr<>rVrrrrr_L s
 
 r_c@s<>eZdZdZddd<04>Zedd<06>dd<08>Zed d<06>d
d<08>Zed d<06>d d<08>Zed d<06>dd<08>Z edd<06>dd<08>Z
edd<06>dd<08>Z edd<06>dd<08>Z edd<06>dd<08>Z edd<06>dd<08>Zedd<06>dd<08>ZdS)<1C> Authorizationa<6E>Represents an `Authorization` header sent by the client. You should
not create this kind of object yourself but use it when it's returned by
the `parse_authorization_header` function.
This object is a dict subclass and can be altered by setting dict items
but it should be considered immutable as it's returned by the client and
not meant for modifications.
.. versionchanged:: 0.5
This object became immutable.
NcCst<00>||p i<00>||_dS)N)rrZr?)r<00> auth_typerLrrrrZ<00> szAuthorization.__init__cCs
|<00>d<01>S)N<>username)rz)rrrrr'<00> r(zAuthorization.<lambda>zd
The username transmitted. This is set for both basic and digest
auth all the time.)<01>doccCs
|<00>d<01>S)N<>password)rz)rrrrr'<00> r(zs
When the authentication type is basic this is the password
transmitted by the client, else `None`.cCs
|<00>d<01>S)N<>realm)rz)rrrrr'<00> r(zA
This is the server realm sent back for HTTP digest auth.cCs
|<00>d<01>S)N<>nonce)rz)rrrrr'<00> r(z<>
The nonce the server sent for digest auth, sent back by the client.
A nonce should be unique for every 401 response for HTTP digest
auth.cCs
|<00>d<01>S)N<>uri)rz)rrrrr'<00> r(z<>
The URI from Request-URI of the Request-Line; duplicated because
proxies are allowed to change the Request-Line in transit. HTTP
digest auth only.cCs
|<00>d<01>S)N<>nc)rz)rrrrr'<00> r(zz
The nonce count value transmitted by clients if a qop-header is
also transmitted. HTTP digest auth only.cCs
|<00>d<01>S)N<>cnonce)rz)rrrrr'<00> r(z<>
If the server sent a qop-header in the ``WWW-Authenticate``
header, the client has to provide this value for HTTP digest auth.
See the RFC for more details.cCs
|<00>d<01>S)N<>response)rz)rrrrr'<00> r(z<>
A string of 32 hex digits computed as defined in RFC 2617, which
proves that the user knows a password. Digest auth only.cCs
|<00>d<01>S)N<>opaque)rz)rrrrr'<00> r(z<>
The opaque header from the server returned unchanged by the client.
It is recommended that this string be base64 or hexadecimal data.
Digest auth only.cCs
|<00>d<01>S)N<>qop)rz)rrrrr'<00> r(z<>
Indicates what "quality of protection" the client has applied to
the message for HTTP digest auth. Note that this is a single token,
not a quoted list of alternatives as in WWW-Authenticate.)N)rrQrRr/rZrrprrrsrtrurvrwrxryrzrrrrrn<00> s@ 
rnc@s<>eZdZdZedddddg<05>Zd(dd <09>Zd)d d <0C>Zd*dd<10>Zdd<12>Z dd<14>Z
dd<16>Z d+dd<18>Z d,dd<1A>Z e ddd<1D>Ze ddd<1D>Ze ddd<1D>Ze dd d<1D>Ze dd!d<1D>Ze d"d#d<1D>Ze dd$d<1D>Zed%d&<26><00>Zejd'd&<26><00>Zee <0C>Z [ dS)-<2D>WWWAuthenticatez5Provides simple access to `WWW-Authenticate` headers.<2E>domainrtryrsrzNcCs&t<00>||p d<01>|r||d<||_dS)Nr<00> __auth_type__)rrZrs)rror<>rsrrrrZ<00> szWWWAuthenticate.__init__<5F>authentication requiredcCs0t<00>|<00>t<00>|d|d<02><02>|jr,|<00>|<00>dS)z*Clear the auth info and enable basic auth.<2E>basic)r}rsN)rrgrers)rrsrrr<00> set_basic<69> s
zWWWAuthenticate.set_basic<69><01>authFcCshd||t|<03>d<02>}|rd|d<|dk r.||d<|dk r>||d<t<01>|<00>t<01>||<07>|jrd|<00>|<00>dS)z+Clear the auth info and enable digest auth.<2E>digest)r}rsrtrz<00>TRUE<55>staleNry<00> algorithm)r%rrgrers)rrsrtrzryr<>r<>r<>rrr<00>
set_digest<EFBFBD> s 
 zWWWAuthenticate.set_digestcs@t<00><00>}|<01>dd<02>pd}d|<02><02>d<05><03>fdd<07>t|<01>D<00><01>fS)z9Convert the stored values into a WWW-Authenticate header.r}Nrz%s %sz, cs*g|]"\}}d|t||<01>jkd<01>f<00>qS)z%s=%s)Z allow_token)r;<00>_require_quoting)r<>r#r$)rrrr<>
sz-WWWAuthenticate.to_header.<locals>.<listcomp>)rrMr<>r<>r )rr<>ror)rrr
s
zWWWAuthenticate.to_headercCs|<00><00>S)N)r)rrrrr<>#
szWWWAuthenticate.__str__cCsd|jj|<00><02>fS)Nz<%s %r>)rrr)rrrrrV&
szWWWAuthenticate.__repr__cs"<00>fdd<02>}t<00>fdd<04>||d<05>S)auA static helper function for subclasses to add extra authentication
system properties onto a class::
class FooAuthenticate(WWWAuthenticate):
special_realm = auth_property('special_realm')
For more information have a look at the sourcecode to see how the
regular properties (:attr:`realm` etc.) are implemented.
cs&|dkr|<00><00>d<00>n t|<01>|<00><dS)N)rMrO)rr$)r,rr<00>
_set_value4
sz1WWWAuthenticate.auth_property.<locals>._set_valuecs
|<00><00><00>S)N)rz)r&)r,rrr':
r(z/WWWAuthenticate.auth_property.<locals>.<lambda>)rq)r)r,rqr<>r)r,r<00> auth_property)
s zWWWAuthenticate.auth_propertycs<00>fdd<02>}t||d<03>S)Ncs<00><01>fdd<02>}t<00><00><01><01>|<01>S)Ncs(|s<14><00>kr<14><01>=n|r$|<00><00><00><01><dS)N)r)Z
header_set)r,rrrrs>
s z>WWWAuthenticate._set_property.<locals>.fget.<locals>.on_update)<02>parse_set_headerrz)rrs)r,)rrrf=
sz+WWWAuthenticate._set_property.<locals>.fget)rq)r)r,rqrfr)r,r<00> _set_property<
s zWWWAuthenticate._set_propertyr}zZThe type of the auth mechanism. HTTP currently specifies
``Basic`` and ``Digest``.)rqaA string to be displayed to users so they know which
username and password to use. This string should contain at
least the name of the host performing the authentication and
might additionally indicate the collection of users who might
have access.z<>A list of URIs that define the protection space. If a URI
is an absolute path, it is relative to the canonical root URL of
the server being accessed.z<>
A server-specified data string which should be uniquely generated
each time a 401 response is made. It is recommended that this
string be base64 or hexadecimal data.aA string of data, specified by the server, which should
be returned by the client unchanged in the Authorization header
of subsequent requests with URIs in the same protection space.
It is recommended that this string be base64 or hexadecimal
data.r<>a A string indicating a pair of algorithms used to produce
the digest and a checksum. If this is not present it is assumed
to be "MD5". If the algorithm is not understood, the challenge
should be ignored (and a different one used, if there is more
than one).zIA set of quality-of-privacy directives such as auth and
auth-int.cCs"|<00>d<01>}|dk r|<01><01>dkSdS)z}A flag, indicating that the previous request from the client
was rejected because the nonce value was stale.
r<>N<>true)rzr<>)r<00>valrrrr<>x
s
zWWWAuthenticate.stalecCs*|dkr|<00>dd<00>n|rdnd|d<dS)Nr<4E>r<><00>FALSE)rM)rr$rrrr<><00>
s)NNN)r~)r<>NNF)N)N)rrQrRr/r`r<>rZr<>r<>rr<>rVr<>r<>r?rsr|rtryr<>rzrr<><00>setter<65> staticmethodrrrrr{<00> sF




 r{c@s<>eZdZdZddd<04>Zdd<06>Zedd<08><00>Zed d
<EFBFBD><00>Zed d <0C><00>Z ed d<0E><00>Z
ddd<11>Z dd<13>Z dd<15>Z e Zdd<17>Zdd<19>Zdd<1B>ZdS)r<>a@The :class:`FileStorage` class is a thin wrapper over incoming files.
It is used by the request object to represent uploaded files. All the
attributes of the wrapper stream are proxied by the file storage so
it's possible to do ``storage.read()`` instead of the long form
``storage.stream.read()``.
NcCs<>||_|pt<01>|_|dkrrt|dd<00>}t|<02>}|rV|d|d<03>krV|d|d<05>krVd}tsrt|t<07>rr|<02>t <09>d<06>}||_
|dkr<>t <0B>}||_ |dk r<>||d<|dk r<>t |<05>|d<dS) Nr,r<00><rK<00>>r<>z Content-TypezContent-Length)r,r<00>streamr5r rrr<>r<>rr<>r<>r5rO)rr<>r<>r,r<><00>content_lengthr5<00>srrrrZ<00>
s"   $zFileStorage.__init__cCst|d<01>st|j<02>|_dS)N<>_parsed_content_type)<04>hasattr<74>parse_options_headerr<72>r<>)rrrr<00>_parse_content_type<70>
s
zFileStorage._parse_content_typecCs |j<00>d<01>S)z;The content-type sent in the header. Usually not availablez content-type)r5rz)rrrrr<><00>
szFileStorage.content_typecCst|j<01>d<01>pd<02>S)z=The content-length sent in the header. Usually not availablezcontent-lengthr)r)r5rz)rrrrr<><00>
szFileStorage.content_lengthcCs|<00><00>|jd<00><02>S)aLike :attr:`content_type`, but without parameters (eg, without
charset, type etc.) and always lowercase. For example if the content
type is ``text/HTML; charset=utf-8`` the mimetype would be
``'text/html'``.
.. versionadded:: 0.7
r)r<>r<>r<>)rrrr<00>mimetype<70>
s zFileStorage.mimetypecCs|<00><00>|jdS)z<>The mimetype parameters as dict. For example if the content
type is ``text/html; charset=utf-8`` the params would be
``{'charset': 'utf-8'}``.
.. versionadded:: 0.7
r)r<>r<>)rrrr<00>mimetype_params<6D>
szFileStorage.mimetype_params<6D>@cCsNddlm}d}t|t<03>r(t|d<04>}d}z||j||<02>Wd|rH|<01><06>XdS)a{Save the file to a destination path or file object. If the
destination is a file object you have to close it yourself after the
call. The buffer size is the number of bytes held in memory during
the copy process. It defaults to 16KB.
For secure file saving also have a look at :func:`secure_filename`.
:param dst: a filename or open file object the uploaded file
is saved to.
:param buffer_size: the size of the buffer. This works the same as
the `length` parameter of
:func:`shutil.copyfileobj`.
r)<01> copyfileobjF<6A>wbTN)<07>shutilr<6C>rrr<>r<><00>close)r<00>dst<73> buffer_sizer<65>Z close_dstrrr<00>save<76>
s 

zFileStorage.savecCs(y|j<00><01>Wntk
r"YnXdS)z&Close the underlying file if possible.N)r<>r<><00> Exception)rrrrr<><00>
szFileStorage.closecCs
t|j<01>S)N)r$r<>)rrrrr=<00>
szFileStorage.__nonzero__cCsBy t|j|<01>Stk
r<t|jd<01>r6t|jj|<01>S<00>YnXdS)N<>_file)r5r<><00>AttributeErrorr<72>r<>)rr,rrr<00> __getattr__ s   zFileStorage.__getattr__cCs
t|j<01>S)N)r<>r<>)rrrrr<> szFileStorage.__iter__cCsd|jj|j|jfS)Nz <%s: %r (%r)>)rrr<>r<>)rrrrrV szFileStorage.__repr__)NNNNNN)r<>)rrQrRr/rZr<>rr<>r<>r<>r<>r<>r<>r=rNr<>r<>rVrrrrr<><00>
s&
  
 r<>)r%)r<>)rK)rS)r[)r<>)r<>)rT)r;)rH)Xr/rr<><00>rer|r<00> itertoolsrrRr<00>_compatrrrr r
r r r rrrr<00> _internalr<00>
filesystemr<00>compilerrr%r9<00>objectr:r rUrWrjrrrrwr{r)rr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrrr"r#r+r-r<>r0<00>
MutableSetr2<00> Container<65>Iterabler>rPrUr_rnr{r<><00>httpr%r<>rKrSr[r<>r<>rTr;rHrrrr<00><module>
s<>                 
&3 2-)O 1'3
 !*7
  [
 SNHS&