� ��^iC � � � d dl mZmZmZ d dlmZ d dlmZ n# e$ r d dl mZ Y nw xY wd dl mZmZ er d dl mc mZ n d dlmc mZ n# e$ r d dl mc mZ Y nw xY wg d�Z ed� � Z eee� � s ed� � Z eee� � sJ �d Zn # e$ r d ZY nw xY w G d� de� � Z G d � de� � Zd� Zd� Zd� Zd� ZdS )� )�absolute_import�division�unicode_literals)� ModuleType)�Mapping)� text_type�PY3N)� default_etree�MethodDispatcher�isSurrogatePair�surrogatePairToCodepoint�moduleFactoryFactory�supports_lone_surrogatesz"\uD800"z u"\uD800"TFc �( � e Zd ZdZdd�Zd� 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 �Z � g }|D ]a\ }}t |t t t t f� � r|D ]}|� ||f� � ��J|� ||f� � �bt � | |� � t | � � t |� � k sJ �d | _ d S �N) � isinstance�list�tuple� frozenset�set�append�dict�__init__�len�default)�self�items�_dictEntries�name�value�items ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/html5lib/_utils.pyr zMethodDispatcher.__init__9 s� � ��� � 3� 3�K�D�%��$��u�i�� =�>�>� 3� � 7� 7�D� �'�'��u� �6�6�6�6�7� �#�#�T�5�M�2�2�2�2�� � �d�L�)�)�)��4�y�y�C��-�-�-�-�-�-������ c �D � t � | || j � � S r )r �getr �r �keys r$ �__getitem__zMethodDispatcher.__getitem__E s � ��x�x��c�4�<�0�0�0r% Nc �" � t || � � S r )�BoundMethodDispatcher)r �instance�owners r$ �__get__zMethodDispatcher.__get__H s � �$�X�t�4�4�4r% )r r )�__name__� __module__�__qualname__�__doc__r r* r/ r r% r$ r r , sU � � � � � � � � � � � �1� 1� 1�5� 5� 5� 5� 5� 5r% r c �6 � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z dS ) r, zAWraps a MethodDispatcher, binding its return values to `instance`c �" � || _ || _ d S r )r- � dispatcher)r r- r6 s r$ r zBoundMethodDispatcher.__init__N s � � �� �$����r% c �L � | j | � | j � � S r )r6 r/ r- r( s r$ r* z!BoundMethodDispatcher.__getitem__R s! � � ��s�#�+�+�D�M�:�:�:r% c �( � || j v r| | S |S r �r6 )r r) r s r$ r' zBoundMethodDispatcher.getW s � ��$�/�!�!���9���Nr% c �* � t | j � � S r )�iterr6 �r s r$ �__iter__zBoundMethodDispatcher.__iter__] s � ��D�O�$�$�$r% c �* � t | j � � S r )r r6 r<