add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
U

�AT^���	@s&dZddddddddd	g	Zd
dlZd
dlmZmZd
d
lm	Z
d
dlZd
dl
Zd
dlmZd
dlmZmZmZd
dlmZzd
dlmZWnek
r�YnXej� e�zd
dlm!Z!Wnek
r�YnXdd�Z"Gdd�dej#�Z$Gdd�dej%�Z&Gdd�dej'�Z(Gdd�de)�Z*Gdd�de+�Z,zd
dlm,Z,Wnek
�rVYnXzd
dlm-Z-Wnek
�r�d d!�Z-YnXd"ddd#�d$d�Z.d%d&�Z/zd
d'lm/Z/Wnek
�r�YnXGd(d�de+�Z0Gd)d	�d	ej1�Z2Gd*d�dej1�Z3Gd+d�dej�Z4Gd,d�dej5�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

�deque�defaultdict�
namedtuple�UserDict�UserList�
UserString�Counter�OrderedDict�ChainMap�N)�
itemgetter�eq)�	iskeyword)�proxy)�repeat�chain�starmap)�recursive_repr)r)rcCsR|tjkr: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.9 it will stop working���
stacklevelzmodule z has no attribute )	�_collections_abc�__all__�getattr�warnings�warn�DeprecationWarning�globals�AttributeError�__name__)�name�objr�r!�,/usr/lib64/python3.8/collections/__init__.py�__getattr__*s

�
r#c@seZdZdd�ZdS)�_OrderedDictKeysViewccst|j�EdHdS�N��reversed�_mapping��selfr!r!r"�__reversed__?sz!_OrderedDictKeysView.__reversed__N�r�
__module__�__qualname__r+r!r!r!r"r$=sr$c@seZdZdd�ZdS)�_OrderedDictItemsViewccs$t|j�D]}||j|fVq
dSr%r&�r*�keyr!r!r"r+Dsz"_OrderedDictItemsView.__reversed__Nr,r!r!r!r"r/Bsr/c@seZdZdd�ZdS)�_OrderedDictValuesViewccs t|j�D]}|j|Vq
dSr%r&r0r!r!r"r+Jsz#_OrderedDictValuesView.__reversed__Nr,r!r!r!r"r2Hsr2c@seZdZdZdS)�_Link)�prev�nextr1�__weakref__N)rr-r.�	__slots__r!r!r!r"r3Nsr3c@s�eZdZdZd+dd�Zejeefdd�Zej	fdd�Z	d	d
�Z
dd�Zd
d�Zd,dd�Z
d-dd�Zdd�ZejjZZdd�Zdd�Zdd�ZejjZe�Zefdd�Zd.dd �Ze�d!d"��Zd#d$�Zd%d&�Ze d/d'd(��Z!d)d*�Z"dS)0rz)Dictionary that remembers insertion orderr!cKs\z
|jWn>tk
rHt�|_t|j�|_}||_|_i|_YnX|j|f|�dS)z�Initialize an ordered dictionary.  The signature is the same as
        regular dictionaries.  Keyword argument order is preserved.
        N)	�_OrderedDict__rootrr3�_OrderedDict__hardroot�_proxyr4r5�_OrderedDict__map�_OrderedDict__update)r*�other�kwds�rootr!r!r"�__init__`s
