Ë
    ålÖiÛ©  ã                   ó¤  — d dl Z d dl Zd dlmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZ d dlmZ  ed«      Z ed«      Z edd¬«      Z ede¬«      Zeee   ee   f   Zeee   ee   ee   f   Zd	ed
efd„Z G d„ de	e   ee   «      Z G d„ dee   «      Z  G d„ dee   «      Z! G d„ dee   «      Z" G d„ d«      Z# G d„ dee   «      Z$y)é    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                 ó.   — t        | t        t        f«      S )ay  
    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    úU/var/www/html/strategist-ai/venv_dbt/lib/python3.12/site-packages/orderly_set/sets.pyÚ
_is_atomicr    $   s   € ô  �cœC¤˜<Ó(Ð(ó    c            	       ó‚  — e Zd ZU dZdZeeef   ed<   d=de	e
e      fd„Zdefd„Zed	edd
fd„«       Zed	ee   dee   fd„«       Zed	edefd„«       Zd„ Zd„ Zd„ Zdedefd„Zdee   fd„Zdee   fd„Zdefd„ZeZdee   dd
fd„Zdede e   defd„Z!dede e   defd„Z"dede e   defd„Z#dede e   defd„Z$dede e   defd„Z%dede e   defd„Z&de'defd„Z(d>d „Z)d?d!„Z*dedefd"„Z+e+Z,d#ee   defd$„Z-d%e.defd&„Z/d'ee.   dee   fd(„Z0e/Z1e/Z2d@d	edefd)„Z3dAd*efd+„Z4d>d,„Z5d%eddfd-„Z6d.ee   dd
fd/„Z7ded.ee   defd0„Z8ded.ee   defd1„Z9dedee   defd2„Z:d.ee   ddfd3„Z;dee   defd4„Z<e<Z=dee   ddfd5„Z>dee   defd6„Z?dee   defd7„Z@dBdeded8edefd9„ZAdBded8edefd:„ZBde.fd;„ZCd>d<„ZDy)Cr   a³  
    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                 óN   — |rt         j                  |«      ni | _        d| _        y ©NT)ÚdictÚfromkeysr#   r$   ©Úselfr%   s     r   Ú__init__zStableSet.__init__V   s   € Ù.5”D—M‘M 'Ô*¸2ˆŒ	ØˆÕr!   r   c                 ó6   — | j                   j                  «       S )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   r.   zStableSet.__len__Z   s   € ð �y‰y× Ñ Ó"Ð"r!   ÚindexúStableSet[T]c                  ó   — y ©N© ©r+   r0   s     r   Ú__getitem__zStableSet.__getitem__f   ó   € àr!   c                  ó   — y r3   r4   r5   s     r   r6   zStableSet.__getitem__j   r7   r!   c                  ó   — y r3   r4   r5   s     r   r6   zStableSet.__getitem__n   r7   r!   c                 ó˜  — t        |t        «      rY|dk  rt        | j                  «      |z   }	 t	        t        j                  | j                  j                  «       ||dz   «      «      S t        |t        «      r|t        k(  r| j                  «       S t        | j                  j                  «       «      }t        |t        «      r|D �cg c]  }||   ‘Œ	 c}S t        |t        «      st        |d«      r(||   }t        |t        «      r| j!                  |«      S |S t#        d|› �«      ‚# t        $ r t        d|› d�«      ‚w xY wc c}w )aM  
        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+   r0   ÚitemsÚiÚresults        r   r6   zStableSet.__getitem__s   s!  € ô$ �eœSÔ!Ø�qŠyÜ˜DŸI™I›¨Ñ.�ð@ÜœI×,Ñ,¨T¯Y©Y¯^©^Ó-=¸uÀeÈaÁiÓPÓQÐQô ˜œuÔ%¨%´9Ò*<Ø—9‘9“;ÐÜ�T—Y‘Y—^‘^Ó%Ó&ˆÜ�eœXÔ&Ø&+Ö, �E˜!“HÒ,Ð,Ü˜œuÔ%¬°¸Ô)DØ˜5‘\ˆFÜ˜&¤$Ô'Ø—~‘~ fÓ-Ð-à�äÐEÀeÀWÐMÓNÐNøô !ò @Ü  6¨%¨°Ð!>Ó?Ð?ð@üò -s   ¯:D+ Ã
EÄ+Ec                 ó6   — t        | «      dk(  ryt        | «      S )Nr   r3   )r>   rH   r/   s    r   Ú__getstate__zStableSet.__getstate__�   s   € Üˆt‹9˜Š>ð ä˜“:Ðr!   c                 óT   — |dk(  r| j                  g «       y | j                  |«       y )Nr3   )r,   )r+   Ústates     r   Ú__setstate__zStableSet.__setstate__©   s"   € Ø�GÒØ�M‰M˜"Õà�M‰M˜%Õ r!   Úkeyc                 ó8   — | j                   j                  |«      S )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+   rU   s     r   rW   zStableSet.__contains__¯   s   € ð �y‰y×%Ñ% cÓ*Ð*r!   c                 óR   — | j                   j                  «       j                  «       S )za
        Example:
            >>> list(iter(StableSet([1, 2, 3])))
            [1, 2, 3]
        )r#   rB   Ú__iter__r/   s    r   rZ   zStableSet.__iter__¼   s   € ð �y‰y�~‰~Ó×(Ñ(Ó*Ð*r!   c                 óH   — t        | j                  j                  «       «      S )zŠ
        Supported from Python >= 3.8
        Example:
            >>> list(reversed(StableSet([1, 2, 3])))
            [3, 2, 1]
        )Úreversedr#   rB   r/   s    r   Ú__reversed__zStableSet.__reversed__Å   s   € ô ˜Ÿ	™	Ÿ™Ó(Ó)Ð)r!   c                 ó‚   — | s| j                   j                  › d�S | j                   j                  › dt        | «      ›d�S ©Nz()ú(ú))rJ   Ú__name__rH   r/   s    r   Ú__repr__zStableSet.__repr__Î   s?   € ÙØ—n‘n×-Ñ-Ð.¨bÐ1Ð1Ø—.‘.×)Ñ)Ð*¨!¬D°«J¨>¸Ð;Ð;r!   Úotherc                 ó$   — | j                  |«      S r3   )Úintersection©r+   rd   s     r   Ú__and__zStableSet.__and__Õ   s   € à× Ñ  Ó'Ð'r!   r+   c                 óè   ‡— t        t        | t        «      r| nt        ‰t        «      r‰nt        «      }t        ‰t        «      st        ‰t        «      st
        S  |‰«      Š |ˆfd„| D «       «      S )Nc              3   ó,   •K  — | ]  }|‰vsŒ|–— Œ y ­wr3   r4   )Ú.0Úvaluerd   s     €r   ú	<genexpr>z$StableSet.__sub__.<locals>.<genexpr>é   s   øè ø€ ÒA˜U¨e¸5Ò.@”5ÑAùó   ƒ	�©Útyper   r   r   r   ÚNotImplemented©r+   rd   Úclss    ` r   Ú__sub__zStableSet.__sub__Ý   sf   ø€ Üä˜$¤	Ô*ñ ô ˜%¤Ô+ñ äó
ˆô ˜%¤Ô%Ü˜e¤XÔ.Ü%Ð%Ù˜“JˆEÙÓA dÔAÓAÐAr!   c                 óè   ‡ — t        t        ‰ t        «      r‰ nt        |t        «      r|nt        «      }t        |t        «      st        |t        «      st
        S  ||«      } |ˆ fd„|D «       «      S )Nc              3   ó,   •K  — | ]  }|‰vsŒ|–— Œ y ­wr3   r4   )rk   rl   r+   s     €r   rm   z%StableSet.__rsub__.<locals>.<genexpr>÷   s   øè ø€ ÒA˜U¨u¸DÒ/@”5ÑAùrn   ro   rr   s   `  r   Ú__rsub__zStableSet.__rsub__ë   sf   ø€ Üä˜$¤	Ô*ñ ô ˜%¤Ô+ñ äó
