• File: __init__.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/collections/__pycache__/__init__.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 45.99 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Mj	@sdZddddddddd	g	Zd
dlZd
dlmZmZd
d
lm	Z
d
dlZd
dl
Zd
dlmZd
dlmZmZmZd
dlmZyd
dlmZWnek
rYnXej eyd
dlm!Z!Wnek
rYnXddZ"Gdddej#Z$Gdddej%Z&Gdddej'Z(Gddde)Z*Gddde+Z,yd
dlm,Z,Wnek
rVYnXiZ-dddd d!dZ.d"d#Z/yd
d$lm/Z/Wnek
rYnXGd%dde+Z0Gd&d	d	ej1Z2Gd'ddej1Z3Gd(ddejZ4Gd)ddej5Z6dS)*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

dequedefaultdict
namedtupleUserDictUserList
UserStringCounterOrderedDictChainMapN)
itemgettereq)	iskeyword)proxy)repeatchainstarmap)recursive_repr)r)rcCsR|tjkr:tt|}ddl}|jdtdd|t|<|Stdtd|dS)Nr
zUsing or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working)
stacklevelzmodule z has no attribute )	_collections_abc__all__getattrwarningswarnDeprecationWarningglobalsAttributeError__name__)nameobjrr 9/opt/alt/python37/lib64/python3.7/collections/__init__.py__getattr__*s



