U v_C@sXddlmZmZmZddlmZzddlmZWn ek rPddl mZYnXddl m Z m Z e rzddl mmZn>zddlmmZWn&ek rddl mmZYnXdddd d d gZz,ed Zeee sed Zeee stWnek rdZYnXdZGdddeZGdddeZddZdd Zdd ZddZ dS))absolute_importdivisionunicode_literals) ModuleType)Mapping) text_typePY3N default_etreeMethodDispatcherisSurrogatePairsurrogatePairToCodepointmoduleFactoryFactorysupports_lone_surrogatesz"\uD800"z u"\uD800"FTc@s,eZdZdZd ddZddZd dd ZdS) r apDict with 2 special properties: On initiation, keys that are lists, sets or tuples are converted to multiple keys so accessing any one of the items in the original list-like object returns the matching value md = MethodDispatcher({("foo", "bar"):"baz"}) md["foo"] == "baz" A default value which can be set through the default attribute. cCsvg}|D]B\}}t|ttttfr<|D]}|||fq&q|||fqt||t|t|kslt d|_ dSN) isinstancelisttuple frozensetsetappenddict__init__lenAssertionErrordefault)selfitems _dictEntriesnamevalueitemrr/builddir/build/BUILDROOT/alt-python38-pip-20.2.4-1.el7.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/html5lib/_utils.pyr9s  zMethodDispatcher.__init__cCst|||jSr)rgetrrkeyrrr" __getitem__EszMethodDispatcher.__getitem__NcCs t||Sr)BoundMethodDispatcher)rinstanceownerrrr"__get__HszMethodDispatcher.__get__)r)N)__name__ __module__ __qualname____doc__rr&r*rrrr"r ,s c@s@eZdZdZddZddZddZdd Zd d Zd d Z dS)r'zAWraps a MethodDispatcher, binding its return values to `instance`cCs||_||_dSr)r( dispatcher)rr(r/rrr"rNszBoundMethodDispatcher.__init__cCs|j||jSr)r/r*r(r$rrr"r&Rsz!BoundMethodDispatcher.__getitem__cCs||jkr||S|SdSrr/)rr%rrrr"r#Ws zBoundMethodDispatcher.getcCs t|jSr)iterr/rrrr"__iter__]szBoundMethodDispatcher.__iter__cCs t|jSr)rr/r2rrr"__len__`szBoundMethodDispatcher.__len__cCs ||jkSrr0r$rrr" __contains__csz"BoundMethodDispatcher.__contains__N) r+r,r-r.rr&r#r3r4r5rrrr"r'Lsr'cCsLt|dkoJt|ddkoJt|ddkoJt|ddkoJt|ddkS)Nrii)rord)datarrr"r js cCs,dt|dddt|dd}|S)Nirr7ir8r9)r:)r;char_valrrr"r pscsifdd}|S)Ncsttjtdrd|j}n d|j}t|}z|||WStk rt|}|f||}|j|dkri|<d|kri||<d||kri|||<||||<|YSXdS)Nz _%s_factorys _%s_factoryrargskwargs) rrr+typerrKeyError__dict__update) baseModuler>r?r kwargs_tuplemodobjsfactory moduleCacherr" moduleFactory|s$      z+moduleFactoryFactory..moduleFactoryr)rIrKrrHr"r yscsifdd}|S)Ncs2t|t|f}|kr*|||<|Sr)rr)r>r?r%cachefuncrr"wrappedszmemoize..wrappedr)rNrOrrLr"memoizesrP)! __future__rrrtypesrcollections.abcr ImportError collectionsZpip._vendor.sixrrxml.etree.ElementTreeetree ElementTreer Zxml.etree.cElementTreeZ cElementTree__all__eval_xrr Exceptionrrr r'r r r rPrrrr"s>