AlkantarClanX12

Your IP : 3.133.146.94


Current Path : /opt/alt/python39/lib64/python3.9/collections/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/collections/__pycache__/__init__.cpython-39.pyc

a

R�f���@s&dZgd�ZddlZddlZddlZddlmZ	ddlm
ZddlmZ
ddlmZddlmZdd	lmZdd
lmZddlmZzddlmZWney�Yn0ej� e�zdd
lm!Z!Wney�Yn0dd�Z"Gdd�dej#�Z$Gdd�dej%�Z&Gdd�dej'�Z(Gdd�de)�Z*Gdd�de+�Z,zddlm,Z,Wne�yZYn0zddlm-Z-Wne�y�dd�Z-Yn0dddd�d d!�Z.d"d#�Z/zdd$lm/Z/Wne�y�Yn0Gd%d&�d&e+�Z0Gd'd(�d(ej1�Z2Gd)d*�d*ej1�Z3Gd+d,�d,ej�Z4Gd-d.�d.ej5�Z6dS)/a?This module implements specialized container datatypes providing
alternatives to Python's general purpose built-in containers, dict,
list, set, and tuple.

* namedtuple   factory function for creating tuple subclasses with named fields
* deque        list-like container with fast appends and pops on either end
* ChainMap     dict-like class for creating a single view of multiple mappings
* Counter      dict subclass for counting hashable objects
* OrderedDict  dict subclass that remembers the order entries were added
* defaultdict  dict subclass that calls a factory function to supply missing values
* UserDict     wrapper around dictionary objects for easier dict subclassing
* UserList     wrapper around list objects for easier list subclassing
* UserString   wrapper around string objects for easier string subclassing

)	�ChainMap�Counter�OrderedDict�UserDict�UserList�
UserString�defaultdict�deque�
namedtuple�N)�chain)�repeat)�starmap)�	iskeyword)�eq)�
itemgetter)�recursive_repr)�proxy)r)rcCsR|tjvr:tt|�}ddl}|jdtdd�|t�|<|Stdt�d|����dS)Nr
z�Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working�)�
stacklevelzmodule z has no attribute )	�_collections_abc�__all__�getattr�warnings�warn�DeprecationWarning�globals�AttributeError�__name__)�name�objr�r �9/opt/alt/python39/lib64/python3.9/collections/__init__.py�__getattr__7s

�
r"c@seZdZdd�ZdS)�_OrderedDictKeysViewccst|j�EdHdS�N��reversed�_mapping��selfr r r!�__reversed__Msz!_OrderedDictKeysView.__reversed__N�r�
__module__�__qualname__r*r r r r!r#Ksr#c@seZdZdd�ZdS)�_OrderedDictItemsViewccs$t|j�D]}||j|fVq
dSr$r%�r)�keyr r r!r*Rsz"_OrderedDictItemsView.__reversed__Nr+r r r r!r.Psr.c@seZdZdd�ZdS)�_OrderedDictValuesViewccs t|j�D]}|j|Vq
dSr$r%r/r r r!r*Xsz#_OrderedDictValuesView.__reversed__Nr+r r r r!r1Vsr1c@seZdZdZdS)�_Link)�prev�nextr0�__weakref__N)rr,r-�	__slots__r r r r!r2\sr2c@seZdZdZd1dd�Zejeefdd�Zej	fdd�Z	d	d
�Z
dd�Zd
d�Zd2dd�Z
d3dd�Zdd�ZejjZZdd�Zdd�Zdd�ZejjZe�Zefdd�Zd4dd �Ze�d!d"��Zd#d$�Zd%d&�Ze d5d'd(��Z!d)d*�Z"d+d,�Z#d-d.�Z$d/d0�Z%dS)6rz)Dictionary that remembers insertion orderr cKs^z
|jWn<tyFt�|_t|j�|_}||_|_i|_Yn0|j|fi|��dS)z�Initialize an ordered dictionary.  The signature is the same as
        regular dictionaries.  Keyword argument order is preserved.
        N)	�_OrderedDict__rootrr2�_OrderedDict__hardroot�_proxyr3r4�_OrderedDict__map�_OrderedDict__update)r)�other�kwds�rootr r r!�__init__ns