r"c@seZdZddZdS)_OrderedDictKeysViewccst|jEdHdS)N)reversed_mapping)selfr r r!__reversed__?sz!_OrderedDictKeysView.__reversed__N)r
__module____qualname__r'r r r r!r#=sr#c@seZdZddZdS)_OrderedDictItemsViewccs(x"t|jD]}||j|fVqWdS)N)r$r%)r&keyr r r!r'Dsz"_OrderedDictItemsView.__reversed__N)rr(r)r'r r r r!r*Bsr*c@seZdZddZdS)_OrderedDictValuesViewccs$xt|jD]}|j|VqWdS)N)r$r%)r&r+r r r!r'Jsz#_OrderedDictValuesView.__reversed__N)rr(r)r'r r r r!r,Hsr,c@seZdZdZdS)_Link)prevnextr+__weakref__N)rr(r)	__slots__r r r r!r-Nsr-c@seZdZdZddZejeefddZej	fddZ	dd	Z
d
dZdd
Zd*ddZ
d+ddZddZejjZZddZddZddZejjZeZefddZd,ddZed d!Zd"d#Zd$d%Ze d-d&d'Z!d(d)Z"dS).rz)Dictionary that remembers insertion ordercOs|std|^}}t|dkr0tdt|y
|jWn>tk
rxt|_t|j|_}||_|_i|_	YnX|j
||dS)zInitialize an ordered dictionary.  The signature is the same as
        regular dictionaries.  Keyword argument order is preserved.
        z?descriptor '__init__' of 'OrderedDict' object needs an argumentz$expected at most 1 arguments, got %dN)	TypeErrorlen_OrderedDict__rootrr-_OrderedDict__hardroot_proxyr.r/_OrderedDict__map_OrderedDict__update)argskwdsr&rootr r r!__init__`s
zOrderedDict.__init__c	CsZ||krJ||j|<}|j}|j}||||_|_|_||_|||_||||dS)z!od.__setitem__(i, y) <==> od[i]=yN)r8r5r.r/r+)	r&r+valueZdict_setitemrZLinklinkr<lastr r r!__setitem__ss
zOrderedDict.__setitem__cCs>||||j|}|j}|j}||_||_d|_d|_dS)z od.__delitem__(y) <==> del od[y]N)r8popr.r/)r&r+Zdict_delitemr?	link_prev	link_nextr r r!__delitem__s
zOrderedDict.__delitem__ccs,|j}|j}x||k	r&|jV|j}qWdS)zod.__iter__() <==> iter(od)N)r5r/r+)r&r<currr r r!__iter__s

zOrderedDict.__iter__ccs,|j}|j}x||k	r&|jV|j}qWdS)z#od.__reversed__() <==> reversed(od)N)r5r.r+)r&r<rFr r r!r's

zOrderedDict.__reversed__cCs*|j}||_|_|jt|dS)z.od.clear() -> None.  Remove all items from od.N)r5r.r/r8cleardict)r&r<r r r!rHs
zOrderedDict.clearTcCsj|std|j}|r0|j}|j}||_||_n|j}|j}||_||_|j}|j|=t||}||fS)zRemove 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)KeyErrorr5r.r/r+r8rIrB)r&r@r<r?rCrDr+r>r r r!popitems zOrderedDict.popitemc	Cst|j|}|j}|j}|j}||_||_|j}|rR|j}||_||_||_||_n|j}||_||_||_||_dS)zMove an existing element to the end (or beginning if last is false).

        Raise KeyError if the element does not exist.
        N)r8r.r/r5)	r&r+r@r?rCrDZ	soft_linkr<firstr r r!move_to_ends$
zOrderedDict.move_to_endcCsVtj}t|d}||j}|||jd7}|||j|7}|||j|7}|S)Nr2r)_sys	getsizeofr4__dict__r8r6r5)r&Zsizeofnsizer 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!keysszOrderedDict.keyscCst|S)z<D.items() -> a set-like object providing a view on D's items)r*)r&r r r!itemsszOrderedDict.itemscCst|S)z6D.values() -> an object providing a view on D's values)r,)r&r r r!valuesszOrderedDict.valuescCs0||kr||}||=|S||jkr,t||S)zod.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__markerrJ)r&r+defaultresultr r r!rBs
zOrderedDict.popNcCs||kr||S|||<|S)zInsert 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&r+rXr r r!
setdefaultszOrderedDict.setdefaultcCs*|sd|jjfSd|jjt|fS)zod.__repr__() <==> repr(od)z%s()z%s(%r))	__class__rlistrU)r&r r r!__repr__
szOrderedDict.__repr__cCsHt|}xttD]}||dqW|jd|p8ddt|fS)z%Return state information for picklingNr )varscopyrrBr[iterrU)r&Z	inst_dictkr r r!
__reduce__szOrderedDict.__reduce__cCs
||S)z!od.copy() -> a shallow copy of od)r[)r&r r r!r_szOrderedDict.copycCs |}x|D]}|||<qW|S)zYCreate a new ordered dictionary with keys from iterable and values set to value.
        r )clsiterabler>r&r+r r r!fromkeyss
zOrderedDict.fromkeyscCs2t|tr&t||o$ttt||St||S)zod.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
        while comparison to a regular mapping is order-insensitive.

        )
isinstancerrI__eq__allmap_eq)r&otherr r r!rg%s
zOrderedDict.__eq__)T)T)N)N)#rr(r)__doc__r=rIrAr7r-rErGr'rHrKrMrSrMutableMappingupdater9rTrUrV__ne__objectrWrBrZ_recursive_reprr]rbr_classmethodrergr r r r!rQs0

		

	

)rF)renamedefaultsmodulecsttrddttttt|}|rt}xNt	D]B\}}|
rtt|st|dst||krd||<|
|qJWxR|gD]D}t|tk	rtd|
std|t|rtd|qWt}xND]F}|dr|std|||kr,td||
|qWi}|d	k	rt|}t|tkrjtd
tttttt|}tttjttddd
d}	ddddDdtjtd|	d|	d}
d|d}t|
||d}d|d|	d|_|d	k	r6||_tfdd}
d|d|
j_fdd }d!|d"|_fd#d$}d%d&}d'd(}x.||
j||||fD]}|d)|j|_qW|d|	dd*||||
||||d+}t }xlt	D]`\}}y||\}}Wn4t!k
rBt"|}d,|}||f||<YnXt#||d-||<qWt|tf|}|d	kryt$d
j%&d.d/}Wnt'tfk
rYnX|d	k	r||_(|S)0aCReturns 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'r2(z, css|]}|dVqdS)z=%rNr ).0rr r r!	<genexpr>sznamedtuple.<locals>.<genexpr>)zdef __new__(_cls, z): return _tuple_new(_cls, (z))namedtuple_)
_tuple_newr__new__zCreate new instance of cs2||}|kr.tddt||S)Nz	Expected z arguments, got )r3r4)rcrdrY)_len
num_fields	tuple_newr r!_makes
znamedtuple.<locals>._makezMake a new z# object from a sequence or iterablecs.|t|j|}|r*tdt||S)NzGot unexpected field names: )rrirB
ValueErrorr\)_selfr;rY)field_namesr r!_replacesznamedtuple.<locals>._replacez
Return a new z2 object replacing specified fields with new valuescs|jj|S)z/Return a nicely formatted representation string)r[r)r&)repr_fmtr r!r]sznamedtuple.<locals>.__repr__cSstt|j|S)z@Return a new OrderedDict which maps field names to their values.)rzip_fields)r&r r r!_asdictsznamedtuple.<locals>._asdictcSst|S)z7Return self as a plain tuple.  Used by copy and pickle.)tuple)r&r r r!__getnewargs__sz"namedtuple.<locals>.__getnewargs__.r )rlr1r_field_defaults_fields_defaultsrrrr]rrzAlias for field number )docr__main__))rfstrreplacesplitr\rirNinternset	enumerateisidentifier
_iskeyword
startswithaddtyper3rrr4rIr$rreprjoinrexecrl__defaults__rr__func__rr)_nt_itemgettersrJ_itemgetterproperty	_getframe	f_globalsgetrr()typenamerrsrtruseenindexrfield_defaultsarg_lists	namespacerrrr]rrmethodclass_namespacecacheitemgetter_objectrrYr )rrrrrr!r<s