zOrderedDict.__init__c	CsZ||krJ|�|j|<}|j}|j}||||_|_|_||_||�|_||||�dS)z!od.__setitem__(i, y) <==> od[i]=yN)r;r8r4r5r1)	r*r1�valueZdict_setitemrZLink�linkr?�lastr!r!r"�__setitem__ms
zOrderedDict.__setitem__cCs>|||�|j�|�}|j}|j}||_||_d|_d|_dS)z od.__delitem__(y) <==> del od[y]N)r;�popr4r5)r*r1Zdict_delitemrB�	link_prev�	link_nextr!r!r"�__delitem__{s
zOrderedDict.__delitem__ccs(|j}|j}||k	r$|jV|j}qdS)zod.__iter__() <==> iter(od)N)r8r5r1�r*r?Zcurrr!r!r"�__iter__�s
zOrderedDict.__iter__ccs(|j}|j}||k	r$|jV|j}qdS)z#od.__reversed__() <==> reversed(od)N)r8r4r1rIr!r!r"r+�s
zOrderedDict.__reversed__cCs*|j}||_|_|j��t�|�dS)z.od.clear() -> None.  Remove all items from od.N)r8r4r5r;�clear�dict)r*r?r!r!r"rK�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)�KeyErrorr8r4r5r1r;rLrE)r*rCr?rBrFrGr1rAr!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;r4r5r8)	r*r1rCrBrFrGZ	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;r9r8)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)r2r)r!r!r"�values�szOrderedDict.valuescCs0||kr||}||=|S||jkr,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__markerrM)r*r1�default�resultr!r!r"rE�s
zOrderedDict.popNcCs||kr||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*r1r]r!r!r"�
setdefault�szOrderedDict.setdefaultcCs*|sd|jjfSd|jjt|���fS)zod.__repr__() <==> repr(od)�%s()z%s(%r))�	__class__r�listrZr)r!r!r"�__repr__szOrderedDict.__repr__cCsDt|���}tt��D]}|�|d�q|jd|p4ddt|���fS)z%Return state information for picklingNr!)�vars�copyrrErb�iterrZ)r*�	inst_dict�kr!r!r"�
__reduce__szOrderedDict.__reduce__cCs
|�|�S)z!od.copy() -> a shallow copy of od�rbr)r!r!r"rfszOrderedDict.copycCs|�}|D]}|||<q
|S)zYCreate a new ordered dictionary with keys from iterable and values set to value.
        r!)�cls�iterablerAr*r1r!r!r"�fromkeyss
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.

        )�
isinstancerrL�__eq__�all�map�_eq�r*r=r!r!r"rps
zOrderedDict.__eq__)r!)T)T)N)N)#rr-r.�__doc__r@rLrDr:r3rHrJr+rKrNrPrXr�MutableMapping�updater<rYrZr[�__ne__�objectr\rEr`�_recursive_reprrdrjrf�classmethodrnrpr!r!r!r"rQs8
�

		

	


)r)�_tuplegettercCstt|�|d�S)N)�doc)�property�_itemgetter)�indexr}r!r!r"�<lambda>7�r�F)�rename�defaults�modulecs�t�t�r��dd����ttt����t�t|��}|r�t�}t	��D]B\}}|�
�rrt|�sr|�d�sr||kr�d|���|<|�
|�qH|g�D]D}t|�tk	r�td��|�
�s�td|����t|�r�td|����q�t�}�D]F}|�d��r
|�s
td|����||k�r"td|����|�
|�q�i}|d	k	�r|t|�}t|�t��k�r^td
��ttttt��t|�����}tttj����t���t���dd�d
d�}	dd�dd��D��d�tj�tttttf\�����d|	�d|	�d�}
�d|��d�}t|
|�|d}d|�d|	�d�|_|d	k	�r>||_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	k�rvzt�!d
�j"�#d-d.�}Wnt$tfk
�rtYnX|d	k	�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�'�rQ������(�, css|]}|�d�VqdS)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.td��dt|�����|S)Nz	Expected z arguments, got )�	TypeErrorrT)rlrmr^)�_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�rE�
ValueErrorrc)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)rbrr))�repr_fmtr!r"rd�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!)rur7r��_field_defaults�_fields_defaultsr�r�r�rdr�r�zAlias for field number r�__main__)&ro�str�replace�splitrcrrrR�intern�set�	enumerate�isidentifier�
_iskeyword�
startswith�add�typer�r��tuplerTrLr'�zip�repr�joinr��execru�__defaults__r{�__func__rr.r|�	_getframe�	f_globals�getrr-)�typenamer�r�r�r��seenr�r�field_defaults�arg_list�s�	namespacer�r�r�rdr�r��method�class_namespacer}r^r!)	r�r�r�r�r�r�r�r�r�r"r9s�
���

