B ReC @ sX d dl mZmZmZ d dlmZ yd dlmZ W n ek rP d dl mZ Y nX d dl mZmZ erzd dl m mZ n>yd dlm mZ W n& ek r d dl m mZ Y nX dddd d dgZy,edZeeesed ZeeestW n ek r dZY nX dZG dd deZG dd deZdd Zdd Zdd Zdd Z dS ) )absolute_importdivisionunicode_literals) ModuleType)Mapping) text_typePY3N default_etreeMethodDispatcherisSurrogatePairsurrogatePairToCodepointmoduleFactoryFactorysupports_lone_surrogatesz"\uD800"z u"\uD800"FTc @ s, e Zd ZdZd ddZdd Zddd ZdS )r ap Dict 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. c C s~ g }xN|D ]F\}}t |ttttfrBx*|D ]}|||f q*W q |||f q W t| | t| t|kstt d | _ d S )N) isinstancelisttuple frozensetsetappenddict__init__lenAssertionErrordefault)selfitems_dictEntriesnamevalueitemr r /builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_vendor/html5lib/_utils.pyr 9 s zMethodDispatcher.__init__c C s t | || jS )N)r getr )r keyr r r! __getitem__E s zMethodDispatcher.__getitem__Nc C s t || S )N)BoundMethodDispatcher)r instanceownerr r r! __get__H s zMethodDispatcher.__get__)r )N)__name__ __module____qualname____doc__r r$ r( r r r r! r , s c @ s@ e Zd ZdZdd Zdd Zdd Zdd Zd d Zdd Z dS )r% zAWraps a MethodDispatcher, binding its return values to `instance`c C s || _ || _d S )N)r&