zOrderedDict.__init__c	CsZ||vrJ|�|j|<}|j}|j}||||_|_|_||_||�|_||||�dS)z!od.__setitem__(i, y) <==> od[i]=yN)r:r7r3r4r0)	r)r0�valueZdict_setitemrZLink�linkr>�lastr r r!�__setitem__{s
zOrderedDict.__setitem__cCs>|||�|j�|�}|j}|j}||_||_d|_d|_dS)z od.__delitem__(y) <==> del od[y]N)r:�popr3r4)r)r0Zdict_delitemrA�	link_prev�	link_nextr r r!�__delitem__�s
zOrderedDict.__delitem__ccs(|j}|j}||ur$|jV|j}qdS)zod.__iter__() <==> iter(od)N)r7r4r0�r)r>Zcurrr r r!�__iter__�s
zOrderedDict.__iter__ccs(|j}|j}||ur$|jV|j}qdS)z#od.__reversed__() <==> reversed(od)N)r7r3r0rHr r r!r*�s
zOrderedDict.__reversed__cCs*|j}||_|_|j��t�|�dS)z.od.clear() -> None.  Remove all items from od.N)r7r3r4r:�clear�dict)r)r>r r r!rJ�s
zOrderedDict.clearTcCsj|std��|j}|r0|j}|j}||_||_n|j}|j}||_||_|j}|j|=t�||�}||fS)z�Remove and return a (key, value) pair from the dictionary.

        Pairs are returned in LIFO order if last is true or FIFO order if false.
        zdictionary is empty)�KeyErrorr7r3r4r0r:rKrD)r)rBr>rArErFr0r@r r r!�popitem�s zOrderedDict.popitemc	Cst|j|}|j}|j}|j}||_||_|j}|rR|j}||_||_||_||_n|j}||_||_||_||_dS)z�Move an existing element to the end (or beginning if last is false).

        Raise KeyError if the element does not exist.
        N)r:r3r4r7)	r)r0rBrArErFZ	soft_linkr>�firstr r r!�move_to_end�s$
zOrderedDict.move_to_endcCsVtj}t|�d}||j�}|||j�d7}|||j�|7}|||j�|7}|S)N�r)�_sys�	getsizeof�len�__dict__r:r8r7)r)Zsizeof�n�sizer r r!�
__sizeof__�s
zOrderedDict.__sizeof__cCst|�S)z:D.keys() -> a set-like object providing a view on D's keys)r#r(r r r!�keys�szOrderedDict.keyscCst|�S)z<D.items() -> a set-like object providing a view on D's items)r.r(r r r!�items�szOrderedDict.itemscCst|�S)z6D.values() -> an object providing a view on D's values)r1r(r r r!�values�szOrderedDict.valuescCs0||vr||}||=|S||jur,t|��|S)z�od.pop(k[,d]) -> v, remove specified key and return the corresponding
        value.  If key is not found, d is returned if given, otherwise KeyError
        is raised.

        )�_OrderedDict__markerrL)r)r0�default�resultr r r!rD�s
zOrderedDict.popNcCs||vr||S|||<|S)z�Insert key with a value of default if key is not in the dictionary.

        Return the value for key if key is in the dictionary, else default.
        r �r)r0r\r r r!�
setdefaultszOrderedDict.setdefaultcCs*|sd|jjfSd|jjt|���fS)zod.__repr__() <==> repr(od)z%s()z%s(%r))�	__class__r�listrYr(r r r!�__repr__szOrderedDict.__repr__cCsDt|���}tt��D]}|�|d�q|jd|p4ddt|���fS)z%Return state information for picklingNr )�vars�copyrrDr`�iterrY)r)Z	inst_dict�kr r r!�
__reduce__szOrderedDict.__reduce__cCs
|�|�S)z!od.copy() -> a shallow copy of od�r`r(r r r!rd szOrderedDict.copycCs|�}|D]}|||<q
|S)zYCreate a new ordered dictionary with keys from iterable and values set to value.
        r )�cls�iterabler@r)r0r r r!�fromkeys$s
zOrderedDict.fromkeyscCs2t|t�r&t�||�o$ttt||��St�||�S)z�od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
        while comparison to a regular mapping is order-insensitive.

        )�
