File: //home/arjun/projects/env/lib/python3.10/site-packages/html5lib/__pycache__/_utils.cpython-310.pyc
o
%we7 � @ sH d dl mZmZmZ d dlmZ zd dlmZ W n ey' d dl mZ Y nw d dl
mZmZ er<d dl
m mZ nzd dlm mZ W n eyY d dl
m mZ Y nw g d�Zzed�Zeee�ssed�Zeee�ssJ �W n ey d ZY nw d
ZG dd� de�ZG d
d� de�Zdd� Zdd� Zdd� Zdd� ZdS )� )�absolute_import�division�unicode_literals)�
ModuleType)�Mapping)� text_type�PY3N)�
default_etree�MethodDispatcher�isSurrogatePair�surrogatePairToCodepoint�moduleFactoryFactory�supports_lone_surrogatesz"\uD800"z u"\uD800"FTc @ s, e Zd ZdZd
dd�Zdd� 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 sv g }|D ]!\}}t |ttttf�r|D ] }|�||f� qq|�||f� qt�| |� t| �t|�ks6J �d | _ d S �N)
�
isinstance�list�tuple� frozenset�set�append�dict�__init__�len�default)�self�items�_dictEntries�name�value�itemr r �H/home/arjun/projects/env/lib/python3.10/site-packages/html5lib/_utils.pyr 9 s �
zMethodDispatcher.__init__c C s t �| || j�S r )r �getr �r �keyr r r! �__getitem__E s zMethodDispatcher.__getitem__Nc C s
t || �S r )�BoundMethodDispatcher)r �instance�ownerr r r! �__get__H �
zMethodDispatcher.__get__)r r )�__name__�
__module__�__qualname__�__doc__r r% r) r r r r! r
, s
r
c @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dS )r&