ˆô ˜%¤Ô%Ü˜e¤XÔ.Ü%Ð%Ù˜“JˆEÙÓA eÔAÓAÐAr!   c                 óº   — t        t        | t        «      r| nt        |t        «      r|nt        «      }t        |t        «      st        S d„ | |fD «       } ||«      S )Nc              3   ó.   K  — | ]  }|D ]  }|–— Œ Œ y ­wr3   r4   ©rk   ÚsÚes      r   rm   z#StableSet.__or__.<locals>.<genexpr>  ó   è ø€ Ò5�q°1Ò5¨a”Ð5�Ñ5ùó   ‚©rp   r   r   r   rq   ©r+   rd   rs   Úchains       r   Ú__or__zStableSet.__or__ú   sY   € Üä˜$¤	Ô*ñ ô ˜%¤Ô+ñ äó
ˆô ˜%¤Ô*Ü!Ð!Ù5˜T 5˜MÔ5ˆÙ�5‹zÐr!   c                 óº   — t        t        | t        «      r| nt        |t        «      r|nt        «      }t        |t        «      st        S d„ || fD «       } ||«      S )Nc              3   ó.   K  — | ]  }|D ]  }|–— Œ Œ y ­wr3   r4   rz   s      r   rm   z$StableSet.__ror__.<locals>.<genexpr>  r}   r~   r   r€   s       r   Ú__ror__zStableSet.__ror__  sY   € Üä˜$¤	Ô*ñ ô ˜%¤Ô+ñ äó
ˆô ˜%¤Ô*Ü!Ð!Ù5˜U D˜MÔ5ˆÙ�5‹zÐr!   c                 óD   — t        |t        «      st        S | |z
  || z
  z  S r3   ©r   r   rq   rg   s     r   Ú__xor__zStableSet.__xor__  s%   € Ü˜%¤Ô*Ü!Ð!Ø�u‘ ¨¡Ñ.Ð.r!   c                 óD   — t        |t        «      st        S || z
  | |z
  z  S r3   r‡   rg   s     r   Ú__rxor__zStableSet.__rxor__  s%   € Ü˜%¤Ô*Ü!Ð!Ø˜‘ ¨¡Ñ.Ð.r!   c                 ó<  — t        |t        «      syt        | j                  «      t        |«      k7  ryt        |t        «      r| j                  |j                  k(  S t        |t
        «      st        |«      }t        | j                  j                  «       «      |k(  S ©NF)r   r   r>   r#   r   rH   rB   rg   s     r   Ú__eq__zStableSet.__eq__  sq   € Ü˜%¤Ô*ØÜˆt�y‰y‹>œS ›ZÒ'ØÜ�eœYÔ'Ø—9‘9 §
¡
Ñ*Ð*Ü˜%¤Ô&Ü˜“KˆEÜ�D—I‘I—N‘NÓ$Ó%¨Ñ.Ð.r!   c                 ój   — | j                   du rt        d«      ‚| j                  j                  «        y)z7
        Remove all items from this StableSet.
        FúThis object is not mutable.N)r$   Ú
ValueErrorr#   Úclearr/   s    r   r‘   zStableSet.clear)  s,   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;à�	‰	�‰Õr!   c                 ó$   — | j                  | «      S )zø
        Return a shallow copy of this object.

        Example:
            >>> this = StableSet([1, 2, 3])
            >>> other = this.copy()
            >>> this == other
            True
            >>> this is other
            False
        )rJ   r/   s    r   rG   zStableSet.copy2  s   € ð �~‰~˜dÓ#Ð#r!   c                 ó‚   — | j                   du rt        d«      ‚d| j                  |<   t        | j                  «      dz
  S )aA  
        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#   r>   rX   s     r   ÚaddzStableSet.addC  s>   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;àˆ�	‰	�#‰Ü�4—9‘9‹~ Ñ!Ð!r!   Úsequencec                 óÄ   — | j                   du rt        d«      ‚t        j                  |«      }| j                  j                  |«       t        | j                  «      dz
  S )a:  
        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#   Úupdater>   )r+   r•   Ú	other_maps      r   r—   zStableSet.updateY  sQ   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;ä—M‘M (Ó+ˆ	Ø�	‰	×Ñ˜Ô#Ü�4—9‘9‹~ Ñ!Ð!r!   rl   c                 ó²   — 	 t        | j                  j                  «       «      D ]  \  }}||k(  sŒ|c S  t        |«      ‚# t        $ r t        |«      ‚w xY w©a>  
        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#   rB   ÚKeyErrorr�   )r+   rl   r0   Úitems       r   r0   zStableSet.indexm  s[   € ð	"Ü(¨¯©¯©Ó)9Ó:ò !‘��tØ˜5“=Ø ’Lð!ô ˜5“/Ð!øÜò 	"Ü˜5“/Ð!ð	"ús   ‚.A ±A µA ÁArB   c                 óJ   — |D �cg c]  }| j                  |«      ‘Œ c}S c c}w r3   ©r0   ©r+   rB   Úsubkeys      r   ÚindexeszStableSet.indexes�  ó   € Ø15Ö6 v�—
‘
˜6Õ"Ò6Ð6ùÒ6ó   … c                 ó¾  — | j                   du rt        d«      ‚| j                  st        d«      ‚|dk(  r| j                  j	                  «       \  }}|S |dk(  r-t        t        | j                  j                  «       «      «      }n;t        t        j                  | j                  j                  «       ||dz   «      «      }| j                  j                  |«       |S )a
  
        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 emptyéÿÿÿÿr   r;   )r$   r�   r#   rœ   Úpopitemr?   ÚiterrB   r@   rA   Úpop)r+   r0   ÚelemÚ_s       r   rª   zStableSet.popˆ  s°   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;à�yŠyÜ˜>Ó*Ð*Ø�BŠ;Ø—i‘i×'Ñ'Ó)‰GˆD�!ØˆKØ�aŠZÜœ˜TŸY™YŸ^™^Ó-Ó.Ó/‰Däœ	×(Ñ(¨¯©¯©Ó)9¸5À%È!Á)ÓLÓMˆDØ�	‰	�‰�dÔØˆr!   Úlastc                 ó6  — | j                   du rt        d«      ‚| j                  st        d«      ‚|r| j                  j	                  «       \  }}|S t        t        | j                  j                  «       «      «      }| j                  j                  |«       |S )z�Remove 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¨   r?   r©   rB   rª   )r+   r­   r«   r¬   s       r   r¨   zStableSet.popitem£  s}   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;à�yŠyÜ˜>Ó*Ð*ÙØ—i‘i×'Ñ'Ó)‰GˆD�!ØˆKÜ”D˜Ÿ™Ÿ™Ó)Ó*Ó+ˆØ�	‰	�‰�dÔØˆr!   c                 óŠ   — | j                   du rt        d«      ‚| j                  j                  |«       d| j                  |<   y)zcMove an existing element to the end.
        Raise KeyError if the element does not exist.
        Fr�   N©r$   r�   r#   rª   rX   s     r   Úmove_to_endzStableSet.move_to_end³  s;   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;à�	‰	�‰�cÔØˆ�	‰	�#Šr!   c                 ón   — | j                   du rt        d«      ‚| j                  j                  |d«       y)aÕ  
        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+   rl   s     r   ÚdiscardzStableSet.discard½  s0   € ð  ×Ñ˜uÑ$ÜÐ:Ó;Ð;à�	‰	�‰�e˜TÕ"r!   Úsetsc                 óÜ   — t        t        | t        «      r| nt        «      }t        t        t        j                  | g|«      «      }t
        j                  j                  |«      } ||«      S )a°  
        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])
        )rp   r   r   ÚmaprH   Úitr�   Úfrom_iterable)r+   rµ   rs   Ú