isinstancerrK�__eq__�all�map�_eq�r)r<r r r!rm-s
zOrderedDict.__eq__cCs|�|�|Sr$)�updaterqr r r!�__ior__6s
zOrderedDict.__ior__cCs&t|t�stS|�|�}|�|�|Sr$�rlrK�NotImplementedr`rr�r)r<�newr r r!�__or__:s



zOrderedDict.__or__cCs&t|t�stS|�|�}|�|�|Sr$rtrvr r r!�__ror__As



zOrderedDict.__ror__)r )T)T)N)N)&rr,r-�__doc__r?rKrCr9r2rGrIr*rJrMrOrWr�MutableMappingrrr;rXrYrZ�__ne__�objectr[rDr_�_recursive_reprrbrgrd�classmethodrkrmrsrxryr r r r!r_s:
�

		

	


	r)r)�_tuplegettercCstt|�|d�S)N)�doc)�property�_itemgetter)�indexr�r r r!�<lambda>W�r�F)�rename�defaults�modulecs�t�t�r��dd����ttt����t�t|��}|r�t�}t	��D]B\}}|�
�rrt|�sr|�d�sr||vr�d|���|<|�
|�qH|g�D]D}t|�tur�td��|�
�s�td|����t|�r�td|����q�t�}�D]F}|�d��r
|�s
td|����||v�r"td|����|�
|�q�i}|d	u�r|t|�}t|�t��k�r^td
��ttttt��t|�����}tttj����t���d���}	�dk�r�|	d7}	d
d�dd��D��d�tj�tttttf\������id|��d�}
d|	�d|	�d�}t||
�}d|_d|�d
|	�d�|_|d	u�rB||_t���fdd��}
d|�d�|
j_��fdd�}d|�d�|_�fd d!�}��fd"d#�}�fd$d%�}||
j||||fD]}|�d&|j��|_�q�|�d
|	�d�d'�|||
||||d(�
}t	��D](\}}t�d)|���}t||�||<�qt|tf|�}|d	u�rvzt� d�j!�"d*d+�}Wnt#tf�ytYn0|d	u�r�||_$|S),aCReturns a new subclass of tuple with named fields.

    >>> Point = namedtuple('Point', ['x', 'y'])
    >>> Point.__doc__                   # docstring for the new class
    'Point(x, y)'
    >>> p = Point(11, y=22)             # instantiate with positional args or keywords
    >>> p[0] + p[1]                     # indexable like a plain tuple
    33
    >>> x, y = p                        # unpack like a regular tuple
    >>> x, y
    (11, 22)
    >>> p.x + p.y                       # fields also accessible by name
    33
    >>> d = p._asdict()                 # convert to a dictionary
    >>> d['x']
    11
    >>> Point(**d)                      # convert from a dictionary
    Point(x=11, y=22)
    >>> p._replace(x=100)               # _replace() is like str.replace() but targets named fields
    Point(x=100, y=22)

    �,� �_z*Type names and field names must be stringsz6Type names and field names must be valid identifiers: z0Type names and field names cannot be a keyword: z-Field names cannot start with an underscore: z"Encountered duplicate field name: Nz(Got more default values than field names�, rP�(css|]}|�d�VqdS)z=%rNr )�.0rr r r!�	<genexpr>�r�znamedtuple.<locals>.<genexpr>�)�namedtuple_)�
_tuple_new�__builtins__rz
lambda _cls, z: _tuple_new(_cls, (z))�__new__zCreate new instance of cs2�||�}�|��kr.td��dt|�����|S)Nz	Expected z arguments, got )�	TypeErrorrS)rirjr])�_len�
num_fields�	tuple_newr r!�_make�s
znamedtuple.<locals>._makezMake a new z# object from a sequence or iterablecs.|��|j�|��}|r*tdt|�����|S)NzGot unexpected field names: )r�rD�
ValueErrorra)r)r=r])�_map�field_namesr r!�_replace�sznamedtuple.<locals>._replacez
Return a new z2 object replacing specified fields with new valuescs|jj�|S)z/Return a nicely formatted representation string)r`rr()�repr_fmtr r!rb�sznamedtuple.<locals>.__repr__cs��|j|��S)z9Return a new dict which maps field names to their values.)�_fieldsr()�_dict�_zipr r!�_asdict�sznamedtuple.<locals>._asdictcs�|�S)z7Return self as a plain tuple.  Used by copy and pickle.r r()�_tupler r!�__getnewargs__�sz"namedtuple.<locals>.__getnewargs__�.r )
rzr6r��_field_defaultsr�r�r�rbr�r�zAlias for field number r�__main__)%rl�str�replace�splitrarorQ�intern�set�	enumerate�isidentifier�
_iskeyword�
startswith�add�typer�r��tuplerSrKr&�zip�joinr��evalrrz�__defaults__r�__func__r-r��	_getframe�	f_globals�getrr,)�typenamer�r�r�r��seenr�r�field_defaults�arg_list�	namespace�coder�r�r�rbr�r��method�class_namespacer�r]r )	r�r�r�r�r�r�r�r�r�r!r	Ys�
�����
�

�


�

��

r	cCs&|j}|D]}||d�d||<q
dS)z!Tally elements from the iterable.r
rPN)r�)�mappingrjZmapping_get�elemr r r!�_count_elementssr�)r�cs�eZdZdZd/�fdd�	Zdd�Zd0dd�Zd	d
�Zed1dd��Z	d2�fd
d�	Z
d3dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z�ZS)4ra�Dict subclass for counting hashable items.  Sometimes called a bag
    or multiset.  Elements are stored as dictionary keys and their counts
    are stored as dictionary values.

    >>> c = Counter('abcdeabcdabcaba')  # count elements from a string

    >>> c.most_common(3)                # three most common elements
    [('a', 5), ('b', 4), ('c', 3)]
    >>> sorted(c)                       # list all unique elements
    ['a', 'b', 'c', 'd', 'e']
    >>> ''.join(sorted(c.elements()))   # list elements with repetitions
    'aaaaabbbbcccdde'
    >>> sum(c.values())                 # total of all counts
    15

    >>> c['a']                          # count of letter 'a'
    5
    >>> for elem in 'shazam':           # update counts from an iterable
    ...     c[elem] += 1                # by adding 1 to each element's count
    >>> c['a']                          # now there are seven 'a'
    7
    >>> del c['b']                      # remove all 'b'
    >>> c['b']                          # now there are zero 'b'
    0

    >>> d = Counter('simsalabim')       # make another counter
    >>> c.update(d)                     # add in the second counter
    >>> c['a']                          # now there are nine 'a'
    9

    >>> c.clear()                       # empty the counter
    >>> c
    Counter()

    Note:  If a count is set to zero or reduced to zero, it will remain
    in the counter until the entry is deleted or the counter is cleared:

    >>> c = Counter('aaabbc')
    >>> c['b'] -= 2                     # reduce the count of 'b' by two
    >>> c.most_common()                 # 'b' is still in, but its count is zero
    [('a', 3), ('c', 1), ('b', 0)]

    Ncs t���|j|fi|��dS)a	Create a new, empty Counter object.  And if given, count elements
        from an input iterable.  Or, initialize the count from another mapping
        of elements to their counts.

        >>> c = Counter()                           # a new, empty counter
        >>> c = Counter('gallahad')                 # a new counter from an iterable
        >>> c = Counter({'a': 4, 'b': 2})           # a new counter from a mapping
        >>> c = Counter(a=4, b=2)                   # a new counter from keyword args

        N)�superr?rr)r)rjr=rhr r!r?Es
