
    
3j۩                        S SK r S SK rS SKJrJrJrJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJr  S SKJr  \" S5      r\" S5      r\" SSS9r\" S\S9r\\\   \\   4   r\\\   \\   \\   4   rS	\S
\4S jr " S S\	\   \\   5      r " S S\\   5      r  " S S\\   5      r! " S S\\   5      r" " S S5      r# " S S\\   5      r$g)    N)AbstractSetAnyDictIterableIteratorList
MutableSetOptionalSequenceSetTypeVarUnionoverloadHashableDequeGeneric)dequeTS	StableSet)boundEobjreturnc                 .    [        U [        [        45      $ )aM  
Returns True for objects which are iterable but should not be iterated in
the context of indexing a StableSet or an OrderedSet.

When we index by an iterable, usually that means we're being asked to look
up a list of things.

However, in the case of the .index() method, we shouldn't handle strings
and tuples like other iterables. They're not sequences of things to look
up, they're the single, atomic thing we're trying to find.

As an example, oset.index('hello') should give the index of 'hello' in an
StableSet of strings. It shouldn't give the indexes of each individual
character.
)
isinstancestrtuple)r   s    J/home/wildlama/miniconda3/lib/python3.13/site-packages/orderly_set/sets.py
_is_atomicr    $   s      cC<((    c            	          \ rS rSr% SrSr\\\4   \	S'   S?S\
\\      4S jjrS\4S	 jr\S
\SS4S j5       r\S
\\   S\\   4S j5       r\S
\S\4S j5       rS rS rS rS\S\4S jrS\\   4S jrS\\   4S jrS\4S jr\rS\\   SS4S jrS\ S\!\   S\ 4S jr"S\ S\!\   S\ 4S jr#S\ S\!\   S\ 4S jr$S\ S\!\   S\ 4S jr%S\ S\!\   S\ 4S jr&S\ S\!\   S\ 4S jr'S\(S\4S  jr)S@S! jr*SAS" jr+S\S\4S# jr,\,r-S$\\   S\4S% jr.S&\/S\4S' jr0S(\\/   S\\   4S) jr1\0r2\0r3SBS
\S\4S* jjr4SCS+\4S, jjr5S@S- jr6S&\SS4S. jr7S/\\   SS4S0 jr8S\ S/\\   S\ 4S1 jr9S\ S/\\   S\ 4S2 jr:S\ S\\   S\ 4S3 jr;S/\\   SS4S4 jr<S\\   S\4S5 jr=\=r>S\\   SS4S6 jr?S\\   S\4S7 jr@S\\   S\4S8 jrASDS\S\S9\S\4S: jjrBSDS\S9\S\4S; jjrCS\/4S< jrDS@S= jrES>rFg)Er   7   ac  
A StableSet is a custom MutableSet that remembers its insertion order.
Featuring: Fast O(1) insertion, deletion, iteration and membership testing.
But slow O(N) Index Lookup.

StableSet is meant to be a drop-in replacement for `set` when iteration in insertion order
is the only additional requirement over the built-in `set`.

Equality: StableSet, like `set` and `dict_keys` [dict.keys()], and unlike OrderdSet,
disregards the items order when checking equality.
Like `set` it may be equal only to other instances of AbstractSet
(like `set`, `dict_keys` or StableSet).

This implementation of StableSet is based on the built-in dict type.
In Python 3.6 and later, the built-in dict type is inherently ordered.
If you ignore the dictionary values, that also gives you a simple ordered set,
with fast O(1) insertion, deletion, iteration and membership testing.
However, dict does not provide the list-like random access features of StableSet.
So we have to convert it to a list in O(N) to look up the index of an entry
or look up an entry by its index.

Example:
    >>> StableSet([1, 1, 2, 3, 2])
    StableSet([1, 2, 3])
)_map_is_mutabler$   Ninitialc                 X    U(       a  [         R                  U5      O0 U l        SU l        g NT)dictfromkeysr$   r%   selfr&   s     r   __init__StableSet.__init__V   s    .5DMM'*2	r!   r   c                 6    U R                   R                  5       $ )z
Returns the number of unique elements in the ordered set

Example:
    >>> len(StableSet([]))
    0
    >>> len(StableSet([1, 2]))
    2
)r$   __len__r,   s    r   r0   StableSet.__len__Z   s     yy  ""r!   indexStableSet[T]c                     g N r,   r3   s     r   __getitem__StableSet.__getitem__f       r!   c                     g r6   r7   r8   s     r   r9   r:   j   r;   r!   c                     g r6   r7   r8   s     r   r9   r:   n   r;   r!   c                    [        U[        5      (       aZ  US:  a  [        U R                  5      U-   n [	        [
        R                  " U R                  R                  5       XS-   5      5      $ [        U[        5      (       a  U[        :X  a  U R                  5       $ [        U R                  R                  5       5      n[        U[        5      (       a  U Vs/ s H  o2U   PM	     sn$ [        U[        5      (       d  [        US5      (       a,  X!   n[        U[        5      (       a  U R!                  U5      $ U$ [#        SU 35      e! [         a    [        SU S35      ef = fs  snf )a  
Get the item at a given index.

If `index` is a slice, you will get back that slice of items, as a
new StableSet.

If `index` is a list or a similar iterable, you'll get a list of
items corresponding to those indices. This is similar to NumPy's
"fancy indexing". The result is not a StableSet because you may ask
for duplicate indices, and the number of elements returned should be
the number of elements asked for.

Example:
    >>> oset = StableSet([1, 2, 3])
    >>> oset[1]
    2
r      zindex z out of range	__index__z'Don't know how to index a StableSet by )r   intlenr$   next	itertoolsislicekeysStopIteration
IndexErrorslice	SLICE_ALLcopylistr   hasattr	__class__	TypeErrorr,   r3   itemsiresults        r   r9   r:   s   s1   $ eS!!qyDII.@I,,TYY^^-=uaiPQQ u%%%9*<99;TYY^^%&eX&&&+,e!He,,u%%)D)D\F&$''~~f--EeWMNN ! @ 6%!>??@ -s   :E E)E&c                 8    [        U 5      S:X  a  g[        U 5      $ )Nr   r6   )rB   rL   r1   s    r   __getstate__StableSet.__getstate__   s    t9> :r!   c                 V    US:X  a  U R                  / 5        g U R                  U5        g )Nr6   )r-   )r,   states     r   __setstate__StableSet.__setstate__   s"    GMM"MM% r!   keyc                 8    U R                   R                  U5      $ )z
Test if the item is in this ordered set.

