Viewing File: /usr/lib/python3.6/site-packages/pip/_vendor/html5lib/__pycache__/_utils.cpython-36.pyc

3

£éajã@s
ddlmZmZmZddlZddlmZddlmZyddl	j
jZWn e
k
rdddlj
jZYnXddddd	d
dgZejddko’ejd
dkZy,edƒZeeeƒs¾edƒZeeeƒs¾t‚WndZYnXdZGdd„deƒZdd„Zdd„Zdd	„Zdd„ZdS)é)Úabsolute_importÚdivisionÚunicode_literalsN)Ú
ModuleType)Ú	text_typeÚ
default_etreeÚMethodDispatcherÚisSurrogatePairÚsurrogatePairToCodepointÚmoduleFactoryFactoryÚsupports_lone_surrogatesÚPY27éééz"\uD800"z	u"\uD800"FTc@s$eZdZdZffdd„Zdd„ZdS)rapDict 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.
    cCs~g}xN|D]F\}}t|ttttfƒrBx*|D]}|j||fƒq*Wq
|j||fƒq
Wtj||ƒt|ƒt|ƒkstt	‚d|_
dS)N)Ú
isinstanceÚlistÚtupleÚ	frozensetÚsetÚappendÚdictÚ__init__ÚlenÚAssertionErrorÚdefault)ÚselfÚitemsZ_dictEntriesÚnameÚvalueÚitem©r!ú/usr/lib/python3.6/_utils.pyr4s
zMethodDispatcher.__init__cCstj|||jƒS)N)rÚgetr)rÚkeyr!r!r"Ú__getitem__CszMethodDispatcher.__getitem__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rr%r!r!r!r"r'scCsLt|ƒdkoJt|dƒdkoJt|dƒdkoJt|dƒdkoJt|dƒdkS)NrriØiÿÛriÜiÿß)rÚord)Údatar!r!r"r	Js cCs,dt|dƒddt|dƒd}|S)NiriØiriÜ)r*)r+Zchar_valr!r!r"r
Pscsi‰‡‡fdd„}|S)NcsØttjtdƒƒrd|j}n
d|j}t|jƒƒ}yˆ|||Stk
rÒt|ƒ}ˆ|f|ž|Ž}|jj|ƒdˆkr†iˆ|<dˆ|kržiˆ||<dˆ||kr¾iˆ|||<|ˆ|||<|SXdS)NÚz_%s_factorys_%s_factoryrÚargsÚkwargs)	rrr&ÚtyperrÚKeyErrorÚ__dict__Úupdate)Z
baseModuler-r.rZkwargs_tupleÚmodZobjs)ÚfactoryÚmoduleCacher!r"Ú
moduleFactory\s$
z+moduleFactoryFactory.<locals>.moduleFactoryr!)r4r6r!)r4r5r"rYscsi‰‡‡fdd„}|S)Ncs2t|ƒt|jƒƒf}|ˆkr*ˆ||Žˆ|<ˆ|S)N)rr)r-r.r$)ÚcacheÚfuncr!r"Úwrappedyszmemoize.<locals>.wrappedr!)r8r9r!)r7r8r"Úmemoizevsr:)Z
__future__rrrÚsysÚtypesrZpip._vendor.sixrZxml.etree.cElementTreeZetreeZcElementTreerÚImportErrorZxml.etree.ElementTreeZElementTreeÚ__all__Úversion_infor
ÚevalZ_xrrrrrr	r
rr:r!r!r!r"Ú<module>s0

#	
Back to Directory File Manager