zCounter.__init__cCsdS)z1The count of elements not in the Counter is zero.r
r r/r r r!�__missing__SszCounter.__missing__cCs6|durt|��td�dd�Stj||��td�d�S)z�List the n most common elements and their counts from the most
        common to the least.  If n is None, then list all element counts.

        >>> Counter('abracadabra').most_common(3)
        [('a', 5), ('b', 2), ('r', 2)]

        NrPT)r0�reverse�r0)�sortedrYr��_heapq�nlargest�r)rUr r r!�most_commonXs	zCounter.most_commoncCst�tt|����S)a�Iterator over elements repeating each as many times as its count.

        >>> c = Counter('ABCABC')
        >>> sorted(c.elements())
        ['A', 'A', 'B', 'B', 'C', 'C']

        # Knuth's example for prime factors of 1836:  2**2 * 3**3 * 17**1
        >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
        >>> product = 1
        >>> for factor in prime_factors.elements():     # loop over factors
        ...     product *= factor                       # and multiply them
        >>> product
        1836

        Note, if an element's count has been set to zero or is a negative
        number, elements() will ignore it.

        )�_chain�
from_iterable�_starmap�_repeatrYr(r r r!�elementseszCounter.elementscCstd��dS)Nz@Counter.fromkeys() is undefined.  Use Counter(iterable) instead.)�NotImplementedError)rirj�vr r r!rk}s	�zCounter.fromkeyscsn|dur\t|tj�rR|rD|j}|��D]\}}|||d�||<q&q\t��|�n
t||�|rj|�|�dS)a�Like dict.update() but add counts instead of replacing them.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.update('witch')           # add elements from another iterable
        >>> d = Counter('watch')
        >>> c.update(d)                 # add elements from another counter
        >>> c['h']                      # four 'h' in which, witch, and watch
        4

        Nr
)rlr�Mappingr�rYr�rrr��r)rjr=�self_getr��countrhr r!rr�s
zCounter.updatecKsn|dur\|j}t|tj�r@|��D]\}}||d�|||<q"n|D]}||d�d||<qD|rj|�|�dS)a�Like dict.update() but subtracts counts instead of replacing them.
        Counts can be reduced below zero.  Both the inputs and outputs are
        allowed to contain zero and negative counts.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.subtract('witch')             # subtract elements from another iterable
        >>> c.subtract(Counter('watch'))    # subtract elements from another counter
        >>> c['h']                          # 2 in which, minus 1 in witch, minus 1 in watch
        0
        >>> c['w']                          # 1 in which, minus 1 in witch, minus 1 in watch
        -1

        Nr
rP)r�rlrr�rY�subtractr�r r r!r��szCounter.subtractcCs
|�|�S)zReturn a shallow copy.rhr(r r r!rd�szCounter.copycCs|jt|�ffSr$)r`rKr(r r r!rg�szCounter.__reduce__cs||vrt��|�dS)zGLike dict.__delitem__() but does not raise KeyError for missing values.N)r�rG)r)r�rhr r!rG�szCounter.__delitem__cCsR|s|jj�d�Szt|���}Wnty<t|�}Yn0|jj�d|�d�S)Nz()r�r�)r`rrKr�r�)r)�dr r r!rb�szCounter.__repr__cCspt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D] \}}||vrJ|dkrJ|||<qJ|S)zAdd counts from two counters.

        >>> Counter('abbb') + Counter('bcc')
        Counter({'b': 4, 'c': 2, 'a': 1})

        r
�rlrrurY�r)r<r]r�r��newcountr r r!�__add__�s


zCounter.__add__cCstt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D]$\}}||vrJ|dkrJd|||<qJ|S)z� Subtract count, but keep only results with positive counts.

        >>> Counter('abbbc') - Counter('bccd')
        Counter({'b': 2, 'a': 1})

        r
r�r�r r r!�__sub__s

zCounter.__sub__cCs|t|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|��D] \}}||vrV|dkrV|||<qV|S)z�Union is the maximum of value in either of the input counters.

        >>> Counter('abbb') | Counter('bcc')
        Counter({'b': 3, 'c': 2, 'a': 1})

        r
r��r)r<r]r�r��other_countr�r r r!rxs