�


��

cCs&|j}|D]}||d�d||<q
dS)z!Tally elements from the iterable.r
rQN)r�)�mappingrmZmapping_get�elemr!r!r"�_count_elements�sr�)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 tt|���|j|f|�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)�superrr@rw)r*rmr>rkr!r"r@szCounter.__init__cCsdS)z1The count of elements not in the Counter is zero.r
r!r0r!r!r"�__missing__*szCounter.__missing__cCs6|dkrt|��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)]

        NrQT)r1�reverse�r1)�sortedrZr�_heapq�nlargest�r*rVr!r!r"�most_common/s	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�_repeatrZr)r!r!r"�elements<szCounter.elementscCstd��dS)Nz@Counter.fromkeys() is undefined.  Use Counter(iterable) instead.)�NotImplementedError)rlrm�vr!r!r"rnTs	�zCounter.fromkeyscsr|dk	r`t|tj�rV|rD|j}|��D]\}}|||d�||<q&q`tt|��|�n
t||�|rn|�|�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
)	ror�Mappingr�rZr�rrwr��r*rmr>�self_getr��countrkr!r"rw`s
zCounter.updatecKsn|dk	r\|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
rQ)r�rorr�rZ�subtractr�r!r!r"r��szCounter.subtractcCs
|�|�S)zReturn a shallow copy.rkr)r!r!r"rf�szCounter.copycCs|jt|�ffSr%)rbrLr)r!r!r"rj�szCounter.__reduce__cs||krt��|�dS)zGLike dict.__delitem__() but does not raise KeyError for missing values.N)r�rH)r*r�rkr!r"rH�szCounter.__delitem__cCsf|sd|jjSz(d�tdj|����}d|jj|fWStk
r`d�|jjt|��YSXdS)Nrar�z%r: %rz%s({%s})z
{0}({1!r}))	rbrr�rr�__mod__r�r��formatrL)r*rZr!r!r"rd�szCounter.__repr__cCspt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D] \}}||krJ|dkrJ|||<qJ|S)zAdd counts from two counters.

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

        r
�ror�NotImplementedrZ�r*r=r^r�r��newcountr!r!r"�__add__�s


zCounter.__add__cCstt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D]$\}}||krJ|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] \}}||krV|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"�__or__�s


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
�rrZ�r*r^r�r�r!r!r"�__pos__s

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>sz*Counter._keep_positive.<locals>.<listcomp>)rZ)r*�nonpositiver�r!r!r"�_keep_positiveszCounter._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})

        �rZr��r*r=r�r�r!r!r"�__iadd__ s	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"�__ior__:s
	
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__Is
	
zCounter.__iand__)N)N)N)N)N)rr-r.rur@r�r�r�r{rnrwr�rfrjrHrdr�r�r�r�r�r�r�r�r�r�r��
__classcell__r!r!rkr"r�s02

!


c@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&�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)z�Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        N)rc�maps)r*r�r!r!r"r@kszChainMap.__init__cCst|��dSr%)rMr0r!r!r"r�rszChainMap.__missing__c	Cs:|jD](}z||WStk
r,YqXq|�|�Sr%)r�rMr�)r*r1r�r!r!r"�__getitem__us
zChainMap.__getitem__NcCs||kr||S|Sr%r!r_r!r!r"r�}szChainMap.getcCstt�j|j��Sr%)rTr��unionr�r)r!r!r"�__len__�szChainMap.__len__cCs&i}t|j�D]}|�|�qt|�Sr%)r'r�rwrg)r*�dr�r!r!r"rJ�szChainMap.__iter__cst�fdd�|jD��S)Nc3s|]}�|kVqdSr%r!)r��mr�r!r"r��sz(ChainMap.__contains__.<locals>.<genexpr>��anyr�r0r!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�)rbrr�rrr�r�r)r!r!r"rd�szChainMap.__repr__cGs|tj|f|���S)z?Create a ChainMap with a single dict created from the iterable.)rLrn)rlrm�argsr!r!r"rn�szChainMap.fromkeyscCs$|j|jd��f|jdd���S)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r
rQN)rbr�rfr)r!r!r"rf�sz
ChainMap.copycCs|dkri}|j|f|j��S)zyNew ChainMap with a new map followed by all previous maps.
        If no map is provided, an empty dict is used.
        N�rbr�)r*r�r!r!r"�	new_child�szChainMap.new_childcCs|j|jdd��S)zNew ChainMap from maps[1:].rQNrr)r!r!r"�parents�szChainMap.parentscCs||jd|<dS�Nr
)r�)r*r1rAr!r!r"rD�szChainMap.__setitem__cCs8z|jd|=Wn"tk
r2td�|���YnXdS)Nr
�(Key not found in the first mapping: {!r})r�rMr�r0r!r!r"rH�szChainMap.__delitem__cCs2z|jd��WStk
r,td��YnXdS)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�rNrMr)r!r!r"rN�szChainMap.popitemcGs@z|jdj|f|��WStk
r:td�|���YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r
rN)r�rErMr�)r*r1rr!r!r"rE�szChainMap.popcCs|jd��dS)z'Clear maps[0], leaving maps[1:] intact.r
N)r�rKr)r!r!r"rK�szChainMap.clear)N)N)rr-r.rur@r�r�r�r�rJr�rrzrdr{rnrf�__copy__rr~rrDrHrNrErKr!r!r!r"r	]s.





c@speZdZdd�Zde_dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
eddd��ZdS)rcOs�|std��|^}}t|�dkr0tdt|���|r>|d}n0d|krj|�d�}ddl}|jdtdd�nd}i|_|dk	r�|�|�|r�|�|�dS)	Nz<descriptor '__init__' of 'UserDict' object needs an argumentrQz$expected at most 1 arguments, got %dr
rLz0Passing 'dict' as keyword argument is deprecatedrr)r�rTrErrr�datarw)r�kwargsr*rLrr!r!r"r@�s(

�
zUserDict.__init__z($self, dict=None, /, **kwargs)cCs
t|j�Sr%�rTrr)r!r!r"r��r�zUserDict.__len__cCs:||jkr|j|St|jd�r.|j�||�St|��dS)Nr�)r�hasattrrbr�rMr0r!r!r"r��s


zUserDict.__getitem__cCs||j|<dSr%�r)r*r1�itemr!r!r"rD�r�zUserDict.__setitem__cCs|j|=dSr%rr0r!r!r"rH�r�zUserDict.__delitem__cCs
t|j�Sr%)rgrr)r!r!r"rJ�szUserDict.__iter__cCs
||jkSr%rr0r!r!r"r��szUserDict.__contains__cCs
t|j�Sr%�r�rr)r!r!r"rd�r�zUserDict.__repr__cCs4|j�|j�}|j�|j�|jd��|jd<|S�Nr)rbr�rUrwrf�r*�instr!r!r"r�szUserDict.__copy__cCsR|jtkrt|j���Sddl}|j}zi|_|�|�}W5||_X|�|�|Sr)rbrrrfrw)r*rfr�cr!r!r"rf�s

z
UserDict.copyNcCs|�}|D]}|||<q
|Sr%r!)rlrmrAr�r1r!r!r"rns
zUserDict.fromkeys)N)rr-r.r@�__text_signature__r�r�rDrHrJr�rdrrfr{rnr!r!r!r"r�s
c@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|_|dk	r^t|�t|j�kr0||jdd�<n.t|t�rT|jdd�|jdd�<n
t|�|_dSr%)rr�rorrc)r*�initlistr!r!r"r@s
zUserList.__init__cCs
t|j�Sr%rr)r!r!r"rd$r�zUserList.__repr__cCs|j|�|�kSr%�r�_UserList__castrtr!r!r"�__lt__%r�zUserList.__lt__cCs|j|�|�kSr%rrtr!r!r"�__le__&r�zUserList.__le__cCs|j|�|�kSr%rrtr!r!r"rp'r�zUserList.__eq__cCs|j|�|�kSr%rrtr!r!r"�__gt__(r�zUserList.__gt__cCs|j|�|�kSr%rrtr!r!r"�__ge__)r�zUserList.__ge__cCst|t�r|jS|Sr%)rorrrtr!r!r"�__cast*szUserList.__castcCs
||jkSr%r�r*r
r!r!r"r�,r�zUserList.__contains__cCs
t|j�Sr%r
r)r!r!r"r�-r�zUserList.__len__cCs(t|t�r|�|j|�S|j|SdSr%)ro�slicerbr�r*�ir!r!r"r�.s
zUserList.__getitem__cCs||j|<dSr%r�r*rr
r!r!r"rD3r�zUserList.__setitem__cCs|j|=dSr%rrr!r!r"rH4r�zUserList.__delitem__cCsPt|t�r|�|j|j�St|t|j��r<|�|j|�S|�|jt|��Sr%�rorrbrr�rcrtr!r!r"r�5s

zUserList.__add__cCsPt|t�r|�|j|j�St|t|j��r<|�||j�S|�t|�|j�Sr%r!rtr!r!r"�__radd__;s

zUserList.__radd__cCsRt|t�r|j|j7_n2t|t|j��r<|j|7_n|jt|�7_|Sr%)rorrr�rcrtr!r!r"r�As
zUserList.__iadd__cCs|�|j|�Sr%�rbrr�r!r!r"�__mul__IszUserList.__mul__cCs|j|9_|Sr%rr�r!r!r"�__imul__LszUserList.__imul__cCs8|j�|j�}|j�|j�|jddd�|jd<|Sr)rbr�rUrwrr!r!r"rOszUserList.__copy__cCs|j�|�dSr%)r�appendrr!r!r"r&Ur�zUserList.appendcCs|j�||�dSr%)r�insertr r!r!r"r'Vr�zUserList.insertr�cCs|j�|�Sr%)rrErr!r!r"rEWr�zUserList.popcCs|j�|�dSr%)r�removerr!r!r"r(Xr�zUserList.removecCs|j��dSr%)rrKr)r!r!r"rKYr�zUserList.clearcCs
|�|�Sr%rkr)r!r!r"rfZr�z
UserList.copycCs|j�|�Sr%)rr�rr!r!r"r�[r�zUserList.countcGs|jj|f|��Sr%�rr�)r*r
rr!r!r"r�\r�zUserList.indexcCs|j��dSr%)rr�r)r!r!r"r�]r�zUserList.reversecOs|jj||�dSr%)r�sort�r*rr>r!r!r"r*^r�z
UserList.sortcCs*t|t�r|j�|j�n|j�|�dSr%)rorr�extendrtr!r!r"r,_s
zUserList.extend)N)r�)#rr-r.rur@rdrrrprrrr�r�r�rDrHr�r"r�r$�__rmul__r%rr&r'rEr(rKrfr�r�r�r*r,r!r!r!r"rs@


c@sheZdZdd�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�Zd�d6d7�Zd1ejfd8d9�Z d�d;d<�Z!d1ejfd=d>�Z"d?d@�Z#dAdB�Z$d1ejfdCdD�Z%dEdF�Z&dGdH�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�Z4d�ddde�Z5e6j7Z7dfdg�Z8d�didj�Z9d1ejfdkdl�Z:d1ejfdmdn�Z;dodp�Z<dqdr�Z=d�dsdt�Z>d�dudv�Z?d�dwdx�Z@d�dzd{�ZAd1ejfd|d}�ZBd�d~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHdcS)�rcCs<t|t�r||_n&t|t�r.|jdd�|_n
t|�|_dSr%)ror�rr�r*�seqr!r!r"r@ls


zUserString.__init__cCs
t|j�Sr%)r�rr)r!r!r"�__str__sr�zUserString.__str__cCs
t|j�Sr%rr)r!r!r"rdtr�zUserString.__repr__cCs
t|j�Sr%)�intrr)r!r!r"�__int__ur�zUserString.__int__cCs
t|j�Sr%)�floatrr)r!r!r"�	__float__vr�zUserString.__float__cCs
t|j�Sr%)�complexrr)r!r!r"�__complex__wr�zUserString.__complex__cCs
t|j�Sr%)�hashrr)r!r!r"�__hash__xr�zUserString.__hash__cCs|jdd�fSr%rr)r!r!r"r�yszUserString.__getnewargs__cCs t|t�r|j|jkS|j|kSr%�rorr�r*�stringr!r!r"rp|s
zUserString.__eq__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__lt__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__le__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__gt__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__ge__cCst|t�r|j}||jkSr%r9)r*�charr!r!r"r��s
zUserString.__contains__cCs
t|j�Sr%r
r)r!r!r"r��r�zUserString.__len__cCs|�|j|�Sr%r#)r*r�r!r!r"r��r�zUserString.__getitem__cCsJt|t�r|�|j|j�St|t�r6|�|j|�S|�|jt|��Sr%)rorrbrr�rtr!r!r"r��s


zUserString.__add__cCs.t|t�r|�||j�S|�t|�|j�Sr%)ror�rbrrtr!r!r"r"�s
zUserString.__radd__cCs|�|j|�Sr%r#r�r!r!r"r$�szUserString.__mul__cCs|�|j|�Sr%r#�r*rr!r!r"r��szUserString.__mod__cCs|�t|�|�Sr%)rbr�)r*�templater!r!r"�__rmod__�szUserString.__rmod__cCs|�|j���Sr%)rbr�
capitalizer)r!r!r"r@�r�zUserString.capitalizecCs|�|j���Sr%)rbr�casefoldr)r!r!r"rA�szUserString.casefoldcGs|�|jj|f|���Sr%)rbr�center�r*�widthrr!r!r"rB�szUserString.centerr
cCs t|t�r|j}|j�|||�Sr%)rorrr��r*�sub�start�endr!r!r"r��s
zUserString.count�utf-8�strictcCs.|dkrdn|}|dkrdn|}|j�||�S)NrIrJ)r�encode)r*�encoding�errorsr!r!r"rK�szUserString.encodecCs|j�|||�Sr%)r�endswith)r*�suffixrGrHr!r!r"rN�szUserString.endswith�cCs|�|j�|��Sr%)rbr�
expandtabs)r*�tabsizer!r!r"rQ�szUserString.expandtabscCs t|t�r|j}|j�|||�Sr%)rorr�findrEr!r!r"rS�s
zUserString.findcOs|jj||�Sr%)rr�r+r!r!r"r��szUserString.formatcCs|j�|�Sr%)r�
format_map)r*r�r!r!r"rT�szUserString.format_mapcCs|j�|||�Sr%r)rEr!r!r"r��szUserString.indexcCs
|j��Sr%)r�isalphar)r!r!r"rU�r�zUserString.isalphacCs
|j��Sr%)r�isalnumr)r!r!r"rV�r�zUserString.isalnumcCs
|j��Sr%)r�isasciir)r!r!r"rW�r�zUserString.isasciicCs
|j��Sr%)r�	isdecimalr)r!r!r"rX�r�zUserString.isdecimalcCs
|j��Sr%)r�isdigitr)r!r!r"rY�r�zUserString.isdigitcCs
|j��Sr%)rr�r)r!r!r"r��r�zUserString.isidentifiercCs
|j��Sr%)r�islowerr)r!r!r"rZ�r�zUserString.islowercCs
|j��Sr%)r�	isnumericr)r!r!r"r[�r�zUserString.isnumericcCs
|j��Sr%)r�isprintabler)r!r!r"r\�r�zUserString.isprintablecCs
|j��Sr%)r�isspacer)r!r!r"r]�r�zUserString.isspacecCs
|j��Sr%)r�istitler)r!r!r"r^�r�zUserString.istitlecCs
|j��Sr%)r�isupperr)r!r!r"r_�r�zUserString.isuppercCs|j�|�Sr%)rr�r.r!r!r"r��r�zUserString.joincGs|�|jj|f|���Sr%)rbr�ljustrCr!r!r"r`�szUserString.ljustcCs|�|j���Sr%)rbr�lowerr)r!r!r"ra�r�zUserString.lowerNcCs|�|j�|��Sr%)rbr�lstrip�r*�charsr!r!r"rb�r�zUserString.lstripcCs|j�|�Sr%)r�	partition�r*�sepr!r!r"re�szUserString.partitionr�cCs6t|t�r|j}t|t�r |j}|�|j�|||��Sr%)rorrrbr�)r*�old�new�maxsplitr!r!r"r��s


