관리-도구
편집 파일: _utils.cpython-39.pyc
a ��ReC � @ sH d dl mZmZmZ d dlmZ zd dlmZ W n eyN d dl mZ Y n0 d dl mZmZ erxd dl m mZ n<zd dlm mZ W n$ ey� d dl m mZ Y n0 g d�Zz,ed�Zeee�s�ed�Zeee�s�J �W n ey� d ZY n0 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 ]B\}}t |ttttf�r<|D ]}|�||f� q&q|�||f� qt�| |� t| �t|�kslJ �d | _ d S �N) � isinstance�list�tuple� frozenset�set�append�dict�__init__�len�default)�self�items�_dictEntries�name�value�itemr r ��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/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 s zMethodDispatcher.__get__)r )N)�__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&