zCounter.__or__cCsRt|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|S)z� Intersection is the minimum of corresponding counts.

        >>> Counter('abbb') & Counter('bcc')
        Counter({'b': 1})

        r
r�r�r r r!�__and__'s

zCounter.__and__cCs,t�}|��D]\}}|dkr|||<q|S)zEAdds an empty counter, effectively stripping negative and zero countsr
�rrY�r)r]r�r�r r r!�__pos__8s

zCounter.__pos__cCs0t�}|��D]\}}|dkrd|||<q|S)z{Subtracts from an empty counter.  Strips positive and zero counts,
        and flips the sign on negative counts.

        r
r�r�r r r!�__neg__@s
zCounter.__neg__cCs&dd�|��D�}|D]
}||=q|S)z?Internal method to strip elements with a negative or zero countcSsg|]\}}|dks|�qS)r
r )r�r�r�r r r!�
<listcomp>Mr�z*Counter._keep_positive.<locals>.<listcomp>)rY)r)�nonpositiver�r r r!�_keep_positiveKszCounter._keep_positivecCs*|��D]\}}|||7<q|��S)z�Inplace add from another counter, keeping only positive counts.

        >>> c = Counter('abbb')
        >>> c += Counter('bcc')
        >>> c
        Counter({'b': 4, 'c': 2, 'a': 1})

        �rYr��r)r<r�r�r r r!�__iadd__Rs	zCounter.__iadd__cCs*|��D]\}}|||8<q|��S)z�Inplace subtract counter, but keep only results with positive counts.

        >>> c = Counter('abbbc')
        >>> c -= Counter('bccd')
        >>> c
        Counter({'b': 2, 'a': 1})

        r�r�r r r!�__isub___s	zCounter.__isub__cCs2|��D] \}}||}||kr|||<q|��S)z�Inplace union is the maximum of value from either counter.

        >>> c = Counter('abbb')
        >>> c |= Counter('bcc')
        >>> c
        Counter({'b': 3, 'c': 2, 'a': 1})

        r�)r)r<r�r�r�r r r!rsls
	
zCounter.__ior__cCs2|��D] \}}||}||kr|||<q|��S)z�Inplace intersection is the minimum of corresponding counts.

        >>> c = Counter('abbb')
        >>> c &= Counter('bcc')
        >>> c
        Counter({'b': 1})

        r�)r)r<r�r�r�r r r!�__iand__{s
	
zCounter.__iand__)N)N)N)N)N)rr,r-rzr?r�r�r�rrkrrr�rdrgrGrbr�r�rxr�r�r�r�r�r�rsr��
__classcell__r r rhr!rs02

"


rc@s�eZdZdZdd�Zdd�Zdd�Zd-d	d
�Zdd�Zd
d�Z	dd�Z
dd�Ze�dd��Z
edd��Zdd�ZeZd.dd�Zedd��Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdS)/ra� A ChainMap groups multiple dicts (or other mappings) together
    to create a single, updateable view.

    The underlying mappings are stored in a list.  That list is public and can
    be accessed or updated using the *maps* attribute.  There is no other
    state.

    Lookups search the underlying mappings successively until a key is found.
    In contrast, writes, updates, and deletions only operate on the first
    mapping.

    cGst|�pig|_dS)z�Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        N)ra�maps)r)r�r r r!r?�szChainMap.__init__cCst|��dSr$)rLr/r r r!r��szChainMap.__missing__c	Cs8|jD]&}z||WSty*Yq0q|�|�Sr$)r�rLr�)r)r0r�r r r!�__getitem__�s
zChainMap.__getitem__NcCs||vr||S|Sr$r r^r r r!r��szChainMap.getcCstt�j|j��Sr$)rSr��unionr�r(r r r!�__len__�szChainMap.__len__cCs,i}t|j�D]}|�t�|��qt|�Sr$)r&r�rrrKrkre)r)r�r�r r r!rI�szChainMap.__iter__cst�fdd�|jD��S)Nc3s|]}�|vVqdSr$r )r��mr�r r!r��r�z(ChainMap.__contains__.<locals>.<genexpr>��anyr�r/r r�r!�__contains__�szChainMap.__contains__cCs
t|j�Sr$r�r(r r r!�__bool__�szChainMap.__bool__cCs"|jj�dd�tt|j���d�S)Nr�r�r�)r`rr�ro�reprr�r(r r r!rb�szChainMap.__repr__cGs|tj|g|�R��S)z?Create a ChainMap with a single dict created from the iterable.)rKrk)rirj�argsr r r!rk�szChainMap.fromkeyscCs&|j|jd��g|jdd��R�S)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r
rPN)r`r�rdr(r r r!rd�sz
ChainMap.copycCs |duri}|j|g|j�R�S)zyNew ChainMap with a new map followed by all previous maps.
        If no map is provided, an empty dict is used.
        N�r`r�)r)r�r r r!�	new_child�szChainMap.new_childcCs|j|jdd��S)zNew ChainMap from maps[1:].rPNr�r(r r r!�parents�szChainMap.parentscCs||jd|<dS�Nr
)r�)r)r0r@r r r!rC�szChainMap.__setitem__cCs6z|jd|=Wn ty0td|����Yn0dS)Nr
�$Key not found in the first mapping: )r�rLr/r r r!rG�szChainMap.__delitem__cCs0z|jd��WSty*td��Yn0dS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.r
z#No keys found in the first mapping.N)r�rMrLr(r r r!rM�szChainMap.popitemcGs@z|jdj|g|�R�WSty:td|����Yn0dS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r
rN)r�rDrL)r)r0r�r r r!rD�szChainMap.popcCs|jd��dS)z'Clear maps[0], leaving maps[1:] intact.r
N)r�rJr(r r r!rJ�szChainMap.clearcCs|jd�|�|Sr)r�rrrqr r r!rs�szChainMap.__ior__cCs,t|tj�stS|��}|jd�|�|Sr)rlrr�rurdr�rr)r)r<r�r r r!rx�s
zChainMap.__or__cCs<t|tj�stSt|�}t|j�D]}|�|�q"|�|�Sr$)	rlrr�rurKr&r�rrr`)r)r<r��childr r r!ryszChainMap.__ror__)N)N)rr,r-rzr?r�r�r�r�rIr�r�r~rbrrkrd�__copy__r�r�rrCrGrMrDrJrsrxryr r r r!r�s4