cCs*|j}x|D]}||dd||<qWdS)z!Tally elements from the iterable.r
r2N)r)mappingrdZmapping_getelemr r r!_count_elementss
r)rcseZdZdZfddZddZd/ddZd	d
Zed0ddZ	fd
dZ
ddZddZddZ
fddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.ZZS)1raDict 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)]

    csN|std|^}}t|dkr0tdt|tt||j||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

        z;descriptor '__init__' of 'Counter' object needs an argumentr2z$expected at most 1 arguments, got %dN)r3r4superrr=rn)r:r;r&)r[r r!r=&szCounter.__init__cCsdS)z1The count of elements not in the Counter is zero.r
r )r&r+r r r!__missing__:szCounter.__missing__NcCs6|dkrt|tdddStj||tddS)zList 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('abcdeabcdabcaba').most_common(3)
        [('a', 5), ('b', 4), ('c', 3)]

        Nr2T)r+reverse)r+)sortedrUr_heapqnlargest)r&rQr r r!most_common?s	zCounter.most_commoncCsttt|S)aIterator 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_repeatrU)r&r r r!elementsLszCounter.elementscCstddS)Nz@Counter.fromkeys() is undefined.  Use Counter(iterable) instead.)NotImplementedError)rcrdvr r r!redszCounter.fromkeyscs|std|^}}t|dkr0tdt||r<|dnd}|dk	rt|tjr|r|j}x8|D]\}}|||d||<qhWqtt|	|n
t
|||r|	|dS)aLike 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

        z9descriptor 'update' of 'Counter' object needs an argumentr2z$expected at most 1 arguments, got %dr
N)r3r4rfrMappingrrUrrrnr)r:r;r&rdself_getrcount)r[r r!rnks 
zCounter.updatecOs|std|^}}t|dkr0tdt||r<|dnd}|dk	r|j}t|tjrxH|D]\}}||d|||<qdWn x|D]}||dd||<qW|r||dS)aLike 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

        z;descriptor 'subtract' of 'Counter' object needs an argumentr2z$expected at most 1 arguments, got %dr
