+
    +O|j%x  ã            
       ó<  € R t ^ RIHtHt ^ RIHtHtHtHtH	t	H
t
Ht ^t]
! R4      t ! R R]],          4      t]
! R]R7      tR R	 ltR
 R lt ! R R4      t ! R R]]]3,          4      t ! R R]]]3,          4      t ! R R]4      t ! R R]]]3,          4      t]
! R4      t ! R R]]]]3,          4      t ! R R]]]3,          ]]]]]3,          3,          ]]]3,          4      t ! R R]]],          4      t ! R R]]],          ]],          4      tR# ) zµ
A BTree in the style of Cormen, Leiserson, and Rivest's "Algorithms" book, with
copy-on-write node updates, cursors, and optional space optimization for mostly-in-order
insertion.
)ÚMutableMappingÚ
MutableSet)ÚAnyÚCallableÚGenericÚOptionalÚTupleÚTypeVarÚcastÚKTc                   ó6   a € ] tR t^t o RtV 3R lR ltRtV tR# )ÚElementz+All items stored in the BTree are Elements.c                ó    <€ V ^8„  d   QhRS[ /# ©é   Úreturn©r   )ÚformatÚ__classdict__s   "€ÚBC:\Users\alokc\chatbot\backend\venv\Lib\site-packages\dns/btree.pyÚ__annotate__ÚElement.__annotate__   s   ø€ ÷ "ñ "‘Rñ "ó    c                ó   € \         h)zFThe key for this element; the returned type must implement comparison.)ÚNotImplementedError©Úselfs   &r   ÚkeyÚElement.key   s   € ä!Ð!r   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s   ø‡ € Ù5÷"ö "r   r   ÚET)Úboundc                ó0   € V ^8„  d   QhR\         R\         /# ©r   Útr   ©Úint)r   s   "r   r   r      s   € ÷ ñ ŒCð ”Cñ r   c                ó   € V ^,
          # )zSThe minimum number of keys in a non-root node for a BTree with the specified
``t``
r   ©r,   s   &r   Ú_MINr1      s   € ð ˆq�5€Lr   c                ó0   € V ^8„  d   QhR\         R\         /# r+   r-   )r   s   "r   r   r   #   s   € ÷ ñ ŒCð ”Cñ r   c                ó"   € ^V ,          ^,
          # )zGThe maximum number of keys in node for a BTree with the specified ``t``r   r0   s   &r   Ú_MAXr4   #   s   € àˆq�5�1�9Ðr   c                   ó*   a € ] tR t^(t o RtR tRtV tR# )Ú_CreatorzÃA _Creator class instance is used as a unique id for the BTree which created
a node.

We use a dedicated creator rather than just a BTree reference to avoid circularity
that would complicate GC.
c                ó   € \        V 4      R  # )Úx)Úidr   s   &r   Ú__str__Ú_Creator.__str__0   s   € Ü�T“(˜1�Ðr   r   N)r    r!   r"   r#   r$   r:   r%   r&   r'   s   @r   r6   r6   (   s   ø‡ € ñ÷ð r   r6   c                   ó¾  a € ] tR t^4t o Rt. R1OtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 lt	V 3R
 lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R  lR! ltV 3R" lR# ltV 3R$ lR% ltV 3R& lR' ltV 3R( lR) ltV 3R* lR+ ltV 3R, lR- ltR. tR/tV tR0# )2Ú_Nodez>A Node in the BTree.

A Node (leaf or internal) of the BTree.
c                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# )r   r,   ÚcreatorÚis_leaf)r.   r6   Úbool)r   r   s   "€r   r   Ú_Node.__annotate__<   s"   ø€ ÷ 0ñ 0™#ð 0©ð 0¹4ñ 0r   c                óX   € V^8¼  g   Q hWn         W n        W0n        . V n        . V n        R# )é   N©r,   r?   r@   ÚeltsÚchildren)r   r,   r?   r@   s   &&&&r   Ú__init__Ú_Node.__init__<   s*   € Ø�AŒvˆˆvØŒØŒØŒØ ˆŒ	Ø-/ˆŽr   c                ó    <€ V ^8„  d   QhRS[ /# r   ©rA   )r   r   s   "€r   r   rB   D   ó   ø€ ÷ .ñ .™Dñ .r   c                ó¶   € \        V P                  4      \        V P                  4      8:  g   Q h\        V P                  4      \        V P                  4      8H  # )z/Does this node have the maximal number of keys?)ÚlenrF   r4   r,   r   s   &r   Ú
is_maximalÚ_Node.is_maximalD   ó;   € ä�4—9‘9‹~¤ d§f¡f£Ô-Ð-Ð-Ü�4—9‘9‹~¤ d§f¡f£Ñ-Ð-r   c                ó    <€ V ^8„  d   QhRS[ /# r   rK   )r   r   s   "€r   r   rB   I   rL   r   c                ó¶   € \        V P                  4      \        V P                  4      8¼  g   Q h\        V P                  4      \        V P                  4      8H  # )z/Does this node have the minimal number of keys?)rN   rF   r1   r,   r   s   &r   Ú
is_minimalÚ_Node.is_minimalI   rQ   r   c                ó<   <€ V ^8„  d   QhRS[ RS[S[S[3,          /# ©r   r   r   )r   Útupler.   rA   )r   r   s   "€r   r   rB   N   s$   ø€ ÷ ñ ¡"ð ©©s±D¨yÕ)9ñ r   c                ó¨  € \        V P                  4      pV^ 8”  d1   WP                  V^,
          ,          P                  4       8”  d   VR3# ^ p\        V P                  4      pV^,
          pRpW$8:  d]   W$,           ^,          pV P                  V,          P                  4       pW8X  d	   TpRp W53# W8  d   TpV^,
          pKW  V^,           pKb  W53# )z·Get the index of the ``Element`` matching ``key`` or the index of its
least successor.

Returns a tuple of the index and an ``equal`` boolean that is ``True`` iff.
the key was found.
FT)rN   rF   r   )r   r   ÚlÚiÚrÚequalÚmÚks   &&      r   Úsearch_in_nodeÚ_Node.search_in_nodeN   sÂ   € ô �—	‘	‹NˆØˆqŒ5�SŸ9™9 Q¨¥UÕ+×/Ñ/Ó1Ô1à�e�8ˆOØˆÜ�—	‘	‹NˆØ��EˆØˆØŒfØ•˜1•ˆAØ—	‘	˜!•× Ñ Ó"ˆAØŒxØ�Ø�Øð ˆxˆð ”Ø�Ø˜•E’à˜•E’Øˆxˆr   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úindexr   ú_Node[KT, ET]r-   )r   r   s   "€r   r   rB   k   s   ø€ ÷ ñ ¡Sð ¨_ñ r   c                óº   € V P                   '       d   Q hV P                  V,          pVP                  V P                  4      pV'       d   W0P                  V&   V# V# ©N)r@   rG   Ú	maybe_cowr?   )r   rc   ÚchildÚcloneds   &&  r   Úmaybe_cow_childÚ_Node.maybe_cow_childk   sJ   € Ø—<—<�<ÐÐØ—‘˜eÕ$ˆØ—‘ §¡Ó.ˆßØ#)�M‰M˜%Ñ ØˆMàˆLr   c                óJ   <€ V ^8„  d   QhRS[ RS[S[R,          S[3,          /# )r   r   r   rd   )r   r   r   r.   )r   r   s   "€r   r   rB   u   s*   ø€ ÷ (ñ (™Rð (¡E©(°?Õ*CÁSÐ*HÕ$Iñ (r   c                óª   € V P                  V4      w  r#V'       d   W3# V P                  '       d   R# V P                  V4      pVP                  V4      # )z¼Get the node associated with key and its index, doing
copy-on-write if we have to descend.

Returns a tuple of the node and the index, or the tuple ``(None, 0)``
if the key was not found.
)Né    )r`   r@   rj   Ú	_get_node)r   r   r[   r]   rh   s   &&   r   ro   Ú_Node._get_nodeu   sO   € ð ×&Ñ& sÓ+‰ˆßØ�9ÐØ�\�\ˆ\ØÐà×(Ñ(¨Ó+ˆEØ—?‘? 3Ó'Ð'r   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# ©r   r   r   N©r   r(   )r   r   s   "€r   r   rB   …   s   ø€ ÷ -ñ -‘rð -™b 4�iñ -r   c                óÊ   € V P                  V4      w  r#V'       d   V P                  V,          # V P                  '       d   R# V P                  V,          P	                  V4      # )z8Get the element associated with *key* or return ``None``N)r`   rF   r@   rG   Úget)r   r   r[   r]   s   &&  r   ru   Ú	_Node.get…   sK   € à×&Ñ& sÓ+‰ˆßØ—9‘9˜Q•<ÐØ�\�\ˆ\Ùà—=‘= Õ#×'Ñ'¨Ó,Ð,r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   rc   r   Nr-   )r   r   s   "€r   r   rB   �   s   ø€ ÷ ñ ±ð ¸ñ r   c                óx  € V^ 8X  d   R# V P                   V^,
          ,          p\        VP                  4      \        V P                  4      8X  d   R# V P                  V^,
          4      p\        VP                  4      \        V P                  4      8  d#   VP                  W^,
          4      '       d   KM  R# R# )a  Try to minimize the number of Nodes in a BTree where the insertion