rc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zeddd��ZdS) rNcKs*i|_|dur|�|�|r&|�|�dSr$)�datarr)r)rK�kwargsr r r!r?s

zUserDict.__init__cCs
t|j�Sr$�rSrr(r r r!r�szUserDict.__len__cCs:||jvr|j|St|jd�r.|j�||�St|��dS)Nr�)r�hasattrr`r�rLr/r r r!r�s


zUserDict.__getitem__cCs||j|<dSr$�r)r)r0�itemr r r!rC$szUserDict.__setitem__cCs|j|=dSr$r	r/r r r!rG'szUserDict.__delitem__cCs
t|j�Sr$)rerr(r r r!rI*szUserDict.__iter__cCs
||jvSr$r	r/r r r!r�.szUserDict.__contains__cCs
t|j�Sr$�r�rr(r r r!rb2szUserDict.__repr__cCs:t|t�r|�|j|jB�St|t�r6|�|j|B�StSr$�rlrr`rrKrurqr r r!rx5s


zUserDict.__or__cCs:t|t�r|�|j|jB�St|t�r6|�||jB�StSr$rrqr r r!ry<s


zUserDict.__ror__cCs.t|t�r|j|jO_n|j|O_|Sr$)rlrrrqr r r!rsCs
zUserDict.__ior__cCs4|j�|j�}|j�|j�|jd��|jd<|S�Nr)r`r�rTrrrd�r)�instr r r!rJszUserDict.__copy__cCsX|jturt|j���Sddl}|j}zi|_|�|�}W||_n||_0|�|�|Sr)r`rrrdrr)r)rdr�cr r r!rdQs

z
UserDict.copycCs|�}|D]}|||<q
|Sr$r )rirjr@r�r0r r r!rk^s
zUserDict.fromkeys)N)N)rr,r-r?r�r�rCrGrIr�rbrxryrsrrdrrkr r r r!rs

rc@seZdZdZd@dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZeZd%d&�Zd'd(�Zd)d*�Zd+d,�ZdAd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"dS)BrzAA more or less complete user-defined wrapper around list objects.NcCsbg|_|dur^t|�t|j�kr0||jdd�<n.t|t�rT|jdd�|jdd�<n
t|�|_dSr$)rr�rlrra)r)�initlistr r r!r?ms
zUserList.__init__cCs
t|j�Sr$rr(r r r!rbxszUserList.__repr__cCs|j|�|�kSr$�r�_UserList__castrqr r r!�__lt__{szUserList.__lt__cCs|j|�|�kSr$rrqr r r!�__le__~szUserList.__le__cCs|j|�|�kSr$rrqr r r!rm�szUserList.__eq__cCs|j|�|�kSr$rrqr r r!�__gt__�szUserList.__gt__cCs|j|�|�kSr$rrqr r r!�__ge__�szUserList.__ge__cCst|t�r|jS|Sr$)rlrrrqr r r!�__cast�szUserList.__castcCs
||jvSr$r	�r)r
r r r!r��szUserList.__contains__cCs
t|j�Sr$rr(r r r!r��szUserList.__len__cCs(t|t�r|�|j|�S|j|SdSr$)rl�slicer`r�r)�ir r r!r��s
zUserList.__getitem__cCs||j|<dSr$r	�r)rr
r r r!rC�szUserList.__setitem__cCs|j|=dSr$r	rr r r!rG�szUserList.__delitem__cCsPt|t�r|�|j|j�St|t|j��r<|�|j|�S|�|jt|��Sr$�rlrr`rr�rarqr r r!r��s

zUserList.__add__cCsPt|t�r|�|j|j�St|t|j��r<|�||j�S|�t|�|j�Sr$rrqr r r!�__radd__�s

zUserList.__radd__cCsRt|t�r|j|j7_n2t|t|j��r<|j|7_n|jt|�7_|Sr$)rlrrr�rarqr r r!r��s
zUserList.__iadd__cCs|�|j|�Sr$�r`rr�r r r!�__mul__�szUserList.__mul__cCs|j|9_|Sr$r	r�r r r!�__imul__�szUserList.__imul__cCs8|j�|j�}|j�|j�|jddd�|jd<|Sr
)r`r�rTrrrr r r!r�szUserList.__copy__cCs|j�|�dSr$)r�appendrr r r!r#�szUserList.appendcCs|j�||�dSr$)r�insertrr r r!r$�szUserList.insert���cCs|j�|�Sr$)rrDrr r r!rD�szUserList.popcCs|j�|�dSr$)r�removerr r r!r&�szUserList.removecCs|j��dSr$)rrJr(r r r!rJ�szUserList.clearcCs
|�|�Sr$rhr(r r r!rd�sz
UserList.copycCs|j�|�Sr$)rr�rr r r!r��szUserList.countcGs|jj|g|�R�Sr$�rr�)r)r
r�r r r!r��szUserList.indexcCs|j��dSr$)rr�r(r r r!r��szUserList.reversecOs|jj|i|��dSr$)r�sort�r)r�r=r r r!r(�sz
UserList.sortcCs*t|t�r|j�|j�n|j�|�dSr$)rlrr�extendrqr r r!r*�s
zUserList.extend)N)r%)#rr,r-rzr?rbrrrmrrrr�r�r�rCrGr�rr�r!�__rmul__r"rr#r$rDr&rJrdr�r�r�r(r*r r r r!rjs@
	