N)r3r4rrfrrrUsubtract)r:r;r&rdrrrr r r!rs
zCounter.subtractcCs
||S)zReturn a shallow copy.)r[)r&r r r!r_szCounter.copycCs|jt|ffS)N)r[rI)r&r r r!rbszCounter.__reduce__cs||krt|dS)zGLike dict.__delitem__() but does not raise KeyError for missing values.N)rrE)r&r)r[r r!rEszCounter.__delitem__cCs`|sd|jjSy&dtdj|}d|jj|fStk
rZd|jjt|SXdS)Nz%s()z, z%r: %rz%s({%s})z
{0}({1!r}))	r[rrri__mod__rr3formatrI)r&rUr r r!r]szCounter.__repr__cCsxt|tstSt}x0|D]$\}}|||}|dkr|||<qWx,|D] \}}||krP|dkrP|||<qPW|S)zAdd counts from two counters.

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

        r
)rfrNotImplementedrU)r&rkrYrrnewcountr r r!__add__s
zCounter.__add__cCs|t|tstSt}x0|D]$\}}|||}|dkr|||<qWx0|D]$\}}||krP|dkrPd|||<qPW|S)z Subtract count, but keep only results with positive counts.

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

        r
)rfrrrU)r&rkrYrrrr r r!__sub__s
zCounter.__sub__cCst|tstSt}x<|D]0\}}||}||kr:|n|}|dkr|||<qWx,|D] \}}||kr\|dkr\|||<q\W|S)zUnion is the maximum of value in either of the input counters.

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

        r
)rfrrrU)r&rkrYrrother_countrr r r!__or__s
zCounter.__or__cCsVt|tstSt}x<|D]0\}}||}||kr:|n|}|dkr|||<qW|S)z Intersection is the minimum of corresponding counts.

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

        r
)rfrrrU)r&rkrYrrrrr r r!__and__s
zCounter.__and__cCs0t}x$|D]\}}|dkr|||<qW|S)zEAdds an empty counter, effectively stripping negative and zero countsr
)rrU)r&rYrrr r r!__pos__s
zCounter.__pos__cCs4t}x(|D]\}}|dkrd|||<qW|S)z{Subtracts from an empty counter.  Strips positive and zero counts,
        and flips the sign on negative counts.

        r
)rrU)r&rYrrr r r!__neg__'s
zCounter.__neg__cCs*dd|D}x|D]
}||=qW|S)z?Internal method to strip elements with a negative or zero countcSsg|]\}}|dks|qS)r
r )r}rrr r r!
<listcomp>4sz*Counter._keep_positive.<locals>.<listcomp>)rU)r&nonpositiverr r r!_keep_positive2s

zCounter._keep_positivecCs.x$|D]\}}|||7<q
W|S)zInplace add from another counter, keeping only positive counts.

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

        )rUr)r&rkrrr r r!__iadd__9s	zCounter.__iadd__cCs.x$|D]\}}|||8<q
W|S)zInplace subtract counter, but keep only results with positive counts.

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

        )rUr)r&rkrrr r r!__isub__Fs	zCounter.__isub__cCs6x,|D] \}}||}||kr
|||<q
W|S)zInplace union is the maximum of value from either counter.

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

        )rUr)r&rkrrrr r r!__ior__Ss
	zCounter.__ior__cCs6x,|D] \}}||}||kr
|||<q
W|S)zInplace intersection is the minimum of corresponding counts.

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

        )rUr)r&rkrrrr r r!__iand__bs
	zCounter.__iand__)N)N)rr(r)rlr=rrrrrrernrr_rbrEr]rrrrrrrrrrr
__classcell__r r )r[r!rs0+

("

c@seZdZdZddZddZddZd'd	d
ZddZd
dZ	ddZ
ddZeddZ
eddZddZeZd(ddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS))r	a 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)zInitialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        N)r\maps)r&rr r r!r=szChainMap.__init__cCst|dS)N)rJ)r&r+r r r!rszChainMap.__missing__c	Cs8x,|jD]"}y||Stk
r(YqXqW||S)N)rrJr)r&r+rr r r!__getitem__s
zChainMap.__getitem__NcCs||kr||S|S)Nr )r&r+rXr r r!rszChainMap.getcCsttj|jS)N)r4runionr)r&r r r!__len__szChainMap.__len__cCs*i}xt|jD]}||qWt|S)N)r$rrnr`)r&drr r r!rGszChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdS)Nr )r}m)r+r r!r~sz(ChainMap.__contains__.<locals>.<genexpr>)anyr)r&r+r )r+r!__contains__szChainMap.__contains__cCs
t|jS)N)rr)r&r r r!__bool__szChainMap.__bool__cCsd|dtt|jS)Nz{0.__class__.__name__}({1})z, )rrrirr)r&r r r!r]szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)rIre)rcrdr:r r r!reszChainMap.fromkeyscCs$|j|jdf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r
r2N)r[rr_)r&r r r!r_sz
ChainMap.copycCs|dkri}|j|f|jS)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&rr r r!	new_childszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].r2N)r[r)r&r r r!parentsszChainMap.parentscCs||jd|<dS)Nr
)r)r&r+r>r r r!rAszChainMap.__setitem__cCs8y|jd|=Wn"tk
r2td|YnXdS)Nr
z(Key not found in the first mapping: {!r})rrJr)r&r+r r r!rEszChainMap.__delitem__cCs0y|jdStk
r*tdYnXdS)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)rrKrJ)r&r r r!rKszChainMap.popitemcGs>y|jdj|f|Stk
r8td|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r
z(Key not found in the first mapping: {!r}N)rrBrJr)r&r+r:r r r!rBszChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.r
N)rrH)r&r r r!rHszChainMap.clear)N)N)rr(r)rlr=rrrrrGrrrqr]rrrer___copy__rrrrArErKrBrHr r r r!r	vs(

c@sjeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZe
dddZdS)rcOs|std|^}}t|dkr0tdt||r>|d}n0d|krj|d}ddl}|jdtddnd}i|_|dk	r||t|r||dS)	Nz<descriptor '__init__' of 'UserDict' object needs an argumentr2z$expected at most 1 arguments, got %dr
rIz0Passing 'dict' as keyword argument is deprecatedr)r)r3r4rBrrrdatarn)r:kwargsr&rIrr r r!r=s$


