VY @sUdZddlZddlmZGdddejZGdddeZdS) zO requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. N) OrderedDictc@seZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS)CaseInsensitiveDictaA case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive:: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. NcKs2t|_|dkri}|j||dS)N)r_storeupdate)selfdatakwargsr 7/tmp/pip-build-04bmskau/requests/requests/structures.py__init__*s  zCaseInsensitiveDict.__init__cCs||f|j|j<sz/CaseInsensitiveDict.__iter__..)rvalues)rr r r __iter__;szCaseInsensitiveDict.__iter__cCs t|jS)N)lenr)rr r r __len__>szCaseInsensitiveDict.__len__cCsdd|jjDS)z.Like iteritems(), but with all lowercase keys.css%|]\}}||dfVqdS)rNr )rlowerkeykeyvalr r r rDsz2CaseInsensitiveDict.lower_items..)ritems)rr r r lower_itemsAs zCaseInsensitiveDict.lower_itemscCsGt|tjr!t|}ntSt|jt|jkS)N) isinstance collectionsMappingrNotImplementeddictr)rotherr r r __eq__IszCaseInsensitiveDict.__eq__cCst|jjS)N)rrr)rr r r copyRszCaseInsensitiveDict.copycCstt|jS)N)strr#r)rr r r __repr__UszCaseInsensitiveDict.__repr__)__name__ __module__ __qualname____doc__r rrrrrrr%r&r(r r r r rs        rcsReZdZdZdfddZddZddZdd d ZS) LookupDictzDictionary lookup object.Ncs ||_tt|jdS)N)namesuperr-r )rr.) __class__r r r \s zLookupDict.__init__cCs d|jS)Nz )r.)rr r r r(`szLookupDict.__repr__cCs|jj|dS)N)__dict__get)rrr r r rcszLookupDict.__getitem__cCs|jj||S)N)r1r2)rrdefaultr r r r2hszLookupDict.get)r)r*r+r,r r(rr2r r )r0r r-Ys   r-)r,r compatrMutableMappingrr#r-r r r r s J