0{Y @swdZddlZddlZddlmZGdddeZGdddejZGdd d e Z dS) zP requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. N)islicec@sFeZdZdZddZddZddZdd Zd S) IteratorProxyzdocstring for IteratorProxycCs ||_dS)N)i)selfrr:/tmp/pip-ok8sy_ze-build/pip/_vendor/requests/structures.py__init__szIteratorProxy.__init__cCs|jS)N)r)rrrr__iter__szIteratorProxy.__iter__cCsjt|jdrt|jSt|jdr;|jjSt|jdrftj|jjjSdS)N__len__lenfileno)hasattrrr osfstatr st_size)rrrrr s   zIteratorProxy.__len__cCsdjt|jd|S)N)joinrr)rnrrrread!szIteratorProxy.readN)__name__ __module__ __qualname____doc__rr r rrrrrrs    rc@seZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS)CaseInsensitiveDicta A 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. NcKs5t|_|dkr!i}n|j||dS)N)dict_storeupdate)rdatakwargsrrrrAs   zCaseInsensitiveDict.__init__cCs||f|j|jSsz/CaseInsensitiveDict.__iter__..)rvalues)rrrrr RszCaseInsensitiveDict.__iter__cCs t|jS)N)r r)rrrrr UszCaseInsensitiveDict.__len__cCsdd|jjDS)z.Like iteritems(), but with all lowercase keys.css%|]\}}||dfVqdS)r#Nr)r&lowerkeykeyvalrrrr)[sz2CaseInsensitiveDict.lower_items..)ritems)rrrr lower_itemsXs zCaseInsensitiveDict.lower_itemscCsGt|tjr!t|}ntSt|jt|jkS)N) isinstance collectionsMappingrNotImplementedrr.)rotherrrr__eq__`szCaseInsensitiveDict.__eq__cCst|jjS)N)rrr*)rrrrcopyiszCaseInsensitiveDict.copycCstt|jS)N)strrr-)rrrr__repr__lszCaseInsensitiveDict.__repr__)rrrrrr"r$r%r r r.r4r5r7rrrrr%s        rcsReZdZdZdfddZddZddZdd d ZS) LookupDictzDictionary lookup object.Ncs ||_tt|jdS)N)namesuperr8r)rr9) __class__rrrrs zLookupDict.__init__cCs d|jS)Nz )r9)rrrrr7vszLookupDict.__repr__cCs|jj|dS)N)__dict__get)rr rrrr$yszLookupDict.__getitem__cCs|jj||S)N)r<r=)rr defaultrrrr=~szLookupDict.get)rrrrrr7r$r=rr)r;rr8os   r8) rrr0 itertoolsrobjectrMutableMappingrrr8rrrr s   J