zUserDict.__init__cCs
t|jS)N)r4r)r&r r r!rzUserDict.__len__cCs:||jkr|j|St|jdr.|j||St|dS)Nr)rhasattrr[rrJ)r&r+r r r!rs


zUserDict.__getitem__cCs||j|<dS)N)r)r&r+itemr r r!rArzUserDict.__setitem__cCs|j|=dS)N)r)r&r+r r r!rErzUserDict.__delitem__cCs
t|jS)N)r`r)r&r r r!rGszUserDict.__iter__cCs
||jkS)N)r)r&r+r r r!r
szUserDict.__contains__cCs
t|jS)N)rr)r&r r r!r]rzUserDict.__repr__cCs4|j|j}|j|j|jd|jd<|S)Nr)r[rrPrnr_)r&instr r r!rszUserDict.__copy__cCsR|jtkrt|jSddl}|j}zi|_||}Wd||_X|||S)Nr
)r[rrr_rn)r&r_rcr r r!r_s

z
UserDict.copyNcCs |}x|D]}|||<qW|S)Nr )rcrdr>rr+r r r!re#s
zUserDict.fromkeys)N)rr(r)r=rrrArErGrr]rr_rrrer r r r!rs
c@seZdZdZd@ddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZddZdd Zd!d"Zd#d$ZeZd%d&Zd'd(Zd)d*Zd+d,ZdAd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Z d<d=Z!d>d?Z"dS)BrzAA more or less complete user-defined wrapper around list objects.NcCsbg|_|dk	r^t|t|jkr0||jdd<n.t|trT|jdd|jdd<n
t||_dS)N)rrrfrr\)r&initlistr r r!r=2s
zUserList.__init__cCs
t|jS)N)rr)r&r r r!r]<rzUserList.__repr__cCs|j||kS)N)r_UserList__cast)r&rkr r r!__lt__=rzUserList.__lt__cCs|j||kS)N)rr)r&rkr r r!__le__>rzUserList.__le__cCs|j||kS)N)rr)r&rkr r r!rg?rzUserList.__eq__cCs|j||kS)N)rr)r&rkr r r!__gt__@rzUserList.__gt__cCs|j||kS)N)rr)r&rkr r r!__ge__ArzUserList.__ge__cCst|tr|jS|S)N)rfrr)r&rkr r r!__castBszUserList.__castcCs
||jkS)N)r)r&rr r r!rDrzUserList.__contains__cCs
t|jS)N)r4r)r&r r r!rErzUserList.__len__cCs(t|tr||j|S|j|SdS)N)rfslicer[r)r&ir r r!rFs
zUserList.__getitem__cCs||j|<dS)N)r)r&rrr r r!rAKrzUserList.__setitem__cCs|j|=dS)N)r)r&rr r r!rELrzUserList.__delitem__cCsPt|tr||j|jSt|t|jr<||j|S||jt|S)N)rfrr[rrr\)r&rkr r r!rMs

zUserList.__add__cCsPt|tr||j|jSt|t|jr<|||jS|t||jS)N)rfrr[rrr\)r&rkr r r!__radd__Ss

zUserList.__radd__cCsRt|tr|j|j7_n2t|t|jr<|j|7_n|jt|7_|S)N)rfrrrr\)r&rkr r r!rYs
zUserList.__iadd__cCs||j|S)N)r[r)r&rQr r r!__mul__aszUserList.__mul__cCs|j|9_|S)N)r)r&rQr r r!__imul__dszUserList.__imul__cCs8|j|j}|j|j|jddd|jd<|S)Nr)r[rrPrn)r&rr r r!rgszUserList.__copy__cCs|j|dS)N)rappend)r&rr r r!rmrzUserList.appendcCs|j||dS)N)rinsert)r&rrr r r!rnrzUserList.insertr{cCs|j|S)N)rrB)r&rr r r!rBorzUserList.popcCs|j|dS)N)rremove)r&rr r r!rprzUserList.removecCs|jdS)N)rrH)r&r r r!rHqrzUserList.clearcCs
||S)N)r[)r&r r r!r_rrz
UserList.copycCs|j|S)N)rr)r&rr r r!rsrzUserList.countcGs|jj|f|S)N)rr)r&rr:r r r!rtrzUserList.indexcCs|jdS)N)rr)r&r r r!rurzUserList.reversecOs|jj||dS)N)rsort)r&r:r;r r r!rvrz
UserList.sortcCs*t|tr|j|jn|j|dS)N)rfrrextend)r&rkr r r!rws
zUserList.extend)N)r{)#rr(r)rlr=r]rrrgrrrrrrrArErrrr__rmul__rrrrrBrrHr_rrrrrr r r r!r0s@


c@sheZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZddZdd Zd!d"Zd#d$Zd%d&ZeZd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1ejfd2d3Zdd5d6Zd1ejfd7d8Z dd:d;Z!d1ejfd<d=Z"d>d?Z#d@dAZ$d1ejfdBdCZ%dDdEZ&dFdGZ'dHdIZ(dJdKZ)dLdMZ*dNdOZ+dPdQZ,dRdSZ-dTdUZ.dVdWZ/dXdYZ0dZd[Z1d\d]Z2d^d_Z3d`daZ4ddbdcZ5e6j7Z7dddeZ8ddgdhZ9d1ejfdidjZ:d1ejfdkdlZ;dmdnZ<dodpZ=ddqdrZ>ddsdtZ?ddudvZ@ddxdyZAd1ejfdzd{ZBdd|d}ZCd~dZDddZEddZFddZGddZHd4S)rcCs<t|tr||_n&t|tr.|jdd|_n
t||_dS)N)rfrrr)r&seqr r r!r=s