containersrM   s        r   ÚunionzStableSet.unionÒ  sP   € ô œ: d¬IÔ6‘4¼IÓFˆÜœœrŸx™x¨¨°Ó5Ó6ˆ
Ü—‘×&Ñ& zÓ2ˆÙ�5‹zÐr!   c                 ó´   ‡— t        t        | t        «      r| nt        «      }| }|r+t        j                  t        t        |«      Ž Šˆfd„| D «       } ||«      S )aª  
        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   ó,   •K  — | ]  }|‰v sŒ|–— Œ y ­wr3   r4   )rk   r�   Úcommons     €r   rm   z)StableSet.intersection.<locals>.<genexpr>÷  s   øè ø€ Ò=˜d¨d°fªn”TÑ=ùrn   )rp   r   r   Úsetrf   r·   )r+   rµ   rs   rM   r¾   s       @r   rf   zStableSet.intersectionå  sL   ø€ ô œ: d¬IÔ6‘4¼IÓFˆØ#'ˆÙÜ×%Ñ%¤s¬3°£~Ð6ˆFÛ= dÔ=ˆEÙ�5‹zÐr!   c                 ó´   ‡— t        t        | t        «      r| nt        «      }| }|r+t        j                  t        t        |«      Ž Šˆfd„| D «       } ||«      S )aÑ  
        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   ó,   •K  — | ]  }|‰vsŒ|–— Œ y ­wr3   r4   ©rk   r�   rd   s     €r   rm   z'StableSet.difference.<locals>.<genexpr>  s   øè ø€ Ò@˜d¨d¸%Ò.?”TÑ@ùrn   )rp   r   r   r¿   r»   r·   )r+   rµ   rs   rM   rd   s       @r   Ú
differencezStableSet.differenceú  sJ   ø€ ô œ: d¬IÔ6‘4¼IÓFˆØ#'ˆÙÜ—I‘Iœs¤3¨›~Ð.ˆEÛ@ dÔ@ˆEÙ�5‹zÐr!   c                 óæ   — t        t        | t        «      r| nt        |t        «      r|nt        «      } || «      j                  |«      } ||«      j                  | «      }|j	                  |«      S )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])
        )rp   r   r   rÃ   r»   )r+   rd   rs   Údiff1Údiff2s        r   Úsymmetric_differencezStableSet.symmetric_difference  sj   € ô ä˜$¤	Ô*ñ ô ˜%¤Ô+ñ äó
ˆñ �D“	×$Ñ$ UÓ+ˆÙ�E“
×%Ñ% dÓ+ˆØ�{‰{˜5Ó!Ð!r!   c                 óð   — | j                   du rt        d«      ‚t        «       }|D ]  }t        |«      }||z  }Œ t        j	                  | j
                  D �cg c]	  }||vsŒ|‘Œ c}«      | _        yc c}w )aÃ  
        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_removerd   Úitems_as_setr�   s         r   Údifference_updatezStableSet.difference_update)  su   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;ä›%ˆØò 	,ˆEÜ˜u›:ˆLØ˜|Ñ+‰Oð	,ô —M‘MØ"Ÿi™iÖG�d¨4°Ò+FŠTÒGó
ˆ�	ùÚGs   Á	A3Á"A3c                 óÆ   — | j                   du rt        d«      ‚t        |«      }t        j	                  | j
                  D �cg c]	  }||v sŒ|‘Œ c}«      | _        | S c c}w )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+   rd   r�   s      r   Úintersection_updatezStableSet.intersection_updateC  sW   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;Ü�E“
ˆÜ—M‘M°D·I±IÖ"O¨DÀÈÂ¢4Ò"OÓPˆŒ	Øˆùò #Ps   Á	AÁAc                 óü   — | j                   du rt        d«      ‚|D �cg c]	  }|| vsŒ|‘Œ }}t        |«      }t        j	                  | j
                  D �cg c]	  }||vsŒ|‘Œ c}|z   «      | _        yc c}w c c}w )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+   rd   r�   Úitems_to_addrË   s        r   Úsymmetric_difference_updatez%StableSet.symmetric_difference_updateX  s{   € ð ×Ñ˜uÑ$ÜÐ:Ó;Ð;Ø).ÖC °$¸dÒ2BšÐCˆÐCÜ˜e›*ˆÜ—M‘MØ"Ÿi™iÖG�d¨4°Ò+FŠTÒGÈ,ÑVó
ˆ�	ùò Dùò Hs   ž	A4¨A4Á	A9Á A9c                 ó\   ‡— t        | «      t        ‰«      kD  ryt        ˆfd„| D «       «      S )a4  
        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   ó&   •K  — | ]  }|‰v –— Œ
 y ­wr3   r4   rÂ   s     €r   rm   z%StableSet.issubset.<locals>.<genexpr>z  s   øè ø€ Ò2 T�4˜5”=Ñ2ùó   ƒ©r>   Úallrg   s    `r   ÚissubsetzStableSet.issubsetl  s)   ø€ ô ˆt‹9”s˜5“zÒ!ØÜÓ2¨TÔ2Ó2Ð2r!   c                 ó\   ‡ — t        ‰ «      t        |«      k  ryt        ˆ fd„|D «       «      S )a:  
        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   ó&   •K  — | ]  }|‰v –— Œ
 y ­wr3   r4   )rk   r�   r+   s     €r   rm   z'StableSet.issuperset.<locals>.<genexpr>Š  s   øè ø€ Ò2 D�4˜4”<Ñ2ùr×   rØ   rg   s   ` r   Ú
