U cf` @sDdZddlmZddlmZmZGdddeZGdddeZd S) zO requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. ) OrderedDict)MappingMutableMappingc@sbeZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS)CaseInsensitiveDictaA case-insensitive ``dict``-like object. Implements all methods and operations of ``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. NcKs&t|_|dkri}|j|f|dSN)r_storeupdate)selfdatakwargsr M/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/requests/structures.py__init__(szCaseInsensitiveDict.__init__cCs||f|j|<dSrrlower)r keyvaluer r r __setitem__.szCaseInsensitiveDict.__setitem__cCs|j|dS)Nrrr rr r r __getitem__3szCaseInsensitiveDict.__getitem__cCs|j|=dSrrrr r r __delitem__6szCaseInsensitiveDict.__delitem__cCsdd|jDS)Ncss|]\}}|VqdSrr ).0casedkey mappedvaluer r r :sz/CaseInsensitiveDict.__iter__..)rvaluesr r r r__iter__9szCaseInsensitiveDict.__iter__cCs t|jSr)lenrrr r r__len__<szCaseInsensitiveDict.__len__cCsdd|jDS)z.Like iteritems(), but with all lowercase keys.css|]\}}||dfVqdS)rNr )rlowerkeykeyvalr r rrAsz2CaseInsensitiveDict.lower_items..)ritemsrr r r lower_items?szCaseInsensitiveDict.lower_itemscCs0t|trt|}ntSt|t|kSr) isinstancerrNotImplementeddictr$)r otherr r r__eq__Cs  zCaseInsensitiveDict.__eq__cCst|jSr)rrrrr r rcopyLszCaseInsensitiveDict.copycCstt|Sr)strr'r#rr r r__repr__OszCaseInsensitiveDict.__repr__)N)__name__ __module__ __qualname____doc__rrrrrr r$r)r*r,r r r rr s  rcs<eZdZdZd fdd ZddZddZd d d ZZS) LookupDictzDictionary lookup object.Ncs||_tdSr)namesuperr)r r2 __class__r rrVszLookupDict.__init__cCsd|jdS)Nz )r2rr r rr,ZszLookupDict.__repr__cCs|j|dSr__dict__getrr r rr]szLookupDict.__getitem__cCs|j||Srr6)r rdefaultr r rr8bszLookupDict.get)N)N) r-r.r/r0rr,rr8 __classcell__r r r4rr1Ss r1N) r0 collectionsrcompatrrrr'r1r r r rs F