is done in-order or close to it, by stealing as much as we can from our
right sibling.

If we don't do this, then an in-order insertion will produce a BTree
where most of the nodes are minimal.
N)rG   rN   rF   r4   r,   rj   Útry_right_steal)r   rc   Úlefts   && r   Úoptimize_in_order_insertionÚ!_Node.optimize_in_order_insertion�   s„   € ð �AŒ:ÙØ�}‰}˜U Q�YÕ'ˆÜˆt�y‰y‹>œT $§&¡&›\Ô)ÙØ×#Ñ# E¨A¥IÓ.ˆÜ�$—)‘)‹nœt D§F¡F›|Ô+Ø×'Ñ'¨°a­i×8Ô8Ùñ ,r   c                ó:   <€ V ^8„  d   QhRS[ RS[RS[ R,          /# )r   ÚelementÚin_orderr   N©r(   rA   )r   r   s   "€r   r   rB   ¡   s&   ø€ ÷ ñ ¡bð ±Dð ¹RÀ$½Yñ r   c                ó  € V P                  4       '       d   Q h VP                  4       pV P                  V4      w  rEV'       d$   V P                  V,          pWP                  V&   V# V P                  '       d   V P                  P                  WA4       R# V P                  V4      pVP                  4       '       d!   V P                  ! VP                  4       !   KÅ  VP                  W4      pV'       d   V P                  V4       V# ©TN)rO   r   r`   rF   r@   Úinsertrj   ÚadoptÚsplitÚinsert_nonfullr{   )	r   r~   r   r   r[   r]   Úoldrh   Úoelts	   &&&      r   r†   Ú_Node.insert_nonfull¡   sÏ   € Ø—?‘?×$Ò$Ð$Ð$ØØ—+‘+“-ˆCØ×*Ñ*¨3Ó/‰HˆAßà—i‘i •l�Ø&—	‘	˜!‘Ø�
Ø——�Ø—	‘	× Ñ  Ô,Ùà×,Ñ,¨QÓ/�Ø×#Ñ#×%Ò%Ø—J’J §¡£Ò.ñ Ø×+Ñ+¨GÓ>�ßØ×4Ñ4°QÔ7Ø�r   c                ó6   <€ V ^8„  d   QhRS[ RS[R3,          /# )r   r   rd   )rX   r(   )r   r   s   "€r   r   rB   º   s    ø€ ÷ 
#ñ 
#‘u˜_©b°/ÐAÕBñ 
#r   c                ó¶  € V P                  4       '       g   Q hV P                  V P                  V P                  V P                  4      p\        V P                  \        V P                  4      ^,           R 4      Vn        V P                  \        V P                  4      ,          p\        V P                  R\        V P                  4       4      V n        V P                  '       go   \        V P                  \        V P                  4      ^,           R 4      Vn        \        V P                  R\        V P                  4      ^,            4      V n        WV3# )zASplit a maximal node into two minimal ones and a central element.N)	rO   Ú	__class__r,   r?   r@   ÚlistrF   r1   rG   )r   ÚrightÚmiddles   &  r   r…   Ú_Node.splitº   së   € à�‰× Ò Ð Ð Ø—‘˜tŸv™v t§|¡|°T·\±\ÓBˆÜ˜$Ÿ)™)¤D¨¯©£L°1Õ$4Ð$6Ð7Ó8ˆŒ
Ø—‘œ4 §¡›<Õ(ˆÜ˜Ÿ™ >¤T¨$¯&©&£\Ð2Ó3ˆŒ	Ø�|�|ˆ|Ü! $§-¡-´°T·V±V³¸qÕ0@Ð0BÐ"CÓDˆEŒNÜ  §¡Ð/A´°d·f±f³ÀÕ1AÐ!BÓCˆDŒMØ˜UÐ"Ð"r   c                ó*   <€ V ^8„  d   QhRRRS[ RS[/# ©r   Úparentrd   rc   r   ©r.   rA   )r   r   s   "€r   r   rB   Æ   s"   ø€ ÷ ñ  _ð ¹Sð ÁTñ r   c                ó*  € V^ 8w  Ed   VP                   V^,
          ,          pVP                  4       '       gÛ   VP                  V^,
          4      pVP                  V^,
          ,          pVP                  P	                  4       VP                  V^,
          &   V P                  P                  ^ V4       VP                  '       gK   V P                  '       d   Q hVP                   P	                  4       pV P                   P                  ^ V4       R# R# )z‡Try to steal from this Node's left sibling for balancing purposes.

Returns ``True`` if the theft was successful, or ``False`` if not.
TF)rG   rT   rj   rF   Úpoprƒ   r@   )r   r“   rc   rz   Úeltrh   s   &&&   r   Útry_left_stealÚ_Node.try_left_stealÆ   sÄ   € ð
 �A�:Ø—?‘? 5¨1¥9Õ-ˆDØ—?‘?×$Ò$Ø×-Ñ-¨e°a­iÓ8�Ø—k‘k %¨!¥)Õ,�Ø)-¯©¯©«�—‘˜E A�IÑ&Ø—	‘	× Ñ   CÔ(Ø—|—|�|Ø#Ÿ|Ÿ|˜|Ð+Ð+Ø ŸM™M×-Ñ-Ó/�EØ—M‘M×(Ñ(¨¨EÔ2ÙÙr   c                ó*   <€ V ^8„  d   QhRRRS[ RS[/# r’   r”   )r   r   s   "€r   r   rB   Ù   s"   ø€ ÷ ñ  oð ¹cð Ádñ r   c                ó@  € V^,           \        VP                  4      8  dý   VP                  V^,           ,          pVP                  4       '       gÍ   VP                  V^,           4      pVP                  V,          pVP                  P                  ^ 4      VP                  V&   V P                  P                  V4       VP                  '       gK   V P                  '       d   Q hVP                  P                  ^ 4      pV P                  P                  V4       R# R# )zˆTry to steal from this Node's right sibling for balancing purposes.

Returns ``True`` if the theft was successful, or ``False`` if not.
TF)rN   rG   rT   rj   rF   r–   Úappendr@   )r   r“   rc   rŽ   r—   rh   s   &&&   r   ry   Ú_Node.try_right_stealÙ   sÍ   € ð
 �1�9”s˜6Ÿ?™?Ó+Ô+Ø—O‘O E¨A¥IÕ.ˆEØ×#Ñ#×%Ò%Ø×.Ñ.¨u°q­yÓ9�Ø—k‘k %Õ(�Ø%*§Z¡Z§^¡^°AÓ%6�—‘˜EÑ"Ø—	‘	× Ñ  Ô%Ø—}—}�}Ø#Ÿ|Ÿ|˜|Ð+Ð+Ø!ŸN™N×.Ñ.¨qÓ1�EØ—M‘M×(Ñ(¨Ô/ÙÙr   c                ó,   <€ V ^8„  d   QhRRRS[ RRRR/# )r   rz   rd   r�   rŽ   r   N©r(   )r   r   s   "€r   r   rB   ì   s*   ø€ ÷ /ñ /˜/ð /±2ð /¸oð /ÐRVñ /r   c                ó°  € V P                  4       '       d   Q hV P                  '       d   Q hVP                  4       pV P                  V4      w  rVV'       d   Q hV P                  P                  WR4       \        V P                  4      ^ 8X  d   W.V n        R# V P                  V,          V8X  g   Q hV P                  P                  V^,           V4       R# )zÂAdopt left, middle, and right into our Node (which must not be maximal,