issupersetzStableSet.issuperset|  s)   ø€ ô ˆt‹9”s˜5“zÒ!ØÜÓ2¨EÔ2Ó2Ð2r!   Únon_consecutivec                 óÂ   — t        | «      t        |«      kD  ry|r*d}t        | «      }|D ]  }|| |   k(  sŒ|dz  }||k(  sŒ y yt        | |«      D ]  \  }}||k(  rŒ y y©NFr   r;   T©r>   Úzip©r+   rd   rÞ   rN   Úself_lenÚ
other_itemÚ	self_items          r   ÚisorderedsubsetzStableSet.isorderedsubsetŒ  ó„   € Üˆt‹9”s˜5“zÒ!ØÙØˆAÜ˜4“yˆHØ#ò $�
Ø  a¡Ó(Ø˜‘F�AØ˜H“}Ù#ð	$ð
 ä),¨T°5Ó)9ò !Ñ%�	˜:Ø  JÓ.Ù ð!ð r!   c                 ó0   — t         j                  || |«      S r3   ©r   rç   ©r+   rd   rÞ   s      r   ÚisorderedsupersetzStableSet.isorderedsupersetž  ó   € Ü×(Ñ(¨°°oÓFÐFr!   c                 ó>   — t        t        | j                  «      «      S r3   )r?   r©   r#   r/   s    r   ÚgetzStableSet.get¡  s   € Ü”D˜Ÿ™“OÓ$Ð$r!   c                 ó   — d| _         y)zI
        Once this function is run, the object becomes immutable
        FN)r$   r/   s    r   ÚfreezezStableSet.freeze¤  s   € ð !ˆÕr!   r3   ©r   N)r   r1   ©r§   ©T©F)Erb   Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   Ú__annotations__r
   ÚSetInitializerr,   r=   r.   r   rE   r6   r   r   rQ   rT   ÚboolrW   r   rZ   r]   r   rc   Ú__str__ÚSetLikerh   r   r   rt   rw   r‚   r…   rˆ   rŠ   Úobjectr�   r‘   rG   r”   Úappendr—   r   r0   r¢   Úget_locÚget_indexerrª   r¨   r±   r´   r»   rf   rÃ   rÇ   rÍ   rÐ   Ú__iand__rÔ   rÚ   rÝ   rç   rì   rï   rñ   r4   r!   r   r   r   7   sÒ  … ñð4 (€Ià
ˆq�#ˆv‰,Óñ  ¨¸Ñ):Ñ ;ó  ð
#˜ó 
#ð ð ð ¨>ò ó ðð ð ¨#¡ð °4¸±7ò ó ðð ð ð ¨ò ó ðò%OòT
ò!ð+ ð +¨ó +ð+˜( 1™+ó +ð*˜h q™kó *ð<˜#ó <ð
 €Gð(˜W Q™Zð (¨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ð"˜w q™zð "¨có "ð("˜8ð "¨ó "ð(7˜D ™Nð 7¨t°C©yó 7ð €GØ€Kñ˜ð  aó ñ6˜Dó ó ð#˜Qð # 4ó #ð*˜7 1™:ð ¨.ó ð&˜1ð  W¨Q¡Zð °Aó ð*˜ð  7¨1¡:ð °!ó ð*" 1ð "¨W°Q©Zð "¸Aó "ð4
 w¨q¡zð 
°dó 
ð4¨°©ð ¸ó ð& #€Hð
°¸±ð 
Àó 
ð(3˜g a™jð 3¨Tó 3ð 3 ¨¡
ð 3¨tó 3ñ ˜gð ¨gð Èð ÐY]ó ñ$G wð GÀð GÐRVó Gð%�Xó %ô!r!   c                   óD   — e Zd ZdZd„ Zd„ Zd„ ZeZd„ Zd„ Z	d„ Z
d„ Zd	„ Zy
)Ú
OrderlySetz¼
    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                 óz   — t        |t        t        f«      r|n
t        |«      }t        | «      |z
  }t        |«      S r3   ©r   r¿   Ú	frozensetr  ©r+   rd   rO   s      r   rt   zOrderlySet.__sub__±  ó4   € Ü# E¬C´Ð+;Ô<‘Ä#ÀeÃ*ˆÜ�T“˜UÑ"ˆÜ˜&Ó!Ð!r!   c                 óz   — t        |t        t        f«      r|n
t        |«      }|t        | «      z
  }t        |«      S r3   r  r	  s      r   rw   zOrderlySet.__rsub__¶  s4   € Ü# E¬C´Ð+;Ô<‘Ä#ÀeÃ*ˆØœ˜T›Ñ"ˆÜ˜&Ó!Ð!r!   c                 óz   — t        |t        t        f«      r|n
t        |«      }t        | «      |z  }t        |«      S r3   r  r	  s      r   rˆ   zOrderlySet.__xor__»  r
  r!   c                 óH  — t        |t        «      syt        | j                  «      t        |«      k7  ryt        |t        «      r| j                  |j                  k(  S t        |t
        t        f«      st        |«      }t        | j                  j                  «       «      |k(  S rŒ   )r   r   r>   r#   r   r¿   r  rB   rg   s     r   r�   zOrderlySet.__eq__Â  sv   € Ü˜%¤Ô*ØÜˆt�y‰y‹>œS ›ZÒ'ØÜ�eœYÔ'Ø—9‘9 §
¡
Ñ*Ð*Ü˜%¤#¤yÐ!1Ô2Ü˜“JˆEÜ�4—9‘9—>‘>Ó#Ó$¨Ñ-Ð-r!   c                 óö   — t        |t        «      syt        | j                  «      t        |«      k  ryt        |t        t
        f«      st	        |«      }t	        | j                  j                  «       «      |k\  S rŒ   ©r   r   r>   r#   r¿   r  rB   rg   s     r   Ú__ge__zOrderlySet.__ge__Í  óY   € Ü˜%¤Ô*ØÜˆt�y‰y‹>œC ›JÒ&ØÜ˜%¤#¤yÐ!1Ô2Ü˜“JˆEÜ�4—9‘9—>‘>Ó#Ó$¨Ñ-Ð-r!   c                 óö   — t        |t        «      syt        | j                  «      t        |«      k  ryt        |t        t
        f«      st	        |«      }t	        | j                  j                  «       «      |kD  S rŒ   r  rg   s     r   Ú__gt__zOrderlySet.__gt__Ö  óY   € Ü˜%¤Ô*ØÜˆt�y‰y‹>œS ›ZÒ'ØÜ˜%¤#¤yÐ!1Ô2Ü˜“JˆEÜ�4—9‘9—>‘>Ó#Ó$ uÑ,Ð,r!   c                 óö   — t        |t        «      syt        | j                  «      t        |«      kD  ryt        |t        t
        f«      st	        |«      }t	        | j                  j                  «       «      |k  S rŒ   r  rg   s     r   Ú__le__zOrderlySet.__le__ß  r  r!   c                 óö   — t        |t        «      syt        | j                  «      t        |«      k\  ryt        |t        t
        f«      st	        |«      }t	        | j                  j                  «       «      |k  S rŒ   r  rg   s     r   Ú__lt__zOrderlySet.__lt__è  r  r!   N)rb   rö   r÷   rø   rt   rw   rˆ   rŠ   r�   r  r  r  r  r4   r!   r   r  r  «  s6   „ ñò
"ò
"ò
"ð
 €Hò	.ò.ò-ò.ó-r!   r  c                   óh   — e Zd ZdZdedefd„Zdee   fd„Z	dee   fd„Z
