ó â¬_Zc@@súddlmZddlmZmZyddlmZWn$ek r`ddd„ƒYZnXyddlmZWn!ek r˜ddl mZnXddl m Z m Z m Z d d gZeƒZd efd „ƒYZd efd „ƒYZd S(i(tabsolute_import(tMappingtMutableMapping(tRLockRcB@seZd„Zd„ZRS(cC@sdS(N((tself((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt __enter__scC@sdS(N((Rtexc_typet exc_valuet traceback((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt__exit__ s(t__name__t __module__RR (((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyRs (t OrderedDicti(titerkeyst itervaluestPY3tRecentlyUsedContainertHTTPHeaderDictcB@sbeZdZeZdd d„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z RS( s‘ Provides a thread-safe dict-like container which maintains up to ``maxsize`` keys while throwing away the least-recently-used keys beyond ``maxsize``. :param maxsize: Maximum number of recent elements to retain. :param dispose_func: Every time an item is evicted from the container, ``dispose_func(value)`` is called. Callback which will get called i cC@s1||_||_|jƒ|_tƒ|_dS(N(t_maxsizet dispose_funct ContainerClst _containerRtlock(RtmaxsizeR((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt__init__+s  cC@s7|j(|jj|ƒ}||j|<|SWdQXdS(N(RRtpop(Rtkeytitem((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt __getitem__2s  cC@s—t}|j]|jj|tƒ}||j|>> headers = HTTPHeaderDict() >>> headers.add('Set-Cookie', 'foo=bar') >>> headers.add('set-cookie', 'baz=quxx') >>> headers['content-length'] = '7' >>> headers['SET-cookie'] 'foo=bar, baz=quxx' >>> headers['Content-Length'] '7' cK@sttt|ƒjƒtƒ|_|dk rZt|tƒrJ|j|ƒqZ|j|ƒn|rp|j|ƒndS(N( tsuperRRR RR0t isinstancet _copy_fromtextend(Rtheaderstkwargs((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR‡s  cC@s*||g|j|jƒ<|j|jƒS(N(Rtlower(RRtval((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR&’scC@s$|j|jƒ}dj|dƒS(Ns, i(RR7tjoin(RRR8((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR–scC@s|j|jƒ=dS(N(RR7(RR((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR'šscC@s|jƒ|jkS(N(R7R(RR((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt __contains__scC@s„t|tƒ r$t|dƒ r$tSt|t|ƒƒsNt|ƒ|ƒ}ntd„|jƒDƒƒtd„|jƒDƒƒkS(NR.cs@s'|]\}}|jƒ|fVqdS(N(R7(t.0tktv((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pys ¥scs@s'|]\}}|jƒ|fVqdS(N(R7(R;R<R=((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pys ¦s(R2RthasattrR"ttypetdictt itermerged(Rtother((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt__eq__ s  cC@s|j|ƒ S(N(RC(RRB((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt__ne__¨scC@s t|jƒS(N(R R(R((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR(±scc@s'x |jjƒD]}|dVqWdS(Ni(RR-(Rtvals((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR*´scC@sGy||}Wn'tk r7||jkr3‚n|SX||=|SdS(s©D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. N(tKeyErrort_HTTPHeaderDict__marker(RRtdefaultR#((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR¹s cC@s#y ||=Wntk rnXdS(N(RF(RR((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pytdiscardÊs  cC@sM|jƒ}||g}|jj||ƒ}||k rI|j|ƒndS(sâAdds a (name, value) pair, doesn't overwrite the value if it already exists. >>> headers = HTTPHeaderDict(foo='bar') >>> headers.add('Foo', 'baz') >>> headers['foo'] 'bar, baz' N(R7Rt setdefaulttappend(RRR8t key_lowertnew_valsRE((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pytaddÐs   cO@s]t|ƒdkr0tdjt|ƒƒƒ‚nt|ƒdkrL|dnd}t|tƒr‘xÈ|jƒD]\}}|j||ƒqnWn›t|tƒrÈx‰|D]}|j|||ƒq§Wndt|dƒrxR|j ƒD]}|j|||ƒqäWn'x$|D]\}}|j||ƒq Wx*|j ƒD]\}}|j||ƒq9WdS(sÀGeneric import function for any type of header-like object. Adapted version of MutableMapping.update in order to insert items with self.add instead of self.__setitem__ is9extend() takes at most 1 positional arguments ({0} given)iR.N(( R t TypeErrortformatR2Rt iteritemsRNRR>R.titems(RtargsR6RBRR8R#((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyR4às" " cC@sKy|j|jƒ}Wn%tk r>||jkr:gS|SX|dSdS(smReturns a list of all the values for the named field. Returns an empty list if the key doesn't exist.iN(RR7RFRG(RRRHRE((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pytgetlistús cC@s#dt|ƒjt|jƒƒfS(Ns%s(%s)(R?R R@RA(R((si/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-W9yz6j/urllib3/urllib3/_collections.pyt__repr__scC@s\xU|D]M}|j|ƒ}t|tƒr:t|ƒ}n|g||j|jƒs    J