and which must not be a leaf).  In the case were we are not the new root,
then the left child must already be in the Node.N)rO   r@   r   r`   rF   rƒ   rN   rG   )r   rz   r�   rŽ   r   r[   r]   s   &&&&   r   r„   Ú_Node.adoptì   s¦   € ð —?‘?×$Ò$Ð$Ð$Ø—<—<�<ÐÐØ�j‰j‹lˆØ×&Ñ& sÓ+‰ˆßÐˆyØ�	‰	×Ñ˜Ô#Üˆt�}‰}Ó Ô"à!˜MˆDŽMà—=‘= Õ# tÔ+Ð+Ð+Ø�M‰M× Ñ   Q¥¨Ö.r   c                ó(   <€ V ^8„  d   QhRRRS[ RR/# ©r   r“   rd   rc   r   Nr-   )r   r   s   "€r   r   rB   ý   s"   ø€ ÷ 1ñ 1˜Oð 1±Cð 1¸Dñ 1r   c                ón  € VP                   P                  V^,           4      pV P                  P                  VP                  P                  V4      4       V P                  P	                  VP                  4       V P
                  '       g(   V P                   P	                  VP                   4       R# R# )z>Merge this node's parent and its right sibling into this node.N)rG   r–   rF   rœ   Úextendr@   )r   r“   rc   rŽ   s   &&& r   ÚmergeÚ_Node.mergeý   ss   € à—‘×#Ñ# E¨A¥IÓ.ˆØ�	‰	×Ñ˜Ÿ™Ÿ™¨Ó/Ô0Ø�	‰	×Ñ˜Ÿ™Ô$Ø�|�|ˆ|Ø�M‰M× Ñ  §¡Ö0ñ r   c                ó    <€ V ^8„  d   QhRS[ /# r   rŸ   )r   r   s   "€r   r   rB     s   ø€ ÷ .ñ .™ñ .r   c                óŽ   € V P                   '       d   V P                  ^ ,          # V P                  ^ ,          P                  4       # )z"The least element in this subtree.)r@   rF   rG   Úminimumr   s   &r   rª   Ú_Node.minimum  s1   € à�<�<ˆ<Ø—9‘9˜Q•<Ðà—=‘= Õ#×+Ñ+Ó-Ð-r   c                ó    <€ V ^8„  d   QhRS[ /# r   rŸ   )r   r   s   "€r   r   rB     s   ø€ ÷ /ñ /™ñ /r   c                óŽ   € V P                   '       d   V P                  R,          # V P                  R,          P                  4       # )z%The greatest element in this subtree.éÿÿÿÿ)r@   rF   rG   Úmaximumr   s   &r   r¯   Ú_Node.maximum  s1   € à�<�<ˆ<Ø—9‘9˜R•=Ð à—=‘= Õ$×,Ñ,Ó.Ð.r   c                ó(   <€ V ^8„  d   QhRRRS[ RR/# r£   r-   )r   r   s   "€r   r   rB     s"   ø€ ÷ *ñ *˜oð *±cð *¸dñ *r   c                ó&  € VP                   '       d   Q hV P                  W4      '       d   R# V P                  W4      '       d   R# V^ 8X  d   V P                  W4       R# VP	                  V^,
          4      pVP                  W^,
          4       R# )z¦This Node is minimal, and we want to make it non-minimal so we can delete.
We try to steal from our siblings, and if that doesn't work we will merge
with one of them.N)r@   r˜   ry   r¦   rj   )r   r“   rc   rz   s   &&& r   ÚbalanceÚ_Node.balance  st   € ð —>—>�>Ð!Ð!Ø×Ñ˜v×-Ò-ÙØ×Ñ ×.Ò.Ùà�AŒ:à�J‰J�vÖ%ð ×)Ñ)¨%°!­)Ó4ˆDØ�J‰J�v q�yÖ)r   c          	      ó\   <€ V ^8„  d   QhRS[ RS[R,          RS[R,          RS[R,          /# )r   r   r“   rd   ÚexactNr   )r   r   r(   )r   r   s   "€r   r   rB   &  s:   ø€ ÷ -ñ -Ùð-Ù'¨Õ8ð-ÙACÀdÅð-á	ˆd�ñ-r   c                óž  € Ve   V P                  4       '       d   Q hV P                  V4      w  rERpV'       d™   Ve#   V P                  V,          VJd   \        R4      hV P                  '       d   V P                  P                  V4      # RpTpV P                  V^,           ,          P                  4       pVP                  4       pV^,           pV P                  '       d   Ve   \        R4      hR# V P                  V4      pVP                  4       '       dZ   VP                  W4       V P                  V4      w  rEV'       d   Q hV P                  V,          pVP                  4       '       d   Q hVP                  WV4      p	VeC   V P                  V4      w  r¤V
f   Q hV	f   Q hV
P                  V,          pWšP                  V&   Tp	V	# )z±Delete an element matching *key* if it exists.  If *exact* is not ``None``
then it must be an exact match with that element.  The Node must not be
minimal unless it is the root.Nz'exact delete did not match existing eltzexact delete had no match)rT   r`   rF   Ú
ValueErrorr@   r–   rG   rª   r   rj   r³   Údeletero   )r   r   r“   r¶   r[   r]   Úoriginal_keyÚleast_successorrh   r—   Únoderˆ   s   &&&&        r   r¹   Ú_Node.delete&  s”  € ð Š~ T§_¡_×%6Ò%6Ð6Ð6Ø×&Ñ& sÓ+‰ˆØˆßàÒ  T§Y¡Y¨q¥\¸Ó%>Ü Ð!JÓKÐKØ�|�|ˆ|Ø—y‘y—}‘} QÓ'Ð'ð ˆEØˆLØ"Ÿm™m¨A°­EÕ2×:Ñ:Ó<ˆOØ!×%Ñ%Ó'ˆCØ�A•ˆAØ�<�<ˆ<àÒ Ü Ð!<Ó=Ð=Ùà×$Ñ$ QÓ'ˆØ×Ñ×ÒØ�M‰M˜$Ô"à×*Ñ*¨3Ó/‰HˆAßÐ�9Ø—M‘M !Õ$ˆEØ×'Ñ'×)Ò)Ð)Ð)Ø�l‰l˜3 eÓ,ˆØÒ#Ø—n‘n \Ó2‰GˆDØÒ#Ð#Ð#Ø’?Ð"�?Ø—9‘9˜Q•<ˆDØ�I‰I�a‰LØˆCØˆ
r   c                ó:   <€ V ^8„  d   QhRS[ S[.R3,          RR/# ©r   ÚvisitNr   ©r   r(   )r   r   s   "€r   r   rB   U  s&   ø€ ÷ 4ñ 4¡H©b¨T°4¨ZÕ$8ð 4¸Tñ 4r   c                ó&  € \        V P                  4       FA  w  r#V P                  '       g#   V P                  V,          P	                  V4       V! V4       KC  	  V P                  '       g%   V P                  R,          P	                  V4       R# R# )z-Call *visit* on all of the elements in order.Nr®   )Ú	enumeraterF   r@   rG   Úvisit_in_order)r   rÀ   r[   r—   s   &&  r   rÄ   Ú_Node.visit_in_orderU  se   € ä §	¡	Ö*‰FˆAØ—<—<�<Ø—‘˜aÕ ×/Ñ/°Ô6Ù�#ŽJñ +ð �|�|ˆ|Ø�M‰M˜"Õ×,Ñ,¨UÖ3ñ r   c                ó8   <€ V ^8„  d   QhRS[ R.R3,          RR/# )r   rÀ   rd   Nr   )r   )r   r   s   "€r   r   rB   ^  s)   ø€ ÷ 5ñ 5©X°Ð6GÈÐ6MÕ-Nð 5ÐSWñ 5r   c                ó†   € V! V 4       V P                   '       g'   V P                   F  pVP                  V4       K  	  R# R# )z?Visit nodes in preorder.  This method is only used for testing.N)r@   rG   Ú_visit_preorder_by_node)r   rÀ   rh   s   && r   rÈ   Ú_Node._visit_preorder_by_node^  s3   € áˆdŒØ�|�|ˆ|ØŸœ�Ø×-Ñ-¨eÖ4ó 'ñ r   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# ©r   r?   r   rd   )r6   r   )r   r   s   "€r   r   rB   e  s    ø€ ÷ ñ ¡ð ©h°Õ.Gñ r   c                óH   € V P                   VJd   V P                  V4      # R# )z”Return a clone of this Node if it was not created by *creator*, or ``None``
otherwise (i.e. copy for copy-on-write if we haven't already copied it).N)r?   Úclone)r   r?   s   &&r   rg   Ú_Node.maybe_cowe  s"   € ð �<‰<˜wÓ&Ø—:‘:˜gÓ&Ð&ár   c                ó$   <€ V ^8„  d   QhRS[ RR/# rË   )r6   )r   r   s   "€r   r   rB   m  s   ø€ ÷ ñ ™Xð ¨/ñ r   c                ó
  € V P                  V P                  WP                  4      pVP                  P	                  V P                  4       V P                  '       g&   VP
                  P	                  V P
                  4       V# )z+Make a shallow-copy duplicate of this node.)rŒ   r,   r@   rF   r¥   rG   )r   r?   ri   s   && r   rÍ   Ú_Node.clonem  sT   € à—‘ §¡¨·±Ó>ˆØ�‰×Ñ˜4Ÿ9™9Ô%Ø�|�|ˆ|Ø�O‰O×"Ñ" 4§=¡=Ô1Øˆr   c           	     ó  € V P                   '       g?   R R P                  V P                   Uu. uF  p\        V4      R NK  	  up4      ,           pMRp\        V 4      R R V P                   R V P
                   V 2# u upi )Ú r8   Ú )r@   ÚjoinrG   r9   r?   rF   )r   ÚcrG   s   &  r   r:   Ú_Node.__str__u  so   € Ø�|�|ˆ|Ø˜SŸX™X¸T¿]º]Ó&K¹]¸¬"¨Q«%°¨¢|¹]Ñ&KÓLÕL‰HàˆHÜ�T“(˜1�˜Q˜tŸ|™|˜n¨A¨d¯i©i¨[¸¸
ÐCÐCùò 'Ls   ­A=
)rG   r?   rF   r@   r,   NrE   )r    r!   r"   r#   r$   Ú	__slots__rH   rO   rT   r`   rj   ro   ru   r{   r†   r…   r˜   ry   r„   r¦   rª   r¯   r³   r¹   rÄ   rÈ   rg   rÍ   r:   r%   r&   r'   s   @r   r=   r=   4   sû   ø‡ € ñò
 @€I÷0ð 0÷.ð .÷
.ð .÷
ð ÷:ð ÷(ð (÷ -ð -÷ð ÷$ð ÷2
#ð 
#÷ð ÷&ð ÷&/ð /÷"1ð 1÷.ð .÷/ð /÷*ð *÷&-ð -÷^4ð 4÷5ð 5÷ð ÷ð ÷Dð Dr   r=   c                   óâ   a € ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltR	 tR
 t	V 3R lR lt
V 3R lR ltV 3R lR ltRV 3R lR lltV 3R lR ltV 3R lR ltR tR tRtV tR# )ÚCursori}  z½A seekable cursor for a BTree.

If you are going to use a cursor on a mutable BTree, you should use it
in a ``with`` block so that any mutations of the BTree automatically park
the cursor.
c                ó   <€ V ^8„  d   QhRR/# )r   ÚbtreezBTree[KT, ET]r   )r   r   s   "€r   r   ÚCursor.__annotate__…  s   ø€ ÷ &ñ &˜oñ &r   c                ó‚   € Wn         R V n        ^ V n        RV n        RV n        . V n        RV n        R V n        RV n        R # )NFT)	rÜ   Úcurrent_nodeÚcurrent_indexÚrecurseÚ
increasingÚparentsÚparkedÚparking_keyÚparking_key_read)r   rÜ   s   &&r   rH   ÚCursor.__init__…  sE   € ØŒ
Ø*.ˆÔð #$ˆÔØˆŒØˆŒØ02ˆŒØˆŒØ&*ˆÔØ %ˆÖr   c                ó   <€ V ^8„  d   QhRR/# ©r   r   Nr   )r   r   s   "€r   r   rÝ   “  s   ø€ ÷ #ñ #˜Tñ #r   c                óJ  € V P                   f   Q hV P                   P                  '       gw   V P                  P                  V P                   V P                  34       V P                   P
                  V P                  ,          V n         V P                   f   Q h^ V n        K’  R # rf   )rß   r@   rã   rœ   rà   rG   r   s   &r   Ú_seek_leastÚCursor._seek_least“  s‰   € ð × Ñ Ò,Ð,Ð,Ø×#Ñ#×+×+Ð+Ø�L‰L×Ñ ×!2Ñ!2°D×4FÑ4FÐ GÔHØ $× 1Ñ 1× :Ñ :¸4×;MÑ;MÕ NˆDÔØ×$Ñ$Ò0Ð0Ð0Ø!"ˆDÖñ	 ,r   c                ó   <€ V ^8„  d   QhRR/# ré   r   )r   r   s   "€r   r   rÝ   �  s   ø€ ÷ =ñ = ñ =r   c                ó„  € V P                   f   Q hV P                   P                  '       g”   V P                  P                  V P                   V P                  34       V P                   P
                  V P                  ,          V n         V P                   f   Q h\        V P                   P                  4      V n        K¯  R # rf   )rß   r@   rã   rœ   rà   rG   rN   rF   r   s   &r   Ú_seek_greatestÚCursor._seek_greatest�  sš   € ð × Ñ Ò,Ð,Ð,Ø×#Ñ#×+×+Ð+Ø�L‰L×Ñ ×!2Ñ!2°D×4FÑ4FÐ GÔHØ $× 1Ñ 1× :Ñ :¸4×;MÑ;MÕ NˆDÔØ×$Ñ$Ò0Ð0Ð0Ü!$ T×%6Ñ%6×%;Ñ%;Ó!<ˆDÖñ	 ,r   c                ó<   € V P                   '       g
   RV n         R# R# )aw  Park the cursor.

A cursor must be "parked" before mutating the BTree to avoid undefined behavior.
Cursors created in a ``with`` block register with their BTree and will park
automatically.  Note that a parked cursor may not observe some changes made when
it is parked; for example a cursor being iterated with next() will not see items
inserted before its current position.
TN)rä   r   s   &r   ÚparkÚCursor.park§  s   € ð �{�{ˆ{ØˆDŽKñ r   c                ó"  € V P                   '       d}   V P                  e_   V P                  pV P                  '       d   V P                  '       * pMV P                  pV P	                  V P                  V4       Wn        RV n         R V n        R # R # )NF)rä   rå   râ   ræ   Úseek)r   râ   Úbefores   &  r   Ú_maybe_unparkÚCursor._maybe_unpark³  sr   € Ø�;�;ˆ;Ø×ÑÒ+à!Ÿ_™_�
Ø×(×(Ð(ð "&§¡Ô0‘Fð
 "Ÿ_™_�FØ—	‘	˜$×*Ñ*¨FÔ3Ø",”ØˆDŒKØ#ˆDÖñ! r   c                ó.   <€ V ^8„  d   QhRS[ R,          /# ré   rŸ   )r   r   s   "€r   r   rÝ   Æ  ó   ø€ ÷ & ñ & ‘b˜4•iñ & r   c                óœ  € V P                  4        RV n        V P                  f€   V P                  ^ 8X  d   R# V P                  ^8X  g   Q hV P                  P
                  V n        \        V P                  P
                  P                  4      V n        V P                  4         V P                  '       d*   V P                  '       g   V P                  4        RV n	        RV n
        V ;P                  ^,          un        V P                  ^ 8¼  di   V P                  P                  V P                  ,          pV P                  P                  '       g   RV n	        VP                  4       V n        RV n        V# \        V P                  4      ^ 8”  d+   V P                  P                  4       w  V n        V n        EK  RV n        ^ V n        R# )zAGet the previous element, or return None if on the left boundary.NTF)r÷   rå   rß   rà   rÜ   ÚrootrN   rF   rï   rá   râ   r@   r   ræ   rã   r–   ©r   r—   s   & r   ÚprevÚCursor.prevÆ  sa  € à×ÑÔØˆÔØ×ÑÒ$à×!Ñ! QÔ&áà×)Ñ)¨QÔ.Ð.Ð.ð %)§J¡J§O¡O�Ô!Ü%(¨¯©¯©×)=Ñ)=Ó%>�Ô"Ø×#Ñ#Ô%ØØ�|�|ˆ|Ø——�ð ×'Ñ'Ô)Ø$�”Ø#ˆDŒOØ×Ò !Õ#ÕØ×!Ñ! QÔ&Ø×'Ñ'×,Ñ,¨T×-?Ñ-?Õ@�Ø×(Ñ(×0×0Ð0Ø#'�D”LØ#&§7¡7£9�Ô Ø(,�Ô%Ø�
ä�t—|‘|Ó$ qÔ(Ø<@¿L¹L×<LÑ<LÓ<NÑ9�DÔ% t×'9à(,�DÔ%Ø)*�DÔ&Ùr   c                ó.   <€ V ^8„  d   QhRS[ R,          /# ré   rŸ   )r   r   s   "€r   r   rÝ   î  rú   r   c                óˆ  € V P                  4        RV n        V P                  fY   V P                  ^8X  d   R# V P                  ^ 8X  g   Q hV P                  P
                  V n        ^ V n        V P                  4         V P                  '       d*   V P                  '       d   V P                  4        RV n        RV n        V P                  \        V P                  P                  4      8  d‚   V P                  P                  V P                  ,          pV ;P                  ^,          un        V P                  P                  '       g   RV n        VP                  4       V n        RV n        V# \        V P                  4      ^ 8”  d+   V P                  P                  4       w  V n        V n        EK6  RV n        ^V n        R# )z>Get the next element, or return None if on the right boundary.NTF)r÷   rå   rß   rà   rÜ   rü   rë   rá   râ   rN   rF   r@   r   ræ   rã   r–   rý   s   & r   ÚnextÚCursor.nextî  s_  € à×ÑÔØˆÔØ×ÑÒ$à×!Ñ! QÔ&áà×)Ñ)¨QÔ.Ð.Ð.ð %)§J¡J§O¡O�Ô!Ø%&�Ô"Ø× Ñ Ô"ØØ�|�|ˆ|Ø—?—?�?ð ×$Ñ$Ô&Ø$�”Ø"ˆDŒOØ×!Ñ!¤C¨×(9Ñ(9×(>Ñ(>Ó$?Ô?Ø×'Ñ'×,Ñ,¨T×-?Ñ-?Õ@�Ø×"Ò" aÕ'Õ"Ø×(Ñ(×0×0Ð0Ø#'�D”LØ#&§7¡7£9�Ô Ø(,�Ô%Ø�
ä�t—|‘|Ó$ qÔ(Ø<@¿L¹L×<LÑ<LÓ<NÑ9�DÔ% t×'9à(,�DÔ%Ø)*�DÔ&Ùr   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   rö   r[   r   N)rA   r.   )r   r   s   "€r   r   rÝ     s"   ø€ ÷ 'ñ '©ð '±#ð '¸$ñ 'r   c                óB   € V'       d	   W n         R# V^,           V n         R# )é   N)rà   )r   rö   r[   s   &&&r   Ú_adjust_for_beforeÚCursor._adjust_for_before  s   € ßØ!"Öà!" Q¥ˆDÖr   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r   rö   r   N)r   rA   )r   r   s   "€r   r   rÝ     s"   ø€ ÷ !#ñ !#™ð !#¡Dð !#°Dñ !#r   c                óÚ  € V P                   P                  V n        V P                  f   Q hRV n        . V n        W n        RV n        Wn        RV n        V P                  P                  '       g¾   V P                  P                  V4      w  r4V'       d>   V P                  W#4       V'       d   V P                  4        R# V P                  4        R# V P                  P                  V P                  V34       V P                  P                  V,          V n        V P                  e   K×  Q hV P                  P                  V4      w  r4V'       d   V P                  W#4       R# W0n        R# )a�  Seek to the specified key.

If *before* is ``True`` (the default) then the cursor is positioned just
before *key* if it exists, or before its least successor if it doesn't.  A
subsequent next() will retrieve this value.  If *before* is ``False``, then
the cursor is positioned just after *key* if it exists, or its greatest
precessessor if it doesn't.  A subsequent prev() will return this value.
NF)rÜ   rü   rß   rá   rã   râ   rä   rå   ræ   r@   r`   r  rï   rë   rœ   rG   rà   )r   r   rö   r[   r]   s   &&&  r   rõ   ÚCursor.seek  s%  € ð !ŸJ™JŸO™OˆÔØ× Ñ Ò,Ð,Ð,ØˆŒØˆŒØ ŒØˆŒØÔØ %ˆÔØ×#Ñ#×+×+Ð+Ø×(Ñ(×7Ñ7¸Ó<‰HˆAßØ×'Ñ'¨Ô2ßØ×'Ñ'Ô)ñ ð ×$Ñ$Ô&ÙØ�L‰L×Ñ ×!2Ñ!2°AÐ 6Ô7Ø $× 1Ñ 1× :Ñ :¸1Õ =ˆDÔØ×$Ñ$Ô0Ð0Ð0Ø×$Ñ$×3Ñ3°CÓ8‰ˆßØ×#Ñ# FÖ.à!"Ör   c                ó   <€ V ^8„  d   QhRR/# ré   r   )r   r   s   "€r   r   rÝ   ?  s   ø€ ÷ 
 ñ 
 ˜Dñ 
 r   c                óh   € RV n         ^ V n        RV n        RV n        . V n        RV n        RV n        R# )zŒSeek to the left boundary (i.e. just before the least element).

A subsequent next() will return the least element if the BTree isn't empty.NFT©rß   rà   rá   râ   rã   rä   rå   r   s   &r   Ú
seek_firstÚCursor.seek_first?  s8   € ð !ˆÔØˆÔØˆŒØˆŒØˆŒØˆŒØˆÖr   c                ó   <€ V ^8„  d   QhRR/# ré   r   )r   r   s   "€r   r   rÝ   K  s   ø€ ÷  ñ  ˜4ñ  r   c                óh   € RV n         ^V n        RV n        RV n        . V n        RV n        RV n        R# )z“Seek to the right boundary (i.e. just after the greatest element).

A subsequent prev() will return the greatest element if the BTree isn't empty.
NFr  r   s   &r   Ú	seek_lastÚCursor.seek_lastK  s8   € ð
 !ˆÔØˆÔØˆŒØˆŒØˆŒØˆŒØˆÖr   c                ó<   € V P                   P                  V 4       V # rf   )rÜ   Úregister_cursorr   s   &r   Ú	__enter__ÚCursor.__enter__X  s   € Ø�
‰
×"Ñ" 4Ô(Øˆr   c                ó<   € V P                   P                  V 4       R # ©F)rÜ   Úderegister_cursor)r   Úexc_typeÚ	exc_valueÚ	tracebacks   &&&&r   Ú__exit__ÚCursor.__exit__\  s   € Ø�
‰
×$Ñ$ TÔ*Ùr   )	rÜ   rà   rß   râ   rã   rä   rå   ræ   rá   N)T)r    r!   r"   r#   r$   rH   rë   rï   rò   r÷   rþ   r  r  rõ   r  r  r  r  r%   r&   r'   s   @r   rÚ   rÚ   }  s€   ø‡ € ñ÷&ð &÷#ð #÷=ð =ò
ò$÷&& ð & ÷P& ð & ÷P'ð '÷!#ò !#÷F
 ð 
 ÷ ð  ò÷ð r   rÚ   c                   ó   € ] tR tRtRtRtR# )Ú	Immutableia  zThe BTree is immutable.r   N)r    r!   r"   r#   r$   r%   r   r   r   r"  r"  a  s   † Ý!r   r"  c                   ó$  a € ] tR tRt o RtR]RR/V 3R lR lltR tV 3R	 lR
 ltR#V 3R lR llt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltR tV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltR  tR! tR"tV tR# )$ÚBTreeie  z2An in-memory BTree with copy-on-write and cursors.r,   ÚoriginalNc                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# )r   r,   r%  r$  )r.   r   )r   r   s   "€r   r   ÚBTree.__annotate__h  s    ø€ ÷ ñ ™Sð ¹ÀÕ8Iñ r   c               ó’  € \        4       V n        RV n        V  V  V  \        4       V n        VeS   VP                  '       g   \        R4      hVP                  V n        VP                  V n        VP                  V n        R# V^8  d   \        R4      hWn        \        V P                  V P                  R4      V n        ^ V n        R# )zÕCreate a BTree.

If *original* is not ``None``, then the BTree is shallow-cloned from
*original* using copy-on-write.  Otherwise a new BTree with the specified
*t* value is created.

The BTree is not thread-safe.
FNzoriginal BTree is not immutablezt must be >= 3T)
r6   r?   Ú
_immutableÚsetÚcursorsr¸   r,   rü   Úsizer=   )r   r,   r%  s   &$$r   rH   ÚBTree.__init__h  sœ   € ô  “zˆŒØˆŒÙÙÙÜ$'£EˆŒØÒØ×&×&Ð&Ü Ð!BÓCÐCØ—Z‘ZˆDŒFØ Ÿ™ˆDŒIØ Ÿ™ˆDŽIà�1ŒuÜ Ð!1Ó2Ð2ØŒFÜ˜dŸf™f d§l¡l°DÓ9ˆDŒIØˆDŽIr   c                ó<   € V P                   '       g
   RV n         R# R# )z–Make the BTree immutable.

Attempts to alter the BTree after making it immutable will raise an
Immutable exception.  This operation cannot be undone.
TN)r)  r   s   &r   Úmake_immutableÚBTree.make_immutable†  s   € ð ��ˆØ"ˆDŽOñ r   c                ó   <€ V ^8„  d   QhRR/# ré   r   )r   r   s   "€r   r   r'  �  s   ø€ ÷ ñ ¨ñ r   c                ó|   € V P                   '       d   \        hV P                   F  pVP                  4        K  	  R # rf   )r)  r"  r+  rò   ©r   Úcursors   & r   Ú_check_mutable_and_parkÚBTree._check_mutable_and_park�  s'   € Ø�?�?ˆ?ÜˆOØ—l”lˆFØ�K‰KŽMó #r   c                ó:   <€ V ^8„  d   QhRS[ RS[RS[ R,          /# )r   r—   r   r   Nr€   )r   r   s   "€r   r   r'  ™  s&   ø€ ÷ ñ ¡"ð ±ð ÁÀdÅñ r   c                óð  € V P                  4        V P                  P                  V P                  4      pV'       d   W0n        V P                  P	                  4       '       d[   V P                  p\        V P                  V P                  R4      V n        V P                  P                  ! VP                  4       !   V P                  P                  W4      pVf   V ;P                  ^,          un
        V# )a  Insert the element into the BTree.

If *in_order* is ``True``, then extra work will be done to make left siblings
full, which optimizes storage space when the the elements are inserted in-order
or close to it.

Returns the previously existing element at the element's key or ``None``.
F)r5  rü   rg   r?   rO   r=   r,   r„   r…   r†   r,  )r   r—   r   ri   Úold_rootrˆ   s   &&&   r   Úinsert_elementÚBTree.insert_element™  s¦   € ð 	×$Ñ$Ô&Ø—‘×$Ñ$ T§\¡\Ó2ˆßØŒIØ�9‰9×Ñ×!Ò!Ø—y‘yˆHÜ˜dŸf™f d§l¡l°EÓ:ˆDŒIØ�I‰I�OŠO˜XŸ^™^Ó-Ò.Ø�y‰y×'Ñ'¨Ó6ˆØŠ<à�IŠI˜�N�IØˆr   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# rr   rs   )r   r   s   "€r   r   r'  °  s   ø€ ÷ "ñ "™rð "¡b¨4¥iñ "r   c                ó8   € V P                   P                  V4      # )zXGet the element matching *key* from the BTree, or return ``None`` if it
does not exist.
)rü   ru   ©r   r   s   &&r   Úget_elementÚBTree.get_element°  s   € ð �y‰y�}‰}˜SÓ!Ð!r   c                óH   <€ V ^8„  d   QhRS[ RS[R,          RS[R,          /# )r   r   r¶   Nr   rs   )r   r   s   "€r   r   r'  ¶  s*   ø€ ÷ ñ ™2ð ¡b¨4¥ið ±B¸µIñ r   c                ó  € V P                  4        V P                  P                  V P                  4      pV'       d   W0n        V P                  P	                  VR V4      pVe¢   V ;P
                  ^,          un        \        V P                  P                  4      ^ 8X  de   V P                  P                  '       gI   \        V P                  P                  4      ^8X  g   Q hV P                  P                  ^ ,          V n        V# rf   )
r5  rü   rg   r?   r¹   r,  rN   rF   r@   rG   )r   r   r¶   ri   r—   s   &&&  r   Ú_deleteÚBTree._delete¶  s·   € Ø×$Ñ$Ô&Ø—‘×$Ñ$ T§\¡\Ó2ˆßØŒIØ�i‰i×Ñ˜s D¨%Ó0ˆØŠ?à�IŠI˜�N�IÜ�4—9‘9—>‘>Ó" aÔ'ð —y‘y×(×(Ð(Ü˜tŸy™y×1Ñ1Ó2°aÔ7Ð7Ð7Ø $§	¡	× 2Ñ 2°1Õ 5�D”IØˆ
r   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# rr   rs   )r   r   s   "€r   r   r'  Ç  s   ø€ ÷ 'ñ '™bð '¡R¨$¥Yñ 'r   c                ó&   € V P                  VR4      # )zrDelete the element matching *key* from the BTree.

Returns the matching element or ``None`` if it does not exist.
N)rC  r>  s   &&r   Ú
delete_keyÚBTree.delete_keyÇ  s   € ð
 �|‰|˜C Ó&Ð&r   c                ó4   <€ V ^8„  d   QhRS[ RS[ R,          /# )r   r~   r   NrŸ   )r   r   s   "€r   r   r'  Î  s   ø€ ÷ ñ ¡Bð ©2°­9ñ r   c                óT   € V P                  VP                  4       V4      pW!J g   Q hV# )zgDelete *element* from the BTree.

Returns the matching element or ``None`` if it was not in the BTree.
)rC  r   )r   r~   Údelts   && r   Údelete_exactÚBTree.delete_exactÎ  s)   € ð
 �|‰|˜GŸK™K›M¨7Ó3ˆØ‹ÐˆØˆr   c                ó   € V P                   # rf   )r,  r   s   &r   Ú__len__ÚBTree.__len__×  ó   € Ø�y‰yÐr   c                ó:   <€ V ^8„  d   QhRS[ S[.R3,          RR/# r¿   rÁ   )r   r   s   "€r   r   r'  Ú  s&   ø€ ÷ (ñ (¡H©b¨T°4¨ZÕ$8ð (¸Tñ (r   c                ó<   € V P                   P                  V4       R# )zBCall *visit*(element) on all elements in the tree in sorted order.N)rü   rÄ   ©r   rÀ   s   &&r   rÄ   ÚBTree.visit_in_orderÚ  s   € à�	‰	× Ñ  Ö'r   c                ó:   <€ V ^8„  d   QhRS[ S[.R3,          RR/# r¿   )r   r=   )r   r   s   "€r   r   r'  Þ  s&   ø€ ÷ 1ñ 1©X±u°g¸t°mÕ-Dð 1Èñ 1r   c                ó<   € V P                   P                  V4       R # rf   )rü   rÈ   rT  s   &&r   rÈ   ÚBTree._visit_preorder_by_nodeÞ  s   € Ø�	‰	×)Ñ)¨%Ö0r   c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# r   )rÚ   r   r(   )r   r   s   "€r   r   r'  á  s   ø€ ÷ ñ ™™r¡2˜v�ñ r   c                ó   € \        V 4      # )zCreate a cursor.©rÚ   r   s   &r   r4  ÚBTree.cursorá  s   € ä�d‹|Ðr   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r   r4  r   Nr[  )r   r   s   "€r   r   r'  å  s   ø€ ÷ !ñ !¡fð !°ñ !r   c                ó<   € V P                   P                  V4       R# )z4Register a cursor for the automatic parking service.N)r+  Úaddr3  s   &&r   r  ÚBTree.register_cursorå  s   € à�‰×Ñ˜Ö r   c                ó$   <€ V ^8„  d   QhRS[ RR/# r^  r[  )r   r   s   "€r   r   r'  é  s   ø€ ÷ %ñ %©ð %°4ñ %r   c                ó<   € V P                   P                  V4       R# )z7Deregister a cursor from the automatic parking service.N)r+  Údiscardr3  s   &&r   r  ÚBTree.deregister_cursoré  s   € à�‰×Ñ˜VÖ$r   c                ó&   € V P                  V R 7      # ))r%  )rŒ   r   s   &r   Ú__copy__ÚBTree.__copy__í  s   € Ø�~‰~ tˆ~Ó,Ð,r   c              #  óÌ   "  € V P                  4       ;_uu_ 4       p VP                  4       pVf   MVP                  4       x € K*  RRR4       R#   + '       g   i     R# ; i5ir‚   )r4  r  r   )r   r4  r—   s   &  r   Ú__iter__ÚBTree.__iter__ð  s>   é € Ø�[‰[�]Œ]˜fØØ—k‘k“m�Ø’;ØØ—g‘g“i”÷ �]�]Š]üs   ‚A$›+AÁ
A$ÁA!	Á	A$)r)  r?   r+  rü   r,  r,   r  )r    r!   r"   r#   r$   Ú	DEFAULT_TrH   r/  r5  r:  r?  rC  rG  rL  rO  rÄ   rÈ   r4  r  r  rg  rj  r%   r&   r'   s   @r   r$  r$  e  s§   ø‡ € Ù<ð 9ð ÈD÷ ò ò<#÷ð ÷ò ÷."ð "÷ð ÷"'ð '÷ð ò÷(ð (÷1ð 1÷ð ÷!ð !÷%ð %ò-÷ ð  r   r$  ÚVTc                   óf   a € ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltR	 tR
 t	Rt
V tR# )ÚKViü  z/The BTree element type used in a ``BTreeDict``.c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   r   Úvalue©r   rm  )r   r   s   "€r   r   ÚKV.__annotate__ÿ  s   ø€ ÷ ñ ™Bð ¡rñ r   c                ó   € Wn         W n        R # rf   ©Ú_keyÚ_value)r   r   rq  s   &&&r   rH   ÚKV.__init__ÿ  s   € ØŒ	ØŽr   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   rs    ó   ø€ ÷ ñ ‘Rñ r   c                ó   € V P                   # rf   ©rv  r   s   &r   r   ÚKV.key  rQ  r   c                ó    <€ V ^8„  d   QhRS[ /# r   )rm  )r   r   s   "€r   r   rs    s   ø€ ÷ ñ ‘rñ r   c                ó   € V P                   # rf   )rw  r   s   &r   rq  ÚKV.value  s   € Ø�{‰{Ðr   c                ó<   € R V P                    RV P                   R2# ©zKV(z, Ú)ru  r   s   &r   r:   Ú
KV.__str__	  ó   € Ø�T—Y‘Y�K˜r $§+¡+ ¨aÐ0Ð0r   c                ó<   € R V P                    RV P                   R2# r‚  ru  r   s   &r   Ú__repr__ÚKV.__repr__  r…  r   ru  N)r    r!   r"   r#   r$   rH   r   rq  r:   r‡  r%   r&   r'   s   @r   ro  ro  ü  s5   ø‡ € Ù9÷ð ÷ð ÷ð ò1÷1ð 1r   ro  c                   óˆ   a a€ ] tR tRt oRtR]RRRR/V3R lV 3R	 llltV3R
 lR ltV3R lR ltV3R lR lt	Rt
VtV ;t# )Ú	BTreeDicti  zwA MutableMapping implemented with a BTree.

Unlike a normal Python dict, the BTreeDict may be mutated while iterating.
r,   r%  Nr   Fc                ó:   <€ V ^8„  d   QhRS[ RS[R,          RS[/# ©r   r,   r%  Nr   ©r.   r$  rA   )r   r   s   "€r   r   ÚBTreeDict.__annotate__  ó/   ø€ ÷ !ñ !ñ ð!ñ ˜$•,ð	!ñ
 ñ!r   c               ó4   <€ \         SV `  WR 7       W0n        R# ©)r,   r%  N©ÚsuperrH   r   ©r   r,   r%  r   rŒ   s   &$$$€r   rH   ÚBTreeDict.__init__  ó   ø€ ô 	‰Ñ˜1ÐÔ0Ø Žr   c                ó&   <€ V ^8„  d   QhRS[ RS[/# rW   rr  )r   r   s   "€r   r   rŽ     s   ø€ ÷ )ñ )™rð )¡bñ )r   c                ót   € V P                  V4      pVf   \        h\        \        V4      P	                  4       # rf   )r?  ÚKeyErrorr
   ro  rq  )r   r   r—   s   && r   Ú__getitem__ÚBTreeDict.__getitem__   s1   € Ø×Ñ˜sÓ#ˆØŠ;ÜˆNäœ˜C“=×&Ñ&Ó(Ð(r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r   rq  r   Nrr  )r   r   s   "€r   r   rŽ  '  s"   ø€ ÷ 0ñ 0™rð 0©"ð 0°ñ 0r   c                óR   € \        W4      pV P                  W0P                  4       R # rf   )ro  r:  r   )r   r   rq  r—   s   &&& r   Ú__setitem__ÚBTreeDict.__setitem__'  s   € Ü�‹nˆØ×Ñ˜C§¡Ö/r   c                ó$   <€ V ^8„  d   QhRS[ RR/# rr   r   )r   r   s   "€r   r   rŽ  +  s   ø€ ÷ ñ ™rð  dñ r   c                ó8   € V P                  V4      f   \        hR # rf   )rG  r™  r>  s   &&r   Ú__delitem__ÚBTreeDict.__delitem__+  s   € Ø�?‰?˜3ÓÒ'ÜˆNñ (r   ©r   )r    r!   r"   r#   r$   rl  rH   rš  rž  r¢  r%   r&   Ú__classcell__©rŒ   r   s   @@r   rŠ  rŠ    sU   ù‡ € ñð
!ð ð!ð "&ð	!ð
 ÷!õ !÷)ð )÷0ð 0÷÷ ð r   rŠ  c                   óH   a € ] tR tRt o RtV 3R lR ltV 3R lR ltRtV tR# )	ÚMemberi0  z.The BTree element type used in a ``BTreeSet``.c                ó    <€ V ^8„  d   QhRS[ /# )r   r   r   )r   r   s   "€r   r   ÚMember.__annotate__3  s   ø€ ÷ ñ ™Bñ r   c                ó   € Wn         R # rf   r|  r>  s   &&r   rH   ÚMember.__init__3  s   € ØŽ	r   c                ó    <€ V ^8„  d   QhRS[ /# r   r   )r   r   s   "€r   r   rª  6  rz  r   c                ó   € V P                   # rf   r|  r   s   &r   r   Ú
Member.key6  rQ  r   r|  N)	r    r!   r"   r#   r$   rH   r   r%   r&   r'   s   @r   r¨  r¨  0  s   ø‡ € Ù8÷ð ÷ö r   r¨  c                   óˆ   a a€ ] tR tRt oRtR]RRRR/V3R lV 3R	 llltV3R
 lR ltV3R lR ltV3R lR lt	Rt
VtV ;t# )ÚBTreeSeti:  zqA MutableSet implemented with a BTree.

Unlike a normal Python set, the BTreeSet may be mutated while iterating.
r,   r%  Nr   Fc                ó:   <€ V ^8„  d   QhRS[ RS[R,          RS[/# rŒ  r�  )r   r   s   "€r   r   ÚBTreeSet.__annotate__@  r�  r   c               ó4   <€ \         SV `  WR 7       W0n        R# r‘  r’  r”  s   &$$$€r   rH   ÚBTreeSet.__init__@  r–  r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# rW   )r   rA   )r   r   s   "€r   r   r³  J  s   ø€ ÷ 1ñ 1¡ð 1©ñ 1r   c                ó(   € V P                  V4      R J# rf   )r?  r>  s   &&r   Ú__contains__ÚBTreeSet.__contains__J  s   € Ø×Ñ Ó$¨DÐ0Ð0r   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r   rq  r   Nr   )r   r   s   "€r   r   r³  M  s   ø€ ÷ 0ñ 0™ð 0 ñ 0r   c                óR   € \        V4      pV P                  W P                  4       R # rf   )r¨  r:  r   )r   rq  r—   s   && r   r`  ÚBTreeSet.addM  s   € Ü�U‹mˆØ×Ñ˜C§¡Ö/r   c                ó$   <€ V ^8„  d   QhRS[ RR/# r»  r   )r   r   s   "€r   r   r³  Q  s   ø€ ÷ ñ ™Rð  Dñ r   c                ó(   € V P                  V4       R # rf   )rG  )r   rq  s   &&r   rd  ÚBTreeSet.discardQ  s   € Ø�‰˜Ör   r¤  )r    r!   r"   r#   r$   rl  rH   r¸  r`  rd  r%   r&   r¥  r¦  s   @@r   r±  r±  :  sU   ù‡ € ñð
!ð ð!ð "&ð	!ð
 ÷!õ !÷1ð 1÷0ð 0÷÷ ð r   r±  N)r$   Úcollections.abcr   r   Útypingr   r   r   r   r   r	   r
   rl  r   r   r(   r1   r4   r6   r=   rÚ   Ú	Exceptionr"  r$  rm  ro  rŠ  r¨  r±  r   r   r   Ú<module>rÄ     s)  ðñ÷ 7ß I× IÑ Ià€	áˆTƒ]€ô"ˆg�b�kô "ñ ˆT˜Ô!€õõ÷
	ñ 	ôFDˆG�B˜�F�Oô FDôR
aˆW�R˜�V�_ô aôH"�	ô "ôQ ˆG�B˜�F�Oô Q ñh ˆTƒ]€ô1ˆ�'˜"˜b˜&•/ô 1ô(�˜˜B˜•  r¨2¨b°"¨f­: ~Õ!6¸ÀrÈ2ÀvÕ8Nô ô@ˆW�g˜b•kô ôˆu�g˜b•k :¨b¥>ö r   