U ��.e� � @ s� d dl mZmZmZ d dlmZ d dlmZ zd dlm m Z W n& ek rh d dl m mZ Y nX ddddd d gZzed�Zeee�s�ed�ZW n d ZY nX dZG dd� de�Zdd� Zdd� Zdd � Zdd� ZdS )� )�absolute_import�division�unicode_literals)� ModuleType)� text_typeN� default_etree�MethodDispatcher�isSurrogatePair�surrogatePairToCodepoint�moduleFactoryFactory�supports_lone_surrogatesz"\uD800"z u"\uD800"FTc @ s" e Zd ZdZddd�Zdd� 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 sb g }|D ]B\}}t |ttttf�r<|D ]}|�||f� q&q|�||f� qt�| |� d | _d S �N) � isinstance�list�tuple� frozenset�set�append�dict�__init__�default)�self�itemsZ_dictEntries�name�value�itemr r �?/usr/lib/python3.8/site-packages/pip/_vendor/html5lib/_utils.pyr 1 s zMethodDispatcher.__init__c C s t �| || j�S r )r �getr )r �keyr r r �__getitem__@ s zMethodDispatcher.__getitem__N)r )�__name__� __module__�__qualname__�__doc__r r r r r r r $ s c C sL t | �dkoJt| d �dkoJt| d �dkoJt| d �dkoJt| d �dkS )N� r � � i�� � � � i�� )�len�ord)�datar r r r G s ����c C s, dt | d �d d t | d �d }|S )Ni r r&