rc@sxeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZeZd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1ejfd2d3�Zd4d5�Zd6d7�Z d�d:d;�Z!d1ejfd<d=�Z"d�d?d@�Z#d1ejfdAdB�Z$dCdD�Z%dEdF�Z&d1ejfdGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5dedf�Z6d�dhdi�Z7e8j9Z9djdk�Z:d�dmdn�Z;d1ejfdodp�Z<d1ejfdqdr�Z=dsdt�Z>dudv�Z?d�dwdx�Z@d�dydz�ZAd�d{d|�ZBd�d~d�ZCd1ejfd�d��ZDd�d�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d��ZId�d��ZJdgS)�rcCs<t|t�r||_n&t|t�r.|jdd�|_n
t|�|_dSr$)rlr�rr�r)�seqr r r!r?�s


zUserString.__init__cCs
t|j�Sr$)r�rr(r r r!�__str__�szUserString.__str__cCs
t|j�Sr$rr(r r r!rb�szUserString.__repr__cCs
t|j�Sr$)�intrr(r r r!�__int__�szUserString.__int__cCs
t|j�Sr$)�floatrr(r r r!�	__float__szUserString.__float__cCs
t|j�Sr$)�complexrr(r r r!�__complex__szUserString.__complex__cCs
t|j�Sr$)�hashrr(r r r!�__hash__szUserString.__hash__cCs|jdd�fSr$r	r(r r r!r�szUserString.__getnewargs__cCs t|t�r|j|jkS|j|kSr$�rlrr�r)�stringr r r!rms
zUserString.__eq__cCs t|t�r|j|jkS|j|kSr$r7r8r r r!rs
zUserString.__lt__cCs t|t�r|j|jkS|j|kSr$r7r8r r r!rs
zUserString.__le__cCs t|t�r|j|jkS|j|kSr$r7r8r r r!rs
zUserString.__gt__cCs t|t�r|j|jkS|j|kSr$r7r8r r r!r"s
zUserString.__ge__cCst|t�r|j}||jvSr$r7)r)�charr r r!r�'s
zUserString.__contains__cCs
t|j�Sr$rr(r r r!r�,szUserString.__len__cCs|�|j|�Sr$r )r)r�r r r!r�/szUserString.__getitem__cCsJt|t�r|�|j|j�St|t�r6|�|j|�S|�|jt|��Sr$)rlrr`rr�rqr r r!r�2s


zUserString.__add__cCs.t|t�r|�||j�S|�t|�|j�Sr$)rlr�r`rrqr r r!r9s
zUserString.__radd__cCs|�|j|�Sr$r r�r r r!r!>szUserString.__mul__cCs|�|j|�Sr$r �r)r�r r r!�__mod__CszUserString.__mod__cCs|�t|�|�Sr$)r`r�)r)�templater r r!�__rmod__FszUserString.__rmod__cCs|�|j���Sr$)r`r�
capitalizer(r r r!r?JszUserString.capitalizecCs|�|j���Sr$)r`r�casefoldr(r r r!r@MszUserString.casefoldcGs|�|jj|g|�R��Sr$)r`r�center�r)�widthr�r r r!rAPszUserString.centerr
cCs t|t�r|j}|j�|||�Sr$)rlrrr��r)�sub�start�endr r r!r�Ss
zUserString.countcCs"t|t�r|j}|�|j�|��Sr$)rlrrr`�removeprefix)r)�prefixr r r!rHXs
zUserString.removeprefixcCs"t|t�r|j}|�|j�|��Sr$)rlrrr`�removesuffix)r)�suffixr r r!rJ]s
zUserString.removesuffix�utf-8�strictcCs.|durdn|}|durdn|}|j�||�S)NrLrM)r�encode)r)�encoding�errorsr r r!rNbszUserString.encodecCs|j�|||�Sr$)r�endswith)r)rKrFrGr r r!rQgszUserString.endswith�cCs|�|j�|��Sr$)r`r�
expandtabs)r)�tabsizer r r!rSjszUserString.expandtabscCs t|t�r|j}|j�|||�Sr$)rlrr�findrDr r r!rUms
zUserString.findcOs|jj|i|��Sr$)r�formatr)r r r!rVrszUserString.formatcCs|j�|�Sr$)r�
format_map)r)r�r r r!rWuszUserString.format_mapcCs|j�|||�Sr$r'rDr r r!r�xszUserString.indexcCs
|j��Sr$)r�isalphar(r r r!rX{szUserString.isalphacCs
|j��Sr$)r�isalnumr(r r r!rY~szUserString.isalnumcCs
|j��Sr$)r�isasciir(r r r!rZ�szUserString.isasciicCs
|j��Sr$)r�	isdecimalr(r r r!r[�szUserString.isdecimalcCs
|j��Sr$)r�isdigitr(r r r!r\�szUserString.isdigitcCs
|j��Sr$)rr�r(r r r!r��szUserString.isidentifiercCs
|j��Sr$)r�islowerr(r r r!r]�szUserString.islowercCs
|j��Sr$)r�	isnumericr(r r r!r^�szUserString.isnumericcCs
|j��Sr$)r�isprintabler(r r r!r_�szUserString.isprintablecCs
|j��Sr$)r�isspacer(r r r!r`�szUserString.isspacecCs
|j��Sr$)r�istitler(r r r!ra�szUserString.istitlecCs
|j��Sr$)r�isupperr(r r r!rb�szUserString.isuppercCs|j�|�Sr$)rr�r,r r r!r��szUserString.joincGs|�|jj|g|�R��Sr$)r`r�ljustrBr r r!rc�szUserString.ljustcCs|�|j���Sr$)r`r�lowerr(r r r!rd�szUserString.lowerNcCs|�|j�|��Sr$)r`r�lstrip�r)�charsr r r!re�szUserString.lstripcCs|j�|�Sr$)r�	partition�r)�sepr r r!rh�szUserString.partitionr%cCs6t|t�r|j}t|t�r |j}|�|j�|||��Sr$)rlrrr`r�)r)�oldrw�maxsplitr r r!r��s