zUserString.__init__cCs
t|jS)N)rr)r&r r r!__str__rzUserString.__str__cCs
t|jS)N)rr)r&r r r!r]rzUserString.__repr__cCs
t|jS)N)intr)r&r r r!__int__rzUserString.__int__cCs
t|jS)N)floatr)r&r r r!	__float__rzUserString.__float__cCs
t|jS)N)complexr)r&r r r!__complex__rzUserString.__complex__cCs
t|jS)N)hashr)r&r r r!__hash__rzUserString.__hash__cCs|jddfS)N)r)r&r r r!rszUserString.__getnewargs__cCs t|tr|j|jkS|j|kS)N)rfrr)r&stringr r r!rgs
zUserString.__eq__cCs t|tr|j|jkS|j|kS)N)rfrr)r&rr r r!rs
zUserString.__lt__cCs t|tr|j|jkS|j|kS)N)rfrr)r&rr r r!rs
zUserString.__le__cCs t|tr|j|jkS|j|kS)N)rfrr)r&rr r r!rs
zUserString.__gt__cCs t|tr|j|jkS|j|kS)N)rfrr)r&rr r r!rs
zUserString.__ge__cCst|tr|j}||jkS)N)rfrr)r&charr r r!rs
zUserString.__contains__cCs
t|jS)N)r4r)r&r r r!rrzUserString.__len__cCs||j|S)N)r[r)r&rr r r!rrzUserString.__getitem__cCsJt|tr||j|jSt|tr6||j|S||jt|S)N)rfrr[rr)r&rkr r r!rs