zUserString.replacecCs t|t�r|j}|j�|||�Sr%)rorr�rfindrEr!r!r"rk�s
zUserString.rfindcCs|j�|||�Sr%)r�rindexrEr!r!r"rl�szUserString.rindexcGs|�|jj|f|���Sr%)rbr�rjustrCr!r!r"rm�szUserString.rjustcCs|j�|�Sr%)r�
rpartitionrfr!r!r"rn�szUserString.rpartitioncCs|�|j�|��Sr%)rbr�rstriprcr!r!r"ro�szUserString.rstripcCs|j�||�Sr%)rr��r*rgrjr!r!r"r��szUserString.splitcCs|j�||�Sr%)r�rsplitrpr!r!r"rq�szUserString.rsplitFcCs|j�|�Sr%)r�
splitlines)r*�keependsr!r!r"rr�r�zUserString.splitlinescCs|j�|||�Sr%)rr�)r*�prefixrGrHr!r!r"r��szUserString.startswithcCs|�|j�|��Sr%)rbr�striprcr!r!r"ru�r�zUserString.stripcCs|�|j���Sr%)rbr�swapcaser)r!r!r"rv�r�zUserString.swapcasecCs|�|j���Sr%)rbr�titler)r!r!r"rw�r�zUserString.titlecGs|�|jj|��Sr%)rbr�	translater=r!r!r"rx�szUserString.translatecCs|�|j���Sr%)rbr�upperr)r!r!r"ry�r�zUserString.uppercCs|�|j�|��Sr%)rbr�zfill)r*rDr!r!r"rz�r�zUserString.zfill)rIrJ)rP)N)r�)N)Nr�)Nr�)F)N)Irr-r.r@r0rdr2r4r6r8r�rprrrrr�r�r�r�r"r$r-r�r?r@rArBrR�maxsizer�rKrNrQrSr�rTr�rUrVrWrXrYr�rZr[r\r]r^r_r�r`rarbr��	maketransrer�rkrlrmrnror�rqrrr�rurvrwrxryrzr!r!r!r"rks�








)7rurr�operatorrrrrs�keywordr
r��sysrR�heapqr��_weakrefrr:�	itertoolsrr�rr�rr��reprlibrrz�_collectionsr�ImportError�MutableSequence�registerrr#�KeysViewr$�	ItemsViewr/�
ValuesViewr2ryr3rLrr|rr�rrvr	rr�Sequencerr!r!r!r"�<module>sh
�Y&vnMS