zUserString.replacecCs t|t�r|j}|j�|||�Sr$)rlrr�rfindrDr r r!rm�s
zUserString.rfindcCs|j�|||�Sr$)r�rindexrDr r r!rn�szUserString.rindexcGs|�|jj|g|�R��Sr$)r`r�rjustrBr r r!ro�szUserString.rjustcCs|j�|�Sr$)r�
rpartitionrir r r!rp�szUserString.rpartitioncCs|�|j�|��Sr$)r`r�rstriprfr r r!rq�szUserString.rstripcCs|j�||�Sr$)rr��r)rjrlr r r!r��szUserString.splitcCs|j�||�Sr$)r�rsplitrrr r r!rs�szUserString.rsplitFcCs|j�|�Sr$)r�
splitlines)r)�keependsr r r!rt�szUserString.splitlinescCs|j�|||�Sr$)rr�)r)rIrFrGr r r!r��szUserString.startswithcCs|�|j�|��Sr$)r`r�striprfr r r!rv�szUserString.stripcCs|�|j���Sr$)r`r�swapcaser(r r r!rw�szUserString.swapcasecCs|�|j���Sr$)r`r�titler(r r r!rx�szUserString.titlecGs|�|jj|��Sr$)r`r�	translater;r r r!ry�szUserString.translatecCs|�|j���Sr$)r`r�upperr(r r r!rz�szUserString.uppercCs|�|j�|��Sr$)r`r�zfill)r)rCr r r!r{�szUserString.zfill)rLrM)rR)N)r%)N)Nr%)Nr%)F)N)Krr,r-r?r.rbr0r2r4r6r�rmrrrrr�r�r�r�rr!r+r<r>r?r@rArQ�maxsizer�rHrJrNrQrSrUrVrWr�rXrYrZr[r\r�r]r^r_r`rarbr�rcrdrer��	maketransrhr�rmrnrorprqr�rsrtr�rvrwrxryrzr{r r r r!r�s�








r)7rzrr�heapqr��sysrQ�	itertoolsrr�rr�r
r��keywordrr��operatorrrprr��reprlibrr~�_weakrefrr9�_collectionsr�ImportError�MutableSequence�registerrr"�KeysViewr#�	ItemsViewr.�
ValuesViewr1r}r2rKrr�r	r�rr{rrr�Sequencerr r r r!�<module>sjk/Z