zUserString.__add__cCs.t|tr|||jS|t||jS)N)rfrr[r)r&rkr r r!rs
zUserString.__radd__cCs||j|S)N)r[r)r&rQr r r!rszUserString.__mul__cCs||j|S)N)r[r)r&r:r r r!rszUserString.__mod__cCs||tS)N)r[r:)r&rr r r!__rmod__szUserString.__rmod__cCs||jS)N)r[r
capitalize)r&r r r!rrzUserString.capitalizecCs||jS)N)r[rcasefold)r&r r r!rszUserString.casefoldcGs||jj|f|S)N)r[rcenter)r&widthr:r r r!rszUserString.centerr
cCs t|tr|j}|j|||S)N)rfrrr)r&substartendr r r!rs
zUserString.countNcCs>|r.|r||j||S||j|S||jS)N)r[rencode)r&encodingerrorsr r r!rs
zUserString.encodecCs|j|||S)N)rendswith)r&suffixrrr r r!rszUserString.endswithcCs||j|S)N)r[r
expandtabs)r&tabsizer r r!rszUserString.expandtabscCs t|tr|j}|j|||S)N)rfrrfind)r&rrrr r r!r s
zUserString.findcOs|jj||S)N)rr)r&r:r;r r r!rszUserString.formatcCs|j|S)N)r
format_map)r&rr r r!r!szUserString.format_mapcCs|j|||S)N)rr)r&rrrr r r!rszUserString.indexcCs
|jS)N)risalpha)r&r r r!r"rzUserString.isalphacCs
|jS)N)risalnum)r&r r r!r#rzUserString.isalnumcCs
|jS)N)risascii)r&r r r!r$rzUserString.isasciicCs
|jS)N)r	isdecimal)r&r r r!r%rzUserString.isdecimalcCs
|jS)N)risdigit)r&r r r!r&rzUserString.isdigitcCs
|jS)N)rr)r&r r r!rrzUserString.isidentifiercCs
|jS)N)rislower)r&r r r!r'rzUserString.islowercCs
|jS)N)r	isnumeric)r&r r r!r(rzUserString.isnumericcCs
|jS)N)risprintable)r&r r r!r)rzUserString.isprintablecCs
|jS)N)risspace)r&r r r!r*rzUserString.isspacecCs
|jS)N)ristitle)r&r r r!r+rzUserString.istitlecCs
|jS)N)risupper)r&r r r!r,rzUserString.isuppercCs|j|S)N)rr)r&rr r r!rrzUserString.joincGs||jj|f|S)N)r[rljust)r&rr:r r r!r-szUserString.ljustcCs||jS)N)r[rlower)r&r r r!r.rzUserString.lowercCs||j|S)N)r[rlstrip)r&charsr r r!r/rzUserString.lstripcCs|j|S)N)r	partition)r&sepr r r!r1szUserString.partitionr{cCs6t|tr|j}t|tr |j}||j|||S)N)rfrrr[r)r&oldnewmaxsplitr r r!rs


zUserString.replacecCs t|tr|j}|j|||S)N)rfrrrfind)r&rrrr r r!r6s
zUserString.rfindcCs|j|||S)N)rrindex)r&rrrr r r!r7szUserString.rindexcGs||jj|f|S)N)r[rrjust)r&rr:r r r!r8szUserString.rjustcCs|j|S)N)r
rpartition)r&r2r r r!r9szUserString.rpartitioncCs||j|S)N)r[rrstrip)r&r0r r r!r:szUserString.rstripcCs|j||S)N)rr)r&r2r5r r r!rszUserString.splitcCs|j||S)N)rrsplit)r&r2r5r r r!r;szUserString.rsplitFcCs|j|S)N)r
splitlines)r&keependsr r r!r<
rzUserString.splitlinescCs|j|||S)N)rr)r&prefixrrr r r!rszUserString.startswithcCs||j|S)N)r[rstrip)r&r0r r r!r?
rzUserString.stripcCs||jS)N)r[rswapcase)r&r r r!r@rzUserString.swapcasecCs||jS)N)r[rtitle)r&r r r!rArzUserString.titlecGs||jj|S)N)r[r	translate)r&r:r r r!rBszUserString.translatecCs||jS)N)r[rupper)r&r r r!rCrzUserString.uppercCs||j|S)N)r[rzfill)r&rr r r!rDrzUserString.zfill)NN)r)N)r{)N)Nr{)Nr{)F)N)Irr(r)r=rr]rr	rr
rrgrrrrrrrrrrrrrrrrrNmaxsizerrrrr rr!rr"r#r$r%r&rr'r(r)r*r+r,rr-r.r/r	maketransr1rr6r7r8r9r:rr;r<rr?r@rArBrCrDr r r r!rs








)7rlrroperatorrrrrjkeywordr
rsysrNheapqr_weakrefrr7	itertoolsrrrrrrreprlibrrq_collectionsrImportErrorMutableSequenceregisterrr"KeysViewr#	ItemsViewr*
ValuesViewr,rpr-rIrrrrrrmr	rrSequencerr r r r!<module>s\
_-oKS