dee   fd„Zdee   fd„Zy	)
ÚStableSetEqa“  
    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]`
    rd   r   c                 ó’   — t        |t        «      s	 t        |«      }| j                  j                  «       |k(  S # t        $ r Y yw xY w)ap  
        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¿   rK   r#   rB   rg   s     r   r�   zStableSetEq.__eq__ü  sH   € ô ˜%¤Ô-ðÜ˜E›
�ð �y‰y�~‰~Ó 5Ñ(Ð(øô ò áðús   ’: º	AÁAc                 óÚ   — t        | «      t        |«      k  xrS t        |t        «      r| j                  j	                  «       |k  S | j                  j	                  «       t        |«      k  S r3   ©r>   r   r   r#   rB   r¿   rg   s     r   r  zStableSetEq.__le__  óY   € Ü�4‹yœC ›JÑ&ò 
ä˜%¤Ô-ð �I‰I�N‰NÓ Ñ%ð	
ð —‘—‘Ó!¤S¨£ZÑ/ð	
r!   c                 óÚ   — t        | «      t        |«      k  xrS t        |t        «      r| j                  j	                  «       |k  S | j                  j	                  «       t        |«      k  S r3   r  rg   s     r   r  zStableSetEq.__lt__  óY   € Ü�4‹yœ3˜u›:Ñ%ò 
ä˜%¤Ô-ð �I‰I�N‰NÓ˜uÑ$ð	
ð —‘—‘Ó!¤C¨£JÑ.ð	
r!   c                 óÚ   — t        | «      t        |«      k\  xrS t        |t        «      r| j                  j	                  «       |k\  S | j                  j	                  «       t        |«      k\  S r3   r  rg   s     r   r  zStableSetEq.__ge__!  r  r!   c                 óÚ   — t        | «      t        |«      kD  xrS t        |t        «      r| j                  j	                  «       |kD  S | j                  j	                  «       t        |«      kD  S r3   r  rg   s     r   r  zStableSetEq.__gt__(  r   r!   N)rb   rö   r÷   rø   r   rü   r�   rþ   r   r  r  r  r  r4   r!   r   r  r  ò  sZ   „ ñð)˜Cð ) Dó )ð.
˜G A™Jó 
ð
˜G A™Jó 
ð
˜G A™Jó 
ð
˜G A™Jô 
r!   r  c                   ó„  — e Zd ZU dZdZee   ed<   d$dee	e      fd„Z
d„ Zded	efd
„Zdee   fd„Zdee   fd„Zdee   fd„Zdee   fd„Zd%d„Zded	efd„Zdee   d	efd„Zded	efd„Zdee   d	ee   fd„Zd&ded	efd„Zd'defd„Zd„ Zded	dfd„Zded	dfd„Z d ee   d	dfd!„Z!dee   d	efd"„Z"e"Z#dee   d	dfd#„Z$y)(Ú
OrderedSetaR  
    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$   r%  Nr%   c                 ó>   — g | _         i | _        d| _        |�| |z  } y y r'   )r%  r#   r$   r*   s     r   r,   zOrderedSet.__init__S  s.   € ØˆŒØˆŒ	ØˆÔàÐð �G‰O‰Dð	 r!   c                 ó®  — t        |t        «      r| j                  |   S t        |t        «      r|t        k(  r| j                  «       S t        |t        «      r|D �cg c]  }| j                  |   ‘Œ c}S t        |t        «      st        |d«      r2| j                  |   }t        |t        «      r| j                  |«      S |S t        d|z  «      ‚c c}w )Nr<   z+Don't know how to index an OrderedSet by %r)r   r=   r%  rE   rF   rG   r   rI   rH   rJ   rK   )r+   r0   rN   rO   s       r   r6   zOrderedSet.__getitem__^  s°   € Ü�eœSÔ!Ø—;‘;˜uÑ%Ð%Ü˜œuÔ%¨%´9Ò*<Ø—9‘9“;ÐÜ˜œxÔ(Ø,1Ö2 q�D—K‘K “NÒ2Ð2Ü˜œuÔ%¬°¸Ô)DØ—[‘[ Ñ'ˆFÜ˜&¤$Ô'Ø—~‘~ fÓ-Ð-à�äÐIÈEÑQÓRÐRùò 3s   ÁCrd   r   c                 óô   — t        |t        «      r1t        | «      t        |«      k(  xr | j                  t	        |«      k(  S 	 t        |«      }| j                  j                  «       |k(  S # t        $ r Y yw xY w)a®  
        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   r>   r%  rH   r¿   r#   rB   rK   )r+   rd   Úother_as_sets      r   r�   zOrderedSet.__eq__n  so   € ô  �eœXÔ&ô �t“9¤ E£
Ñ*ÒI¨t¯{©{¼dÀ5»kÑ/IÐIð	4Ü˜u›:ˆLð
 —9‘9—>‘>Ó# |Ñ3Ð3øô	 ò 	áð	ús   ÁA+ Á+	A7Á6A7c                 óü   — t        | «      t        |«      k  xrd t        |t        «      r| j                  j	                  «       |k  S t        |t
        «      r| j                  |k  S | j                  t        |«      k  S r3   ©r>   r   r   r#   rB   rH   r%  rg   s     r   r  zOrderedSet.__le__Š  óq   € Ü�4‹yœC ›JÑ&ò 
ä˜%¤Ô-ð �I‰I�N‰NÓ Ñ%ð	
ô ˜%¤Ô&ð —‘ Ñ%ð	
ð
 —‘¤ U£Ñ+ð	
r!   c                 óü   — t        | «      t        |«      k  xrd t        |t        «      r| j                  j	                  «       |k  S t        |t
        «      r| j                  |k  S | j                  t        |«      k  S r3   r+  rg   s     r   r  zOrderedSet.__lt__“  óq   € Ü�4‹yœ3˜u›:Ñ%ò 
ä˜%¤Ô-ð �I‰I�N‰NÓ˜uÑ$ð	
ô ˜%¤Ô&ð —‘˜uÑ$ð	
ð
 —‘œt E›{Ñ*ð	
r!   c                 óü   — t        | «      t        |«      k\  xrd t        |t        «      r| j                  j	                  «       |k\  S t        |t
        «      r| j                  |k\  S | j                  t        |«      k\  S r3   r+  rg   s     r   r  zOrderedSet.__ge__œ  r,  r!   c                 óü   — t        | «      t        |«      kD  xrd t        |t        «      r| j                  j	                  «       |kD  S t        |t
        «      r| j                  |kD  S | j                  t        |«      kD  S r3   r+  rg   s     r   r  zOrderedSet.__gt__¥  r.  r!   c                 óˆ   — | j                   du rt        d«      ‚| j                  d d …= | j                  j	                  «        y ©NFr�   )r$   r�   r%  r#   r‘   r/   s    r   r‘   zOrderedSet.clear®  s5   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;à�K‰KšˆNØ�	‰	�‰Õr!   rU   c                 óè   — | j                   du rt        d«      ‚|| j                  vr=t        | j                  «      | j                  |<   | j                  j                  |«       | j                  |   S r2  )r$   r�   r#   r>   r%  r   rX   s     r   r”   zOrderedSet.addµ  s^   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;à�d—i‘iÑÜ  §¡Ó-ˆD�I‰I�c‰NØ�K‰K×Ñ˜sÔ#Ø�y‰y˜‰~Ðr!   r•   c                 ól   — | j                   du rt        d«      ‚d}|D ]  }| j                  |«      }Œ |S )NFr�   r   )r$   r�   r”   )r+   r•   Ú
item_indexr�   s       r   r—   zOrderedSet.update¾  sC   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;àˆ
Øò 	(ˆDØŸ™ $›‰Jð	(àÐr!   rl   c                 ó    — | j                   |   S r3   ©r#   r³   s     r   r0   zOrderedSet.indexÇ  s   € Ø�y‰y˜ÑÐr!   rB   c                 óF   — |D �cg c]  }| j                   |   ‘Œ c}S c c}w r3   r7  )r+   rB   rU   s      r   r¢   zOrderedSet.indexesÊ  s   € Ø*.Ö/ 3�—	‘	˜#“Ò/Ð/ùÒ/s   …r0   c                 ó¸   — | j                   du rt        d«      ‚| j                  st        d«      ‚| j                  |   }| j                  |= | j                  |= |S )NFr�   r¦   ©r$   r�   r%  rœ   r#   )r+   r0   r«   s      r   rª   zOrderedSet.popÍ  sX   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;à�{Š{Ü˜>Ó*Ð*Ø�{‰{˜5Ñ!ˆØ�K‰K˜ÐØ�I‰I�dˆOØˆr!   r­   c                 óÄ   — | j                   du rt        d«      ‚| j                  st        d«      ‚|rdnd}| j                  |   }| j                  |= | j                  |= |S )NFr�   r¦   r§   r   r:  )r+   r­   r0   r«   s       r   r¨   zOrderedSet.popitemØ  sa   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;à�{Š{Ü˜>Ó*Ð*Ù‘ ˆØ�{‰{˜5Ñ!ˆØ�K‰K˜ÐØ�I‰I�dˆOØˆr!   c                 ó˜   — | j                   du rt        d«      ‚|| v r#| j                  |«       | j                  |«       y t	        |«      ‚r2  )r$   r�   r´   r”   rœ   rX   s     r   r±   zOrderedSet.move_to_endä  sD   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;à�$‰;Ø�L‰L˜ÔØ�H‰H�S�Mä˜3“-Ðr!   c                 ó  — | j                   du rt        d«      ‚|| v rd| j                  |   }| j                  |= | j                  |= | j                  j	                  «       D ]  \  }}||k\  sŒ|dz
  | j                  |<   Œ y y )NFr�   r;   )r$   r�   r#   r%  rM   )r+   rU   rN   ÚkÚvs        r   r´   zOrderedSet.discardî  s�   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;à�$‰;Ø—	‘	˜#‘ˆAØ—‘˜A�Ø—	‘	˜#�ØŸ	™	Ÿ™Ó)ò )‘��1Ø˜“6Ø#$ q¡5�D—I‘I˜a’Lñ)ð	 r!   rM   c                 óf   — || _         t        |«      D ��ci c]  \  }}||“Œ
 c}}| _        yc c}}w )zu
        Replace the 'items' list of this OrderedSet with a new one, updating
        self._map accordingly.
        N)r%  r›   r#   )r+   rM   Úidxr�   s       r   Ú_update_itemszOrderedSet._update_itemsú  s-   € ð
 ˆŒÜ2;¸EÓ2B×C¡; C¨�T˜3‘YÓCˆ�	ùÓCs   –-rµ   c                 óÞ   — | j                   du rt        d«      ‚t        «       }|D ]  }t        |«      }||z  }Œ | j                  | j                  D �cg c]	  }||vsŒ|‘Œ c}«       y c c}w r2  ©r$   r�   r¿   rB  r%  rÊ   s         r   rÍ   zOrderedSet.difference_update  sq   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;ä›%ˆØò 	,ˆEÜ˜u›:ˆLØ˜|Ñ+‰Oð	,ð 	×ÑØ"Ÿk™kÖI�d¨T¸Ò-HŠTÒIõ	
ùÚIs   Á	A*ÁA*c                 ó´   — | j                   du rt        d«      ‚t        |«      }| j                  | j                  D �cg c]	  }||v sŒ|‘Œ c}«       | S c c}w r2  rD  rÏ   s      r   rÐ   zOrderedSet.intersection_update  sS   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;ä�E“
ˆØ×Ñ¨T¯[©[ÖJ T¸DÀEºMšDÒJÔKØˆùò Ks   ¾	AÁAc                 óê   — | j                   du rt        d«      ‚|D �cg c]	  }|| vsŒ|‘Œ }}t        |«      }| j                  | j                  D �cg c]	  }||vsŒ|‘Œ c}|z   «       y c c}w c c}w r2  rD  rÒ   s        r   rÔ   z&OrderedSet.symmetric_difference_update  sw   € Ø×Ñ˜uÑ$ÜÐ:Ó;Ð;à).ÖC °$¸dÒ2BšÐCˆÐCÜ˜e›*ˆØ×ÑØ"Ÿk™kÖI�d¨T¸Ò-HŠTÒIÈLÑXõ	
ùò Dùò Js   ž	A+¨A+Á	A0ÁA0r3   rò   ró   rô   )%rb   rö   r÷   rø   rù   r   r   rú   r
   rû   r,   r6   r   rü   r�   rþ   r  r  r  r  r‘   r=   r”   r—   r   r0   r¢   rª   r¨   r±   r´   rH   rB  rÍ   rÐ   r  rÔ   r4   r!   r   r$  r$  0  s|  … ñð< *€Ià�‰GƒOñ	 ¨¸Ñ):Ñ ;ó 	òSð 4˜Cð 4 Dó 4ð8
˜G A™Jó 
ð
˜G A™Jó 
ð
˜G A™Jó 
ð
˜G A™Jó 
óð�qð ˜Só ð˜w q™zð ¨có ð ˜8ð  ¨ó  ð0˜D ™Nð 0¨t°C©yó 0ñ	˜ð 	 aó 	ñ
˜Dó 
ò ð
)˜1ð 
) ó 
)ðD 4ð D¨Dó Dð

 w¨q¡zð 

°dó 

ð¨°©ð ¸ó ð #€Hð
°¸±ð 
Àô 
r!   r$  c            	       óZ  — e Zd Zddœd„Zd„ Zdefd„ZeZd*d„Zd„ Z	d	„ Z
e
Ze
Zd
„ ZeZd„ ZexZZd„ ZeZd„ Zd„ Zd„ ZexZZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZeZ d„ Z!d„ Z"e"Z#d„ Z$d„ Z%d„ Z&d„ Z'd„ Z(d„ Z)d„ Z*d e+de,fd!„Z-d"e.e+   de.e/   fd#„Z0e-Z1e-Z2d+d$„Z3d*d%e4d&e4d'e5de5fd(„Z6d*d&e4d'e5de5fd)„Z7y),Ú	SortedSetN©Úset_c                óT   — d| _         d | _        |r|| _        y t        |i |¤Ž| _        y r'   )r$   Ú_sortedrJ  r¿   )r+   rJ  ÚargsÚkwargss       r   r,   zSortedSet.__init__%  s,   € ØˆÔàˆŒÙØˆD�Iä˜TÐ, VÑ,ˆD�Ir!   c              #   ó@   K  — | j                  «       E d {  –—†  y 7 Œ­wr3   )Ú_get_sortedr/   s    r   rZ   zSortedSet.__iter__.  s   è ø€ Ø×#Ñ#Ó%×%Ò%ús   ‚–—r   c                 óŒ   — | s| j                   j                  › d�S | j                   j                  › d| j                  «       ›d�S r_   )rJ   rb   rP  r/   s    r   rý   zSortedSet.__str__1  sE   € ÙØ—n‘n×-Ñ-Ð.¨bÐ1Ð1Ø—.‘.×)Ñ)Ð*¨!¨D×,<Ñ,<Ó,>Ð+AÀÐCÐCr!   c                 óô   — | j                   €)	 t        | j                  |¬«      | _         | j                   S | j                   S # t        $ r, t        | j                  d„ |¬«      | _         Y | j                   S w xY w)N)Úreversec                 ó   — t        | «      S r3   )r   )Úxs    r   ú<lambda>z'SortedSet._get_sorted.<locals>.<lambda>>  s
   € ¼sÀ1»v€ r!   )rU   rS  )rL  ÚsortedrJ  Ú	Exception)r+   rS  s     r   rP  zSortedSet._get_sorted9  sk   € Ø�<‰<ÐðXÜ% d§i¡i¸ÔA�”ð �|‰|Ðˆt�|‰|Ðøô ò XÜ% d§i¡iÑ5EÈwÔW�•Ø�|‰|ÐðXús   ŽA Á'A7Á6A7c                 ó>   — t        t        | j                  «      «      S )z&
        Get a random element
        )r?   r©   rJ  r/   s    r   rï   zSortedSet.getA  s   € ô ”D˜Ÿ™“OÓ$Ð$r!   c                 ó8   — | j                   |z  }t        |¬«      S ©NrI  ©rJ  rH  r	  s      r   rh   zSortedSet.__and__G  ó   € à—‘˜UÑ"ˆÜ˜fÔ%Ð%r!   c                 ó<   — | j                   j                  |«       | S r3   )rJ  rÐ   rg   s     r   rÐ   zSortedSet.intersection_updateP  s   € Ø�	‰	×%Ñ% eÔ,Øˆr!   c                 ó8   — | j                   |z  }t        |¬«      S r[  r\  r	  s      r   r‚   zSortedSet.__or__V  r]  r!   c                 ó8   — | j                   |z
  }t        |¬«      S r[  r\  r	  s      r   rt   zSortedSet.__sub__]  r]  r!   c                 óD   — d | _          | j                  j                  |Ž  y r3   )rL  rJ  rÍ   )r+   rµ   s     r   rÍ   zSortedSet.difference_updated  s   € ØˆŒØ#ˆ�	‰	×#Ñ# TÒ*r!   c                 ó8   — | j                   j                  |«      S r3   )rJ  Ú
isdisjointrg   s     r   rc  zSortedSet.isdisjointh  ó   € Ø�y‰y×#Ñ# EÓ*Ð*r!   c                 ó8   — | j                   |z  }t        |¬«      S r[  r\  r	  s      r   rˆ   zSortedSet.__xor__k  r]  r!   c                 óH   — d | _         | j                  j                  |«       y r3   )rL  rJ  rÔ   rg   s     r   rÔ   z%SortedSet.symmetric_difference_updater  s   € ØˆŒØ�	‰	×-Ñ-¨eÕ4r!   c                 ó8   — || j                   z
  }t        |¬«      S r[  r\  r	  s      r   rw   zSortedSet.__rsub__v  s   € Ø˜Ÿ™Ñ"ˆÜ˜fÔ%Ð%r!   c                 óH   — d | _         | j                  j                  |«       y r3   )rL  rJ  r”   ©r+   r�   s     r   r”   zSortedSet.addz  s   € ØˆŒØ�	‰	�‰�dÕr!   c                 óF   — d | _         | j                  j                  «        y r3   )rL  rJ  r‘   r/   s    r   r‘   zSortedSet.clear~  s   € ØˆŒØ�	‰	�‰Õr!   c                 óH   — d | _         | j                  j                  |«       y r3   )rL  rJ  r´   rX   s     r   r´   zSortedSet.discard‚  s   € ØˆŒØ�	‰	×Ñ˜#Õr!   c                 ó@   — t        t        | j                  «      ¬«      S r[  )rH  r¿   rJ  r/   s    r   rG   zSortedSet.copy†  s   € Üœc $§)¡)›nÔ-Ð-r!   c                 ó8   — | j                   j                  |«      S r3   )rJ  rÚ   rg   s     r   r  zSortedSet.__le__‰  s   € Ø�y‰y×!Ñ! %Ó(Ð(r!   c                 ó    — | j                   |k  S r3   rI  rg   s     r   r  zSortedSet.__lt__Ž  ó   € Ø�y‰y˜5Ñ Ð r!   c                 ó8   — | j                   j                  |«      S r3   )rJ  rÝ   rg   s     r   r  zSortedSet.__ge__‘  rd  r!   c                 ó    — | j                   |kD  S r3   rI  rg   s     r   r  zSortedSet.__gt__–  ro  r!   c                 óH   — d | _         | j                  j                  |«       y r3   )rL  rJ  ÚremoverX   s     r   rs  zSortedSet.remove™  s   € ØˆŒØ�	‰	×Ñ˜Õr!   c                 óH   — d | _         | j                  j                  |«       y r3   )rL  rJ  r—   )r+   r•   s     r   r—   zSortedSet.update�  s   € ØˆŒØ�	‰	×Ñ˜Õ"r!   c                 óH   — | j                   rt        | j                   «      S dS )Nr   )rJ  r>   r/   s    r   r.   zSortedSet.__len__¡  s   € Ø!%§¢Œs�4—9‘9‹~Ð1°Ð1r!   c                 ó  — t        |t        «      syt        | j                  «      t        |«      k7  ryt        |t        «      r| j                  |j                  k(  S t        |t
        t        f«      st        |«      }| j                  |k(  S rŒ   )r   r   r>   rJ  rH  r¿   r  rg   s     r   r�   zSortedSet.__eq__¤  sj   € Ü˜%¤Ô*ØÜˆt�y‰y‹>œS ›ZÒ'ØÜ�eœYÔ'Ø—9‘9 §
¡
Ñ*Ð*Ü˜%¤#¤yÐ!1Ô2Ü˜“JˆEØ�y‰y˜EÑ!Ð!r!   c                 ód   — | j                   €| j                  «        t        | j                   «      S r3   )rL  rP  r\   r/   s    r   r]   zSortedSet.__reversed__¯  s'   € Ø�<‰<ÐØ×ÑÔÜ˜Ÿ™Ó%Ð%r!   c                 ó’  — | j                  «       }t        |t        «      r||   S t        |t        «      r|t        k(  r| j                  «       S t        |t        «      r|D �cg c]  }||   ‘Œ	 c}S t        |t        «      st        |d«      r(||   }t        |t        «      r| j                  |«      S |S t        d|› �«      ‚c c}w )Nr<   z'Don't know how to index a SortedSet by )rP  r   r=   rE   rF   rG   r   rI   rH   rJ   rK   rL   s        r   r6   zSortedSet.__getitem__´  s²   € Ø× Ñ Ó"ˆä�eœSÔ!Ø˜‘<ÐÜ˜œuÔ%¨%´9Ò*<Ø—9‘9“;ÐÜ�eœXÔ&Ø&+Ö, �E˜!“HÒ,Ð,Ü˜œuÔ%¬°¸Ô)DØ˜5‘\ˆFÜ˜&¤$Ô'Ø—~‘~ fÓ-Ð-à�äÐEÀeÀWÐMÓNÐNùò -s   Á#CrU   c                 ó   — | j                  «       }	 t        |t        «      r*t        |«      s|D �cg c]  }| j	                  |«      ‘Œ c}S t        |«      D ]  \  }}||k(  sŒ|c S  t        |«      ‚c c}w # t        $ r t        |«      ‚w xY wrš   )rP  r   r   r    r0   r›   rœ   r�   )r+   rU   rM   r¡   r0   r�   s         r   r0   zSortedSet.indexÆ  s‘   € ð × Ñ Ó"ˆð	 Ü˜#œxÔ(´¸C´Ø9<Ö=¨v˜Ÿ
™
 6Õ*Ò=Ð=Ü(¨Ó/ò !‘��tØ˜3“;Ø ’Lð!ô ˜3“-Ðùò	 >øô
 ò 	 Ü˜3“-Ðð	 ús(   ’A8 ±A3Á	A8 ÁA8 Á#A8 Á'A8 Á8BrB   c                 óJ   — |D �cg c]  }| j                  |«      ‘Œ c}S c c}w r3   rŸ   r    s      r   r¢   zSortedSet.indexesÝ  r£   r¤   c                 óÄ   — |€!d | _         | j                  j                  «       S | j                  «       }|j                  |«      }| j                  j	                  |«       |S r3   )rL  rJ  rª   rP  rs  )r+   r0   rM   rO   s       r   rª   zSortedSet.popä  sQ   € Øˆ=ØˆDŒLØ—9‘9—=‘=“?Ð"Ø× Ñ Ó"ˆØ—‘˜5Ó!ˆØ�	‰	×Ñ˜Ô Øˆr!   r+   rd   rÞ   c                 óÂ   — t        | «      t        |«      kD  ry|r*d}t        | «      }|D ]  }|| |   k(  sŒ|dz  }||k(  sŒ y yt        | |«      D ]  \  }}||k(  rŒ y yrà   rá   rã   s          r   rç   zSortedSet.isorderedsubsetí  rè   r!   c                 ó0   — t         j                  || |«      S r3   rê   rë   s      r   rì   zSortedSet.isorderedsupersetÿ  rí   r!   rõ   r3   )8rb   rö   r÷   r,   rZ   r   rý   rc   rP  rï   rh   rf   Ú__rand__rÐ   r  r‚   r»   r…   rt   rÃ   rÍ   rc  rˆ   rÇ   rŠ   rÔ   rw   r”   r‘   r´   rG   r  rÚ   r  r  rÝ   r  rs  r—   r.   r�   r]   r6   r   r   r0   r   r=   r¢   r  r  rª   rþ   rü   rç   rì   r4   r!   r   rH  rH  #  sc  „ à#'ô -ò&ðD˜ó Dð €Hóò%ò&ð
 €Là€Hòð #€Hò&ð
 Ð€EˆGò&ð
 €Jò+ò+ò&ð
 '.Ð-Ð˜8ò5ò&òòòò.ò)ð €Hò!ò+ð €Jò!òò#ò2ò	"ò&ò
Oð$ ˜ð   có  ð.7˜D ™Nð 7¨t°C©yó 7ð €GØ€Kóñ˜gð ¨gð Èð ÐY]ó ñ$G wð GÀð GÐRVô Gr!   rH  c                   ó†   — e Zd ZdZddedee   ddfd„Zdedefd„Z	d	eddfd
„Z
dedefd„Zdefd„Zdee   fd„Zdefd„Zy)ÚRoughMaxSizeSetu˜   
    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s t        |dz  d«      | _        t        «       | _        t        «       | _        y)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,   zRoughMaxSizeSet.__init__
  s5   € ð &ˆŒØ#1Ò#K´S¸ÀR¹ÈÓ5KˆÔÜ"›WˆŒÜ›Eˆ�	r!   r�   c                 ó"  — || j                   v ry| j                  j                  |«       | j                   j                  |«       t	        | j                   «      | j
                  | j                  z   kD  r| j                  | j
                  «       y)zf
        Add item if not present.
        :returns: True if inserted, False if already there.
        FT)r‡  r†  r   r”   r>   r�  r‚  Ú_evict_to_sizeri  s     r   r”   zRoughMaxSizeSet.add  sg   € ð
 �4—9‘9ÑØØ�‰�‰˜ÔØ�	‰	�‰�dÔÜˆt�y‰y‹>˜DŸM™M¨D×,?Ñ,?Ñ?Ò?Ø×Ñ §¡Ô.Ør!   Útarget_sizec                 óÒ   — t        | j                  «      |kD  rO| j                  j                  «       }| j                  j	                  |«       t        | j                  «      |kD  rŒNyy)zM
        Pop oldest items until our set is back down to target_size.
        N)r>   r‡  r†  Úpopleftr´   )r+   rŠ  Úolds      r   r‰  zRoughMaxSizeSet._evict_to_size"  sJ   € ô �$—)‘)‹n˜{Ò*Ø—X‘X×%Ñ%Ó'ˆCØ�I‰I×Ñ˜cÔ"ô �$—)‘)‹n˜{Õ*r!   c                 ó   — || j                   v S r3   )r‡  ri  s     r   rW   zRoughMaxSizeSet.__contains__*  s   € Ø�t—y‘yÐ Ð r!   c                 ó,   — t        | j                  «      S r3   )r>   r‡  r/   s    r   r.   zRoughMaxSizeSet.__len__-  s   € Ü�4—9‘9‹~Ðr!   c                 ó,   — t        | j                  «      S )z\
        Iteration order is arbitrary (follows set iteration), not insertion order.
        )r©   r‡  r/   s    r   rZ   zRoughMaxSizeSet.__iter__0  s   € ô �D—I‘I‹Ðr!   c                 óz   — | j                   j                  › dt        | j                  «      ›d| j                  ›d�S )Nr`   z, max_size=ra   )rJ   rb   rH   r†  r�  r/   s    r   rc   zRoughMaxSizeSet.__repr__6  s9   € à�~‰~×&Ñ&Ð' qÜ�D—H‘H‹~Ð  ¨D¯M©MÐ+<¸Að?ð	
r!   r3   )rb   rö   r÷   rø   r=   r
   r,   r   rü   r”   r‰  rW   r.   r   rZ   r   rc   r4   r!   r   r€  r€    s†   „ ññ
	" ð 	"°h¸s±mð 	"Ètó 	"ð˜ð ˜dó ð#¨#ð #°$ó #ð! ð ! tó !ð˜ó ð˜( 1™+ó ð
˜#ô 
r!   r€  )%r@   r¸   Útypingr   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   Úcollectionsr   rE   rF   r   r   r   rþ   rû   rÿ   rü   r    r   r  r  r$  rH  r€  r4   r!   r   ú<module>r”     s  ðÛ Û ÷÷ ÷ ÷ ó õ$ ñ �$‹K€	áˆCƒL€ÙˆC�{Ô#€ÙˆC�xÔ €ð �˜A‘ ¨¡Ð+Ñ
,€Ø�{ 1‘~ x°¡{°H¸Q±KÐ?Ñ@€ð)�Fð )˜tó )ô&q	!�
˜1‘˜x¨™{ô q	!ôhD-�˜1‘ô D-ôN;
�)˜A‘,ô ;
ô|p
�˜1‘ô p
÷f]Gñ ]GôB6
�g˜a‘jõ 6
r!   