Example:
    >>> 1 in StableSet([1, 3, 2])
    True
    >>> 5 in StableSet([1, 3, 2])
    False
)r$   __contains__r,   r[   s     r   r]   StableSet.__contains__   s     yy%%c**r!   c                 R    U R                   R                  5       R                  5       $ )zA
Example:
    >>> list(iter(StableSet([1, 2, 3])))
    [1, 2, 3]
)r$   rF   __iter__r1   s    r   ra   StableSet.__iter__   s     yy~~((**r!   c                 H    [        U R                  R                  5       5      $ )zb
Supported from Python >= 3.8
Example:
    >>> list(reversed(StableSet([1, 2, 3])))
    [3, 2, 1]
)reversedr$   rF   r1   s    r   __reversed__StableSet.__reversed__   s     		())r!   c                     U (       d  U R                   R                   S3$ U R                   R                   S[        U 5      < S3$ Nz()())rN   __name__rL   r1   s    r   __repr__StableSet.__repr__   s?    nn--.b11..))*!DJ>;;r!   otherc                 $    U R                  U5      $ r6   )intersectionr,   rn   s     r   __and__StableSet.__and__   s      ''r!   r,   c                   ^ [        [        U [        5      (       a  U O[        T[        5      (       a  TO[        5      n[        T[        5      (       d#  [        T[        5      (       d  [
        $ U" T5      mU" U4S jU  5       5      $ )Nc              3   6   >#    U  H  oT;  d  M
  Uv   M     g 7fr6   r7   ).0valuern   s     r   	<genexpr>$StableSet.__sub__.<locals>.<genexpr>   s     AdU5.@55d   		typer   r   r   r   NotImplementedr,   rn   clss    ` r   __sub__StableSet.__sub__   sr    $	**  %++ 
 %%%eX..%%JEAdAAAr!   c                   ^  [        [        T [        5      (       a  T O[        U[        5      (       a  UO[        5      n[        U[        5      (       d#  [        U[        5      (       d  [
        $ U" U5      nU" U 4S jU 5       5      $ )Nc              3   6   >#    U  H  oT;  d  M
  Uv   M     g 7fr6   r7   )rv   rw   r,   s     r   rx   %StableSet.__rsub__.<locals>.<genexpr>   s     AeUD/@55erz   r{   r~   s   `  r   __rsub__StableSet.__rsub__   sr    $	**  %++ 
 %%%eX..%%JEAeAAAr!   c                     [        [        U [        5      (       a  U O[        U[        5      (       a  UO[        5      n[        U[        5      (       d  [        $ S X4 5       nU" U5      $ )Nc              3   6   #    U  H  o  H  o"v   M     M     g 7fr6   r7   rv   ses      r   rx   #StableSet.__or__.<locals>.<genexpr>       5Mq1a1M   r|   r   r   r   r}   r,   rn   r   chains       r   __or__StableSet.__or__   s`    $	**  %++ 
 %**!!5TM55zr!   c                     [        [        U [        5      (       a  U O[        U[        5      (       a  UO[        5      n[        U[        5      (       d  [        $ S X4 5       nU" U5      $ )Nc              3   6   #    U  H  o  H  o"v   M     M     g 7fr6   r7   r   s      r   rx   $StableSet.__ror__.<locals>.<genexpr>  r   r   r   r   s       r   __ror__StableSet.__ror__  s`    $	**  %++ 
 %**!!5UM55zr!   c                 J    [        U[        5      (       d  [        $ X-
  X-
  -  $ r6   r   r   r}   rq   s     r   __xor__StableSet.__xor__  s$    %**!!..r!   c                 J    [        U[        5      (       d  [        $ X-
  X-
  -  $ r6   r   rq   s     r   __rxor__StableSet.__rxor__  s$    %**!!..r!   c                 \   [        U[        5      (       d  g[        U R                  5      [        U5      :w  a  g[        U[        5      (       a  U R                  UR                  :H  $ [        U[
        5      (       d  [        U5      n[        U R                  R                  5       5      U:H  $ NF)r   r   rB   r$   r   rL   rF   rq   s     r   __eq__StableSet.__eq__  sz    %**tyy>SZ'eY''99

**%&&KEDIINN$%..r!   c                 l    U R                   SL a  [        S5      eU R                  R                  5         g)z'
Remove all items from this StableSet.
FThis object is not mutable.N)r%   
ValueErrorr$   clearr1   s    r   r   StableSet.clear)  s,     u$:;;		r!   c                 $    U R                  U 5      $ )z
Return a shallow copy of this object.

Example:
    >>> this = StableSet([1, 2, 3])
    >>> other = this.copy()
    >>> this == other
    True
    >>> this is other
    False
)rN   r1   s    r   rK   StableSet.copy2  s     ~~d##r!   c                     U R                   SL a  [        S5      eSU R                  U'   [        U R                  5      S-
  $ )z
Add `key` as an item to this StableSet, then return its index.

If `key` is already in the StableSet, return the index it already
had.

Example:
    >>> oset = StableSet()
    >>> oset.append(3)
    0
    >>> print(oset)
    StableSet([3])
Fr   Nr?   )r%   r   r$   rB   r^   s     r   addStableSet.addC  s>     u$:;;		#499~!!r!   sequencec                     U R                   SL a  [        S5      e[        R                  U5      nU R                  R                  U5        [        U R                  5      S-
  $ )z
Update the set with the given iterable sequence, then return the index
of the last element inserted.

Example:
    >>> oset = StableSet([1, 2, 3])
    >>> oset.update([3, 1, 5, 1, 4])
    4
    >>> print(oset)
    StableSet([1, 2, 3, 5, 4])
Fr   r?   )r%   r   r)   r*   r$   updaterB   )r,   r   	other_maps      r   r   StableSet.updateY  sQ     u$:;;MM(+			#499~!!r!   rw   c                      [        U R                  R                  5       5       H  u  p#X1:X  d  M  Us  $    [        U5      e! [         a    [        U5      ef = fz
Get the index of a given entry, raising an IndexError if it's not present

`key` can be an iterable of entries that is not a string, in which case
this returns a list of indices.

Example:
    >>> oset = StableSet([1, 2, 3])
    >>> oset.index(2)
    1
)	enumerater$   rF   KeyErrorr   )r,   rw   r3   items       r   r3   StableSet.indexm  sR    	"()9:= L  ; 5/! 	"5/!	"s   +A A A ArF   c                 N    U Vs/ s H  o R                  U5      PM     sn$ s  snf r6   r3   r,   rF   subkeys      r   indexesStableSet.indexes  !    156v

6"666   "c                    U R                   SL a  [        S5      eU R                  (       d  [        S5      eUS:X  a  U R                  R	                  5       u  p#U$ US:X  a-  [        [        U R                  R                  5       5      5      nO;[        [        R                  " U R                  R                  5       XS-   5      5      nU R                  R                  U5        U$ )z
Remove and return item at index (default last).

Raises KeyError if the set is empty.
Raises IndexError if index is out of range.

Example:
    >>> oset = StableSet([1, 2, 3])
    >>> oset.pop()
    3
Fr   Set is emptyr   r?   )r%   r   r$   r   popitemrC   iterrF   rD   rE   pop)r,   r3   elem_s       r   r   StableSet.pop  s     u$:;;yy>**B;ii'')GDKaZTYY^^-./D	(()95!)LMD		dr!   lastc                 J   U R                   SL a  [        S5      eU R                  (       d  [        S5      eU(       a  U R                  R	                  5       u  p#U$ [        [        U R                  R                  5       5      5      nU R                  R                  U5        U$ )zqRemove and return an item from the set.
Items are returned in LIFO order if last is true or FIFO order if false.
Fr   r   )	r%   r   r$   r   r   rC   r   rF   r   )r,   r   r   r   s       r   r   StableSet.popitem  s{     u$:;;yy>**ii'')GDKD)*+		dr!   c                     U R                   SL a  [        S5      eU R                  R                  U5        SU R                  U'   g)zSMove an existing element to the end.
Raise KeyError if the element does not exist.
Fr   Nr%   r   r$   r   r^   s     r   move_to_endStableSet.move_to_end  s;     u$:;;		c		#r!   c                 p    U R                   SL a  [        S5      eU R                  R                  US5        g)au  
Remove an element.  Do not raise an exception if absent.

The MutableSet mixin uses this to implement the .remove() method, which
*does* raise an error when asked to remove a non-existent item.

Example:
    >>> oset = StableSet([1, 2, 3])
    >>> oset.discard(2)
    >>> print(oset)
    StableSet([1, 3])
    >>> oset.discard(2)
    >>> print(oset)
    StableSet([1, 3])
Fr   Nr   r,   rw   s     r   discardStableSet.discard  s0      u$:;;		eT"r!   setsc                     [        [        U [        5      (       a  U O[        5      n[        [        [
        R                  " U /U5      5      n[
        R                  R                  U5      nU" U5      $ )aX  
Combines all unique items.
Each item order is defined by its first appearance.

Example:
    >>> oset = StableSet.union(StableSet([3, 1, 4, 1, 5]), [1, 3], [2, 0])
    >>> print(oset)
    StableSet([3, 1, 4, 5, 2, 0])
    >>> oset.union([8, 9])
    StableSet([3, 1, 4, 5, 2, 0, 8, 9])
    >>> oset | {10}
    StableSet([3, 1, 4, 5, 2, 0, 10])
)r|   r   r   maprL   itr   from_iterable)r,   r   r   
containersrQ   s        r   unionStableSet.union  sS     :dI664IFrxx56
&&z25zr!   c                    ^ [        [        U [        5      (       a  U O[        5      nU nU(       a-  [        R                  " [        [        U5      6 mU4S jU  5       nU" U5      $ )aR  
Returns elements in common between all sets. Order is defined only
by the first set.

Example:
    >>> oset = StableSet.intersection(StableSet([0, 1, 2, 3]), [1, 2, 3])
    >>> print(oset)
    StableSet([1, 2, 3])
    >>> oset.intersection([2, 4, 5], [1, 2, 3, 4])
    StableSet([2])
    >>> oset.intersection()
    StableSet([1, 2, 3])
c              3   6   >#    U  H  oT;   d  M
  Uv   M     g 7fr6   r7   )rv   r   commons     r   rx   )StableSet.intersection.<locals>.<genexpr>  s     =ddfnTTdrz   )r|   r   r   setrp   r   )r,   r   r   rQ   r   s       @r   rp   StableSet.intersection  sO     :dI664IF#'%%s3~6F=d=E5zr!   c                    ^ [        [        U [        5      (       a  U O[        5      nU nU(       a-  [        R                  " [        [        U5      6 mU4S jU  5       nU" U5      $ )ay  
Returns all elements that are in this set but not the others.

Example:
    >>> StableSet([1, 2, 3]).difference(StableSet([2]))
    StableSet([1, 3])
    >>> StableSet([1, 2, 3]).difference(StableSet([2]), StableSet([3]))
    StableSet([1])
    >>> StableSet([1, 2, 3]) - StableSet([2])
    StableSet([1, 3])
    >>> StableSet([1, 2, 3]).difference()
    StableSet([1, 2, 3])
c              3   6   >#    U  H  oT;  d  M
  Uv   M     g 7fr6   r7   rv   r   rn   s     r   rx   'StableSet.difference.<locals>.<genexpr>  s     @dd%.?TTdrz   )r|   r   r   r   r   r   )r,   r   r   rQ   rn   s       @r   
differenceStableSet.difference  sM     :dI664IF#'IIs3~.E@d@E5zr!   c                     [        [        U [        5      (       a  U O[        U[        5      (       a  UO[        5      nU" U 5      R                  U5      nU" U5      R                  U 5      nUR	                  U5      $ )a  
Return the symmetric difference of two StableSets as a new set.
That is, the new set will contain all elements that are in exactly
one of the sets.

Their order will be preserved, with elements from `self` preceding
elements from `other`.

Example:
    >>> this = StableSet([1, 4, 3, 5, 7])
    >>> other = StableSet([9, 7, 1, 3, 2])
    >>> this.symmetric_difference(other)
    StableSet([4, 5, 9, 2])
)r|   r   r   r   r   )r,   rn   r   diff1diff2s        r   symmetric_differenceStableSet.symmetric_difference  sp     $	**  %++ 
 D	$$U+E
%%d+{{5!!r!   c                     U R                   SL a  [        S5      e[        5       nU H  n[        U5      nX$-  nM     [        R	                  U R
                   Vs/ s H  oUU;  d  M
  UPM     sn5      U l        gs  snf )ak  
Update this StableSet to remove items from one or more other sets.

Example:
    >>> this = StableSet([1, 2, 3])
    >>> this.difference_update(StableSet([2, 4]))
    >>> print(this)
    StableSet([1, 3])

    >>> this = StableSet([1, 2, 3, 4, 5])
    >>> this.difference_update(StableSet([2, 4]), StableSet([1, 4, 6]))
    >>> print(this)
    StableSet([3, 5])
Fr   Nr%   r   r   r)   r*   r$   r,   r   items_to_removern   items_as_setr   s         r   difference_updateStableSet.difference_update)  sp     u$:;;%Eu:L+O  MM"iiGid+FTiG
	Gs   	A:'A:c                     U R                   SL a  [        S5      e[        U5      n[        R	                  U R
                   Vs/ s H  o"U;   d  M
  UPM     sn5      U l        U $ s  snf )a+  
Update this StableSet to keep only items in another set, preserving
their order in this set.

Example:
    >>> this = StableSet([1, 4, 3, 5, 7])
    >>> other = StableSet([9, 7, 1, 3, 2])
    >>> this.intersection_update(other)
    StableSet([1, 3, 7])
    >>> print(this)
    StableSet([1, 3, 7])
Fr   r   r,   rn   r   s      r   intersection_updateStableSet.intersection_updateC  sY     u$:;;E
MMDII"OID4I"OP	 #Ps   	A$A$c                    U R                   SL a  [        S5      eU Vs/ s H  o"U ;  d  M
  UPM     nn[        U5      n[        R	                  U R
                   Vs/ s H  o"U;  d  M
  UPM     snU-   5      U l        gs  snf s  snf )a=  
Update this StableSet to remove items from another set, then
add items from the other set that were not present in this set.

Example:
    >>> this = StableSet([1, 4, 3, 5, 7])
    >>> other = StableSet([9, 7, 1, 3, 2])
    >>> this.symmetric_difference_update(other)
    >>> print(this)
    StableSet([4, 5, 9, 2])
Fr   Nr   r,   rn   r   items_to_addr   s        r   symmetric_difference_update%StableSet.symmetric_difference_updateX  s|     u$:;;).Cd2BCe*MM"iiGid+FTiG,V
	 D Hs   	A?A?	B)Bc                 `   ^ [        U 5      [        T5      :  a  g[        U4S jU  5       5      $ )z
Report whether another set contains this set.

Example:
    >>> StableSet([1, 2, 3]).issubset({1, 2})
    False
    >>> StableSet([1, 2, 3]).issubset({1, 2, 3, 4})
    True
    >>> StableSet([1, 2, 3]).issubset({1, 4, 3, 5})
    False
Fc              3   ,   >#    U  H	  oT;   v   M     g 7fr6   r7   r   s     r   rx   %StableSet.issubset.<locals>.<genexpr>z  s     2TT5=T   rB   allrq   s    `r   issubsetStableSet.issubsetl  s)     t9s5z!2T222r!   c                 `   ^  [        T 5      [        U5      :  a  g[        U 4S jU 5       5      $ )z
Report whether this set contains another set.

Example:
    >>> StableSet([1, 2]).issuperset([1, 2, 3])
    False
    >>> StableSet([1, 2, 3, 4]).issuperset({1, 2, 3})
    True
    >>> StableSet([1, 4, 3, 5]).issuperset({1, 2, 3})
    False
Fc              3   ,   >#    U  H	  oT;   v   M     g 7fr6   r7   )rv   r   r,   s     r   rx   'StableSet.issuperset.<locals>.<genexpr>  s     2ED4<Er  r  rq   s   ` r   
issupersetStableSet.issuperset|  s)     t9s5z!2E222r!   non_consecutivec                     [        U 5      [        U5      :  a  gU(       a-  Sn[        U 5      nU H  nXPU   :X  d  M  US-  nX4:X  d  M    g   g[        X5       H  u  peXe:X  a  M    g   gNFr   r?   TrB   zipr,   rn   r  rR   self_len
other_item	self_items          r   isorderedsubsetStableSet.isorderedsubset  p    t9s5z!A4yH#
a(FA}#	 $
 ),T)9%	 .  *: r!   c                 .    [         R                  XU5      $ r6   r   r  r,   rn   r  s      r   isorderedsupersetStableSet.isorderedsuperset      ((oFFr!   c                 >    [        [        U R                  5      5      $ r6   )rC   r   r$   r1   s    r   getStableSet.get  s    DO$$r!   c                     SU l         g)z9
Once this function is run, the object becomes immutable
FN)r%   r1   s    r   freezeStableSet.freeze  s     !r!   )r%   r$   r6   r   N)r   r4   r   TF)Grk   
__module____qualname____firstlineno____doc__	__slots__r   r   r   __annotations__r
   SetInitializerr-   rA   r0   r   rI   r9   r   r   rU   rY   boolr]   r   ra   re   r   rl   __str__SetLikerr   r   r   r   r   r   r   r   r   objectr   r   rK   r   appendr   r   r3   r   get_locget_indexerr   r   r   r   r   rp   r   r   r   r   __iand__r   r  r	  r  r  r  r!  __static_attributes__r7   r!   r   r   r   7   s   4 (I
q#v, ): ;  
# 
#  >   # 47      %OT
!+ + ++(1+ +*hqk *<# <
 G(WQZ (N (Ba BA B1 BBq BQ BA BQ {1~ ! a A 1 /a /A /1 /
/q /Q /A /
	/F 	/t 	/$""q "S "( F"wqz "c "("8 " "(7DN 7tCy 7 GK a 6D  #Q #4 #*71: . &1 WQZ A * 71: ! *"1 "WQZ "A "4
wqz 
d 
4  & #H
 
 
(3gaj 3T 3 3
 3t 3 g g  Y] $Gw G GRV G%X %!r!   c                   L    \ rS rSrSrS rS rS r\rS r	S r
S rS	 rS
 rSrg)
OrderlySeti  z
OrderlySet keeps the order when adding but if you do difference, subtraction, etc, you lose the order.
The new results will have a random order but they will keep that order.
c                     [        U[        [        45      (       a  UO
[        U5      n[        U 5      U-
  n[        U5      $ r6   r   r   	frozensetr8  r,   rn   rS   s      r   r   OrderlySet.__sub__  7    #EC+;<<#e*TU"&!!r!   c                     [        U[        [        45      (       a  UO
[        U5      nU[        U 5      -
  n[        U5      $ r6   r:  r<  s      r   r   OrderlySet.__rsub__  s7    #EC+;<<#e*T"&!!r!   c                     [        U[        [        45      (       a  UO
[        U5      n[        U 5      U-  n[        U5      $ r6   r:  r<  s      r   r   OrderlySet.__xor__  r>  r!   c                 h   [        U[        5      (       d  g[        U R                  5      [        U5      :w  a  g[        U[        5      (       a  U R                  UR                  :H  $ [        U[
        [        45      (       d  [        U5      n[        U R                  R                  5       5      U:H  $ r   )r   r   rB   r$   r   r   r;  rF   rq   s     r   r   OrderlySet.__eq__  s    %**tyy>SZ'eY''99

**%#y!122JE499>>#$--r!   c                    [        U[        5      (       d  g[        U R                  5      [        U5      :  a  g[        U[        [
        45      (       d  [	        U5      n[	        U R                  R                  5       5      U:  $ r   r   r   rB   r$   r   r;  rF   rq   s     r   __ge__OrderlySet.__ge__  _    %**tyy>CJ&%#y!122JE499>>#$--r!   c                    [        U[        5      (       d  g[        U R                  5      [        U5      ::  a  g[        U[        [
        45      (       d  [	        U5      n[	        U R                  R                  5       5      U:  $ r   rF  rq   s     r   __gt__OrderlySet.__gt__  _    %**tyy>SZ'%#y!122JE499>>#$u,,r!   c                    [        U[        5      (       d  g[        U R                  5      [        U5      :  a  g[        U[        [
        45      (       d  [	        U5      n[	        U R                  R                  5       5      U:*  $ r   rF  rq   s     r   __le__OrderlySet.__le__  rI  r!   c                    [        U[        5      (       d  g[        U R                  5      [        U5      :  a  g[        U[        [
        45      (       d  [	        U5      n[	        U R                  R                  5       5      U:  $ r   rF  rq   s     r   __lt__OrderlySet.__lt__  rM  r!   r7   N)rk   r'  r(  r)  r*  r   r   r   r   r   rG  rK  rO  rR  r6  r7   r!   r   r8  r8    s6    
"
"
"
 H	..-.-r!   r8  c                   z    \ rS rSrSrS\S\4S jrS\\	   4S jr
S\\	   4S jrS\\	   4S jrS\\	   4S	 jrS
rg)StableSetEqi  a{  
StableSetEq is a StableSet with a modified quality operator.

StableSetEq, like `set` and `dict_keys` [dict.keys()], and unlike OrderdSet,
disregards the items order when checking equality.
Unlike StableSet, `set`, or `dict_keys` - A StableSetEq can also equal be equal to a Sequence:
`StableSet([1, 2]) == [1, 2]` and `StableSet([1, 2]) == [2, 1]`; but `set([1, 2]) != [1, 2]`
rn   r   c                     [        U[        5      (       d   [        U5      nU R                  R                  5       U:H  $ ! [         a     gf = f)a  
Returns true even if the containers don't have the same items in order.

Example:
    >>> oset = StableSetEq([1, 3, 2])
    >>> oset == [1, 3, 2]
    True
    >>> oset == [1, 2, 3]
    True
    >>> oset == [2, 3]
    False
    >>> oset == StableSetEq([3, 2, 1])
    True
F)r   r   r   rO   r$   rF   rq   s     r   r   StableSetEq.__eq__  sK     %--E
 yy~~5((  s   ? 
AAc                     [        U 5      [        U5      :*  =(       aX    [        U[        5      (       a  U R                  R	                  5       U:*  $ U R                  R	                  5       [        U5      :*  $ r6   rB   r   r   r$   rF   r   rq   s     r   rO  StableSetEq.__le__  \    4yCJ& 
%-- IINN%	
 !SZ/	
r!   c                     [        U 5      [        U5      :  =(       aX    [        U[        5      (       a  U R                  R	                  5       U:  $ U R                  R	                  5       [        U5      :  $ r6   rY  rq   s     r   rR  StableSetEq.__lt__  \    4y3u:% 
%-- IINNu$	
 !CJ.	
r!   c                     [        U 5      [        U5      :  =(       aX    [        U[        5      (       a  U R                  R	                  5       U:  $ U R                  R	                  5       [        U5      :  $ r6   rY  rq   s     r   rG  StableSetEq.__ge__!  r[  r!   c                     [        U 5      [        U5      :  =(       aX    [        U[        5      (       a  U R                  R	                  5       U:  $ U R                  R	                  5       [        U5      :  $ r6   rY  rq   s     r   rK  StableSetEq.__gt__(  r^  r!   r7   N)rk   r'  r(  r)  r*  r   r.  r   r0  r   rO  rR  rG  rK  r6  r7   r!   r   rU  rU    sZ    )C )D ).
GAJ 

GAJ 

GAJ 

GAJ 
r!   rU  c                      \ rS rSr% SrSr\\   \S'   S&S\	\
\      4S jjrS rS	\S
\4S jrS	\\   4S jrS	\\   4S jrS	\\   4S jrS	\\   4S jrS'S jrS\S
\4S jrS\\   S
\4S jrS\S
\4S jrS\\   S
\\   4S jrS(S\S
\4S jjrS)S\4S jjrS rS\S
S4S jrS\ S
S4S  jr!S!\\   S
S4S" jr"S	\\   S
\4S# jr#\#r$S	\\   S
S4S$ jr%S%r&g)*
OrderedSeti0  a  
An OrderedSet is a mutable data structure that is a hybrid of a list and a set.
It remembers its insertion order so that every entry has an index that can be looked up.
Featuring: O(1) Index lookup, insertion, iteration and membership testing.
But slow O(N) Deletion.
Using OrderedSet over StableSet is advised only if you require fast Index lookup -
Otherwise using StableSet is advised as it is much faster and has a smaller memory footprint.

In some aspects OrderedSet behaves like a `set` and in other aspects it behaves like a list.

Equality: OrderedSet, like `list` and `odict_keys` [OrderdDict.keys()], and unlike OrderdSet,
regards the items order when checking equality.
Unlike `set`, An OrderedSet can also equal be equal to a Sequence:
`StableSet([1, 2]) == [1, 2]` and `StableSet([1, 2]) != [2, 1]`; but `set([1, 2]) != [1, 2]`

The original implementation of OrderedSet was a recipe posted by Raymond Hettiger,
https://code.activestate.com/recipes/576694-orderedset/
Released under the MIT license.
Hettiger's implementation kept its content in a doubly-linked list referenced by a dict.
As a result, looking up an item by its index was an O(N) operation, while deletion was O(1).
This version makes different trade-offs for the sake of efficient lookups.
Its content is a standard Python list instead of a doubly-linked list.
This provides O(1) lookups by index at the expense of O(N) deletion,
as well as slightly faster iteration.

Example:
    >>> OrderedSet([1, 1, 2, 3, 2])
    OrderedSet([1, 2, 3])
)_itemsr%   re  Nr&   c                 >    / U l         0 U l        SU l        Ub  X-  n g g r(   )re  r$   r%   r+   s     r   r-   OrderedSet.__init__S  s,    	 OD	 r!   c                    [        U[        5      (       a  U R                  U   $ [        U[        5      (       a  U[        :X  a  U R                  5       $ [        U[        5      (       a  U Vs/ s H  o R                  U   PM     sn$ [        U[        5      (       d  [        US5      (       a7  U R                  U   n[        U[        5      (       a  U R                  U5      $ U$ [        SU-  5      es  snf )Nr@   z+Don't know how to index an OrderedSet by %r)r   rA   re  rI   rJ   rK   r   rM   rL   rN   rO   )r,   r3   rR   rS   s       r   r9   OrderedSet.__getitem__^  s    eS!!;;u%%u%%%9*<99;x((,12EqKKNE22u%%)D)D[['F&$''~~f--IEQRR 3s   -C3rn   r   c                 
   [        U[        5      (       a6  [        U 5      [        U5      :H  =(       a    U R                  [	        U5      :H  $  [        U5      nU R                  R                  5       U:H  $ ! [         a     gf = f)aF  
Returns true if the containers have the same items.
If `other` is a Sequence, then order is checked, otherwise it is ignored.

Example:
    >>> oset = OrderedSet([1, 3, 2])
    >>> oset == [1, 3, 2]
    True
    >>> oset == [1, 2, 3]
    False
    >>> oset == [2, 3]
    False
    >>> oset == OrderedSet([3, 2, 1])
    False
F)	r   r   rB   re  rL   r   r$   rF   rO   )r,   rn   other_as_sets      r   r   OrderedSet.__eq__n  sr      eX&& t9E
*It{{d5k/II	4u:L
 99>>#|33	  		s   A5 5
BBc                    [        U 5      [        U5      :*  =(       an    [        U[        5      (       a  U R                  R	                  5       U:*  $ [        U[
        5      (       a  U R                  U:*  $ U R                  [        U5      :*  $ r6   rB   r   r   r$   rF   rL   re  rq   s     r   rO  OrderedSet.__le__  w    4yCJ& 
%-- IINN%	
 %&& %	

 U+	
r!   c                    [        U 5      [        U5      :  =(       an    [        U[        5      (       a  U R                  R	                  5       U:  $ [        U[
        5      (       a  U R                  U:  $ U R                  [        U5      :  $ r6   rn  rq   s     r   rR  OrderedSet.__lt__  w    4y3u:% 
%-- IINNu$	
 %&& u$	

 tE{*	
r!   c                    [        U 5      [        U5      :  =(       an    [        U[        5      (       a  U R                  R	                  5       U:  $ [        U[
        5      (       a  U R                  U:  $ U R                  [        U5      :  $ r6   rn  rq   s     r   rG  OrderedSet.__ge__  rp  r!   c                    [        U 5      [        U5      :  =(       an    [        U[        5      (       a  U R                  R	                  5       U:  $ [        U[
        5      (       a  U R                  U:  $ U R                  [        U5      :  $ r6   rn  rq   s     r   rK  OrderedSet.__gt__  rs  r!   c                     U R                   SL a  [        S5      eU R                  S S 2	 U R                  R	                  5         g NFr   )r%   r   re  r$   r   r1   s    r   r   OrderedSet.clear  s5    u$:;;KKN		r!   r[   c                     U R                   SL a  [        S5      eXR                  ;  a=  [        U R                  5      U R                  U'   U R                  R                  U5        U R                  U   $ ry  )r%   r   r$   rB   re  r2  r^   s     r   r   OrderedSet.add  s\    u$:;;ii -DIIcNKKs#yy~r!   r   c                 r    U R                   SL a  [        S5      eSnU H  nU R                  U5      nM     U$ )NFr   r   )r%   r   r   )r,   r   
item_indexr   s       r   r   OrderedSet.update  s>    u$:;;
D$J r!   rw   c                      U R                   U   $ r6   r$   r   s     r   r3   OrderedSet.index  s    yyr!   rF   c                 J    U Vs/ s H  o R                   U   PM     sn$ s  snf r6   r  )r,   rF   r[   s      r   r   OrderedSet.indexes  s     *./$3		#$///s    r3   c                     U R                   SL a  [        S5      eU R                  (       d  [        S5      eU R                  U   nU R                  U	 U R                  U	 U$ )NFr   r   r%   r   re  r   r$   )r,   r3   r   s      r   r   OrderedSet.pop  sX    u$:;;{{>**{{5!KKIIdOr!   r   c                     U R                   SL a  [        S5      eU R                  (       d  [        S5      eU(       a  SOSnU R                  U   nU R                  U	 U R                  U	 U$ )NFr   r   r   r   r  )r,   r   r3   r   s       r   r   OrderedSet.popitem  sa    u$:;;{{>**{{5!KKIIdOr!   c                     U R                   SL a  [        S5      eX;   a#  U R                  U5        U R                  U5        g [	        U5      ery  )r%   r   r   r   r   r^   s     r   r   OrderedSet.move_to_end  sB    u$:;;;LLHHSM3-r!   c                    U R                   SL a  [        S5      eX;   af  U R                  U   nU R                  U	 U R                  U	 U R                  R	                  5        H  u  p4XB:  d  M  US-
  U R                  U'   M      g g )NFr   r?   )r%   r   r$   re  rQ   )r,   r[   rR   kvs        r   r   OrderedSet.discard  sv    u$:;;;		#AA		#		)6#$q5DIIaL *	 r!   rQ   c                 f    Xl         [        U5       VVs0 s H  u  p#X2_M	     snnU l        gs  snnf )z]
Replace the 'items' list of this OrderedSet with a new one, updating
self._map accordingly.
N)re  r   r$   )r,   rQ   idxr   s       r   _update_itemsOrderedSet._update_items  s-    
 2;E2BC2B;CTY2BC	Cs   -r   c                     U R                   SL a  [        S5      e[        5       nU H  n[        U5      nX$-  nM     U R                  U R                   Vs/ s H  oUU;  d  M
  UPM     sn5        g s  snf ry  r%   r   r   r  re  r   s         r   r   OrderedSet.difference_update  sl    u$:;;%Eu:L+O  	"kkIkd-HTkI	
Is   	A1#A1c                     U R                   SL a  [        S5      e[        U5      nU R                  U R                   Vs/ s H  o"U;   d  M
  UPM     sn5        U $ s  snf ry  r  r   s      r   r   OrderedSet.intersection_update  sU    u$:;;E
T[[J[TEMD[JK Ks   	AAc                     U R                   SL a  [        S5      eU Vs/ s H  o"U ;  d  M
  UPM     nn[        U5      nU R                  U R                   Vs/ s H  o"U;  d  M
  UPM     snU-   5        g s  snf s  snf ry  r  r   s        r   r   &OrderedSet.symmetric_difference_update  sx    u$:;;).Cd2BCe*"kkIkd-HTkILX	
 D Js   	A6A6	A;%A;)r%   re  r$   r6   r#  r$  r%  )'rk   r'  r(  r)  r*  r+  r   r   r,  r
   r-  r-   r9   r   r.  r   r0  rO  rR  rG  rK  r   rA   r   r   r   r3   r   r   r   r   r   rL   r  r   r   r5  r   r6  r7   r!   r   rd  rd  0  s|   < *IGO	): ; 	S 4C 4D 48
GAJ 

GAJ 

GAJ 

GAJ 
q S wqz c  8    0DN 0tCy 0	 	a 	
D 
 
)1 
) 
)D4 DD D

wqz 

d 

   #H
 
 
r!   rd  c            	       v   \ rS rSrSS.S jrS rS\4S jr\rS,S jr	S	 r
S
 r\r\rS r\rS r\=rrS r\rS rS rS r\=rrS rS rS rS rS rS rS r \ r!S r"S r#\#r$S r%S r&S r'S r(S r)S r*S  r+S!\,S\-4S" jr.S#\/\,   S\/\0   4S$ jr1\.r2\.r3S-S% jr4S,S&\5S'\5S(\6S\64S) jjr7S,S'\5S(\6S\64S* jjr8S+r9g).	SortedSeti#  Nset_c                \    SU l         S U l        U(       a  Xl        g [        U0 UD6U l        g r(   )r%   _sortedr  r   )r,   r  argskwargss       r   r-   SortedSet.__init__%  s*    IT,V,DIr!   c              #   @   #    U R                  5        S h  vN   g  N7fr6   )_get_sortedr1   s    r   ra   SortedSet.__iter__.  s     ##%%%s   r   c                     U (       d  U R                   R                   S3$ U R                   R                   SU R                  5       < S3$ rh   )rN   rk   r  r1   s    r   r/  SortedSet.__str__1  sE    nn--.b11..))*!D,<,<,>+ACCr!   c                     U R                   c&   [        U R                  US9U l         U R                   $ U R                   $ ! [         a)    [        U R                  S US9U l          U R                   $ f = f)N)reversec                     [        U 5      $ r6   )r   )xs    r   <lambda>'SortedSet._get_sorted.<locals>.<lambda>>  s    s1vr!   )r[   r  )r  sortedr  	Exception)r,   r  s     r   r  SortedSet._get_sorted9  sk    <<X%diiA ||t||  X%dii5EwW||Xs   A   %A32A3c                 >    [        [        U R                  5      5      $ )z
Get a random element
)rC   r   r  r1   s    r   r  SortedSet.getA  s     DO$$r!   c                 2    U R                   U-  n[        US9$ Nr  r  r  r<  s      r   rr   SortedSet.__and__G      U"f%%r!   c                 <    U R                   R                  U5        U $ r6   )r  r   rq   s     r   r   SortedSet.intersection_updateP  s    		%%e,r!   c                 2    U R                   U-  n[        US9$ r  r  r<  s      r   r   SortedSet.__or__V  r  r!   c                 2    U R                   U-
  n[        US9$ r  r  r<  s      r   r   SortedSet.__sub__]  r  r!   c                 D    S U l         U R                  R                  " U6   g r6   )r  r  r   )r,   r   s     r   r   SortedSet.difference_updated  s    		##T*r!   c                 8    U R                   R                  U5      $ r6   )r  
isdisjointrq   s     r   r  SortedSet.isdisjointh      yy##E**r!   c                 2    U R                   U-  n[        US9$ r  r  r<  s      r   r   SortedSet.__xor__k  r  r!   c                 H    S U l         U R                  R                  U5        g r6   )r  r  r   rq   s     r   r   %SortedSet.symmetric_difference_updater  s    		--e4r!   c                 0    XR                   -
  n[        US9$ r  r  r<  s      r   r   SortedSet.__rsub__v  s    "f%%r!   c                 H    S U l         U R                  R                  U5        g r6   )r  r  r   r,   r   s     r   r   SortedSet.addz  s    		dr!   c                 F    S U l         U R                  R                  5         g r6   )r  r  r   r1   s    r   r   SortedSet.clear~  s    		r!   c                 H    S U l         U R                  R                  U5        g r6   )r  r  r   r^   s     r   r   SortedSet.discard  s    		#r!   c                 :    [        [        U R                  5      S9$ r  )r  r   r  r1   s    r   rK   SortedSet.copy  s    c$))n--r!   c                 8    U R                   R                  U5      $ r6   )r  r  rq   s     r   rO  SortedSet.__le__  s    yy!!%((r!   c                      U R                   U:  $ r6   r  rq   s     r   rR  SortedSet.__lt__      yy5  r!   c                 8    U R                   R                  U5      $ r6   )r  r	  rq   s     r   rG  SortedSet.__ge__  r  r!   c                      U R                   U:  $ r6   r  rq   s     r   rK  SortedSet.__gt__  r  r!   c                 H    S U l         U R                  R                  U5        g r6   )r  r  remover^   s     r   r  SortedSet.remove  s    		r!   c                 H    S U l         U R                  R                  U5        g r6   )r  r  r   )r,   r   s     r   r   SortedSet.update  s    		"r!   c                 R    U R                   (       a  [        U R                   5      $ S$ )Nr   )r  rB   r1   s    r   r0   SortedSet.__len__  s    !%s499~11r!   c                 :   [        U[        5      (       d  g[        U R                  5      [        U5      :w  a  g[        U[        5      (       a  U R                  UR                  :H  $ [        U[
        [        45      (       d  [        U5      nU R                  U:H  $ r   )r   r   rB   r  r  r   r;  rq   s     r   r   SortedSet.__eq__  ss    %**tyy>SZ'eY''99

**%#y!122JEyyE!!r!   c                 f    U R                   c  U R                  5         [        U R                   5      $ r6   )r  r  rd   r1   s    r   re   SortedSet.__reversed__  s'    <<%%r!   c                    U R                  5       n[        U[        5      (       a  X!   $ [        U[        5      (       a  U[        :X  a  U R                  5       $ [        U[        5      (       a  U Vs/ s H  o2U   PM	     sn$ [        U[        5      (       d  [        US5      (       a,  X!   n[        U[        5      (       a  U R                  U5      $ U$ [        SU 35      es  snf )Nr@   z'Don't know how to index a SortedSet by )r  r   rA   rI   rJ   rK   r   rM   rL   rN   rO   rP   s        r   r9   SortedSet.__getitem__  s      "eS!!<u%%%9*<99;eX&&&+,e!He,,u%%)D)D\F&$''~~f--EeWMNN -s   2C#r[   c                 <   U R                  5       n [        U[        5      (       a1  [        U5      (       d!  U Vs/ s H  o0R	                  U5      PM     sn$ [        U5       H  u  pEXQ:X  d  M  Us  $    [        U5      es  snf ! [         a    [        U5      ef = fr   )r  r   r   r    r3   r   r   r   )r,   r[   rQ   r   r3   r   s         r   r3   SortedSet.index  s       "	 #x((C9<=v

6*==(/; L  0 3-	 >
  	 3-	 s(   )B B B B /B 3B BrF   c                 N    U Vs/ s H  o R                  U5      PM     sn$ s  snf r6   r   r   s      r   r   SortedSet.indexes  r   r   c                     Uc!  S U l         U R                  R                  5       $ U R                  5       nUR                  U5      nU R                  R	                  U5        U$ r6   )r  r  r   r  r  )r,   r3   rQ   rS   s       r   r   SortedSet.pop  sQ    =DL99==?"  "5!		 r!   r,   rn   r  c                     [        U 5      [        U5      :  a  gU(       a-  Sn[        U 5      nU H  nXPU   :X  d  M  US-  nX4:X  d  M    g   g[        X5       H  u  peXe:X  a  M    g   gr  r  r  s          r   r  SortedSet.isorderedsubset  r  r!   c                 .    [         R                  XU5      $ r6   r  r  s      r   r  SortedSet.isorderedsuperset  r  r!   )r%   r  r  r&  r6   ):rk   r'  r(  r)  r-   ra   r   r/  rl   r  r  rr   rp   __rand__r   r5  r   r   r   r   r   r   r  r   r   r   r   r   r   r   r   rK   rO  r  rR  rG  r	  rK  r  r   r0   r   re   r9   r   r   r3   r   rA   r   r3  r4  r   r0  r.  r  r  r6  r7   r!   r   r  r  #  si   #' -&D D H%&
 LH #H&
 EG&
 J++&
 '.-85&.) H!+ J!#2	"&
O$   c  .7DN 7tCy 7 GKg g  Y] $Gw G GRV G Gr!   r  c                       \ rS rSrSrSS\S\\   SS4S jjrS\S\	4S	 jr
S
\SS4S jrS\S\	4S jrS\4S jrS\\   4S jrS\4S jrSrg)RoughMaxSizeSeti  u   
A set-like container with a “soft” maximum size. When size exceeds
max_size + eviction_batch, it evicts oldest items down to max_size.
Nmax_sizeeviction_batchr   c                     Xl         U=(       d    [        US-  S5      U l        [        5       U l        [        5       U l        g)z
:param max_size: Target size you generally want to stay under.
:param eviction_batch: How many over-max to tolerate before trimming
                       (defaults to 10% of max_size, minimum 1).

   r?   N)r  maxr  r   _dqr   _set)r,   r  r  s      r   r-   RoughMaxSizeSet.__init__
  s3     &#1#KSR5K"WE	r!   r   c                 &   XR                   ;   a  gU R                  R                  U5        U R                   R                  U5        [	        U R                   5      U R
                  U R                  -   :  a  U R                  U R
                  5        g)zN
Add item if not present.
:returns: True if inserted, False if already there.
FT)r  r  r2  r   rB   r  r  _evict_to_sizer  s     r   r   RoughMaxSizeSet.add  se    
 99		dtyy>DMMD,?,???.r!   target_sizec                     [        U R                  5      U:  aQ  U R                  R                  5       nU R                  R	                  U5        [        U R                  5      U:  a  MP  gg)z=
Pop oldest items until our set is back down to target_size.
N)rB   r  r  popleftr   )r,   r  olds      r   r   RoughMaxSizeSet._evict_to_size"  sJ     $))n{*XX%%'CIIc" $))n{*r!   c                     XR                   ;   $ r6   )r  r  s     r   r]   RoughMaxSizeSet.__contains__*  s    yy  r!   c                 ,    [        U R                  5      $ r6   )rB   r  r1   s    r   r0   RoughMaxSizeSet.__len__-  s    499~r!   c                 ,    [        U R                  5      $ )zL
Iteration order is arbitrary (follows set iteration), not insertion order.
)r   r  r1   s    r   ra   RoughMaxSizeSet.__iter__0  s     DIIr!   c                 ~    U R                   R                   S[        U R                  5      < SU R                  < S3$ )Nri   z, max_size=rj   )rN   rk   rL   r  r  r1   s    r   rl   RoughMaxSizeSet.__repr__6  s9    ~~&&'qDHH~ DMM+<A?	
r!   )r  r  r  r  r6   )rk   r'  r(  r)  r*  rA   r
   r-   r   r.  r   r   r]   r0   r   ra   r   rl   r6  r7   r!   r   r  r    s    
	" 	"hsm 	"t 	" d ## #$ #! !t ! (1+ 
# 
r!   r  )%rD   r   typingr   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   collectionsr   rI   rJ   r   r   r   r0  r-  r1  r.  r    r   r8  rU  rd  r  r  r7   r!   r   <module>r     s        $  $K	CLC{#Cx  A+
,{1~x{HQK?@)F )t )&q	!
1x{ q	!hD-1 D-N;
)A, ;
|p
1 p
f]G ]GB6
gaj 6
r!   