+
    ¿Ìjš  ã                   óÒ   € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt]! ]R4      '       d   ]! ]R4      t	M	]! ]R4      t	 ]
 R t ! R R]4      t ! R	 R
]4      tR#   ] d    R t
 L'i ; i)z+Red-Black tree and plain Binary Tree module)ÚdivisionNÚizip_longestÚzip_longestc                ó"   € V P                  4       # )z3A version of next() for python's that don't have it)Únext)Úiterators   &Úl/home/l0st/web/w4ttz.lol/public_html/toolz/MsgDoxxer/venv/lib/python3.14/site-packages/red_black_dict_mod.pyr   r   <   s   € ð �}‰}‹Ðó    c                ó  € V RV^,
          ,          ,           RV^,
           pV\        V4      ,
          R,          pR\        V4      ,          V,           R\        \        P                  ! V4      4      ,          ,           pV# )z*Center a string within a given field widthÚ_Ng       @Ú )ÚlenÚintÚmathÚceil)ÚstringÚfield_use_widthÚfield_avail_widthÚ	field_useÚ	pad_widthÚresults   &&&   r   Úcenterr   E   sf   € à˜# °1Õ!4Õ5Õ5Ð7K¸È!Õ8KÐL€IØ"¤S¨£^Õ3°sÕ:€IØ”3�y“>Õ! IÕ-°´c¼$¿)º)ÀIÓ:NÓ6OÕ0OÕO€FØ€Mr	   c                   ó¼  a € ] tR t^Lt o RtR1tR2R ltR tR tR]	P                  R3R ltR tR	 t]t]R
 4       t]R 4       t]R 4       t]R 4       t]R 4       tR3R ltR tR tR tR tR tR tR tR tR tR t]R 4       t ]R 4       t!R t"R4R lt#R t$R t%R  t&R! t']R" 4       t(]R# 4       t)R$ t*R% t+R& t,R' t-R( t.].t/R) t0R* t1R+ t2R, t3R- t4R. t5R/ t6R0t7V t8R# )5Ú
BinaryTreea>  
A basic binary tree class.  Arbitrary data can be
associated with a tree.  A tree that is root has
parent equal to None; a tree that is leaf has left
and right children that are empty trees (sentinels).
An empty tree has left and right children equal to None.

A tree can have children (or a parent) with equal
data.
Nc                óB   € Wn         W n        W0n        W@n        WPn        R# )a?  
Initialises instance.

@type     key: arbitrary type
@param    key: data
@type   value: arbitrary type
@param  value: data
@type    left: L{BinaryTree} or C{None}
@param   left: left child
@type   right: L{BinaryTree} or C{None}
@param  right: right child
@type  parent: L{BinaryTree} or C{None}
@param parent: parent
N©ÚkeyÚvalueÚleftÚrightÚparent)Úselfr   r   r   r   r    s   &&&&&&r   Ú__init__ÚBinaryTree.__init__[   s   € ð ŒØŒ
ØŒ	ØŒ
ØŽr	   c                óP   € V '       d   V P                   : RV P                  : 2# R# )zÕ
Returns a string representation of I{self}, containing
the key in I{self} and left and right children.  If I{self}
is a sentinel the string "sentinel" is returned.

@rtype:  C{str}
@return: string representation
r   Úsent©r   r   ©r!   s   &r   Ú__repr__ÚBinaryTree.__repr__p   s   € ÷ Ø"Ÿhœh¨¯
«
Ð3Ð3ár	   c                ó„   €  ! R R\         4      pV! 4       pV P                  VP                  4       VP                  4       # )zZCompute the depth of the tree and the maximum width within the nodes - for pretty printingc                   ó:   a € ] tR t^€t o RtRR ltR tR tRtV t	R# )Ú0BinaryTree._depth_and_field_width.<locals>.maxerzXClass facilitates computing the max depth of the treap (tree) and max width of the nodesc                ó    € Wn         RV n        R# )é   Néÿÿÿÿ©Ú	depth_maxÚfield_width_max)r!   Úmaximums   &&r   r"   Ú9BinaryTree._depth_and_field_width.<locals>.maxer.__init__‚   s   € Ø!(”Ø')�Ö$r	   c                óš   € TpTpTpW@P                   8”  d   W@n         \        V4      p\        V4      pW€P                  8”  d	   W€n        R# R# )zGCheck our maximums so far against the current node - updating as neededN)r1   Úreprr   r2   )	r!   Únoder   r   ÚdepthÚ	from_leftÚdummyÚ	repr_nodeÚlen_nodes	   &&&&&&   r   ÚfeedÚ5BinaryTree._depth_and_field_width.<locals>.maxer.feed†   sK   € ð �Ø�Ø!�ØŸ>™>Ô)Ø%*”NÜ  ›J�	Ü˜y›>�Ø×2Ñ2Ô2Ø+3Ö(ñ 3r	   c                ó@   € V P                   ^,           V P                  3# )z"Return the maximums we've computedr0   r'   s   &r   r   Ú7BinaryTree._depth_and_field_width.<locals>.maxer.result”   s   € àŸ™¨Õ*¨D×,@Ñ,@ÐAÐAr	   r0   N)r/   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r"   r=   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   Úmaxerr,   €   s   ø‡ € Ùjô*ò4÷Bð Br	   rJ   )ÚobjectÚdetailed_inorder_traversalr=   r   )r!   rJ   Úmax_objs   &  r   Ú_depth_and_field_widthÚ!BinaryTree._depth_and_field_width~   s8   € ô	B”Fô 	Bñ0 “'ˆØ×'Ñ'¨¯©Ô5Ø�~‰~ÓÐr	   Tc           
     ó®  € Vf   \        4       pV'       d   VP                  R4       \        V 4      : R\        V 4      : 2pWC9   d   R# VP	                  V4       V P
                  eb   VP                  RV: R\        V P
                  4      : R\        V P
                  4      : R24       V P
                  P                  RW#R7       V P                  eb   VP                  RV: R\        V P                  4      : R\        V P                  4      : R	24       V P                  P                  RW#R7       V'       d   VP                  R
4       R# R# )z(Generate a dot file describing this treeNzdigraph G {
r   z   "z" -> "z" [ label="left" ]
F)ÚinitialÚfile_Úvisitedz" [ label="right" ]
z}
)ÚsetÚwriteÚidr6   Úaddr   Úto_dotr   )r!   rQ   rR   rS   Ú	this_nodes   &&&& r   rX   ÚBinaryTree.to_dotœ   sò   € ð Š?Ü“eˆGßØ�K‰K˜Ô(Ü! $žx¬¨d­Ð4ˆ	ØÔÙØ�‰�IÔØ�9‰9Ò Ø�KŠKÃ9ÌbÐQU×QZÑQZÎmÔ]aÐbf×bkÑbkÖ]lÐmÔnØ�I‰I×Ñ U°%ÐÔIØ�:‰:Ò!Ø�KŠKÃIÌrÐRV×R\ÑR\Î~Ô_cÐdh×dnÑdnÖ_oÐpÔqØ�J‰J×Ñ e°5ÐÔJßØ�K‰K˜Öñ r	   c                ó~  €  ! R R\         4      p. pV P                  4       w  r4V^,          p\        V4       F3  pRV^,
          ,          pVP                  V.^V,          ,          4       K5  	  V! V4      pV P	                  VP
                  4       . p^V^,
          ,          V,          p	\        V4       Fo  p^V,          p
Wš,          pRP                  VP                  V,           Uu. uF  p\        WÄV4      NK  	  up4      pVP                  RV,          V,           4       Kq  	  RP                  V4      # u upi )zFormat a tree as a stringc                   ó0   a € ] tR t^²t o RtR tR tRtV tR# )Ú BinaryTree.__str__.<locals>.Descz8Build a pretty-print string during a recursive traversalc                ó   € Wn         R # ©N©Útree)r!   Úpretrees   &&r   r"   Ú)BinaryTree.__str__.<locals>.Desc.__init__¶   s   € Ø#–	r	   c                óL   € TpTp\        V4      V P                  V,          V&   R# )zAdd a node to the treeN)r6   ra   )r!   r7   r   r   r8   r9   r:   s   &&&&&& r   ÚupdateÚ'BinaryTree.__str__.<locals>.Desc.update¹   s%   € ð �Ø�Ü.2°4«j�—	‘	˜%Õ  Ó+r	   r`   N)	rA   rB   rC   rD   rE   r"   re   rF   rG   rH   s   @r   ÚDescr]   ²   s   ø‡ € ñ Kò$÷9ð 9r	   rg   r   Ú z%2d Ú
)	rK   rN   ÚrangeÚappendrL   re   Újoinra   r   )r!   rg   rb   r8   r   Úlevelr   Údescr   ÚwidestÚ	two_levelr   Úxs   &            r   Ú__str__ÚBinaryTree.__str__°   s  € ô	9”6ô 	9ð ˆØ!%×!<Ñ!<Ó!>ÑˆØ˜1ÕˆÜ˜5–\ˆEØ˜O¨aÕ/Õ0ˆFØ�N‰N˜F˜8 a¨5¥jÕ0Ö1ñ "ñ �G‹}ˆØ×'Ñ'¨¯©Ô4ØˆØ�u˜q•yÕ! OÕ3ˆÜ˜5–\ˆEØ˜U�
ˆIØ &Õ 2ÐØ—W‘WÐUY×U^ÑU^Ð_dÖUeÓfÑUeÐPQœf QÐ9JÖKÑUeÑfÓgˆFà�M‰M˜6 E�>¨VÕ3Ö4ñ "ð �y‰y˜Ó Ð ùò gs   Ã*D:
c                óT   € V P                   RJ ;'       d    V P                  RJ '       * # )z‚
A sentinel node evaluates to False.

@rtype:  C{bool}
@return: True if neither left nor right are None,
         otherwise False
N)r   r   r'   s   &r   Ú__nonzero__ÚBinaryTree.__nonzero__Ó   s'   € ð —I‘I Ð%×<Ð<¨$¯*©*¸Ð*<Ô=Ð=r	   c                ó   € V P                   RJ # )zf
Returns True if I{self} is root.

@rtype:  C{bool}
@return: True if I{self} is root, otherwise False
N©r    r'   s   &r   Úis_rootÚBinaryTree.is_rootß   s   € ð �{‰{˜dÐ"Ð"r	   c                ó´   € V P                   '       d   R# W P                  P                  J d   V P                  P                  # V P                  P                  # )zU
Returns the sibling of I{self}.

@rtype:  L{BinaryTree} or C{None}
@return: sibling
N)ry   r    r   r   r'   s   &r   ÚsiblingÚBinaryTree.siblingé   s@   € ð �<�<ˆ<ÙØ—[‘[×%Ñ%Ó%Ø—;‘;×$Ñ$Ð$à—;‘;×#Ñ#Ð#r	   c                ó†   € V '       d9   V P                   P                  V P                  P                  ,           ^,           # ^ # )z„
Return the number of key items / non-sentinel
nodes in the subtree rooted at I{self}.

@rtype:  C{int}
@return: number of elements
)r   Úsizer   r'   s   &r   r   ÚBinaryTree.sizeù   s*   € ÷ Ø—9‘9—>‘> D§J¡J§O¡OÕ3°aÕ7Ð7Ùr	   c                óŒ   € V '       d<   \        V P                  P                  V P                  P                  4      ^,           # ^ # )zk
Returns the number of levels in the subtree
rooted at I{self}.

@rtype:  C{int}
@return: number of levels
)Úmaxr   Ú
num_levelsr   r'   s   &r   rƒ   ÚBinaryTree.num_levels  s0   € ÷ Ü�t—y‘y×+Ñ+¨T¯Z©Z×-BÑ-BÓCÀaÕGÐGÙr	   c                ó(   € V P                   ^,
          # )z„
Returns the height of the subtree rooted at
I{self}.  This is the number of levels - 1.

@rtype:  C{int}
@return: number of levels
)rƒ   r'   s   &r   ÚheightÚBinaryTree.height  s   € ð �‰ Õ"Ð"r	   c                ó  € V '       dk   V P                  V P                  V P                  VR7      pV P                  P	                  V4      Vn        V P
                  P	                  V4      Vn        V# V P                  VR7      pV# )zÁ
Returns a shallow copy of the subtree rooted
at I{self} (does not copy data).

@type  parent: L{BinaryTree} or C{None}
@param parent: parent
@rtype:        L{BinaryTree}
@return:       a copy
)r   r   r    rx   )Ú	__class__r   r   r   Úcopyr   )r!   r    rŠ   s   && r   rŠ   ÚBinaryTree.copy  si   € ÷ Ø—>‘> d§h¡h°d·j±jÈ�>ÓPˆDØŸ	™	Ÿ™ tÓ,ˆDŒIØŸ™Ÿ™¨Ó.ˆDŒJð ˆð —>‘>¨�>Ó0ˆDØˆr	   c                óÔ  € V P                   '       Ed4   V P                  '       d¯   \        P                  ! 4       R8  dK   V P                   P                  pVP                  V n        VP
                  V n        VP                  4        R# V P                  P                  pVP                  V n        VP
                  V n        VP                  4        R# V P                   pVP                  VP                   VP                  uV n        V n         V n        VP
                  V n        W P                   n        W P                  n        R# V P                  '       dt   V P                  pVP                  VP                   VP                  uV n        V n         V n        VP
                  V n        W P                   n        W P                  n        R# R;V n        ;V n         V n        RV n        R# )z©
Deletes a node from the subtree rooted at I{self},
but does not delete the subtree rooted at node.  To
delete a node on the basis of its data use the
I{remove} method.
ç      à?N)	r   r   Úrandomr3   r   r   Údel_nodeÚminimumr    ©r!   r7   s   & r   r�   ÚBinaryTree.del_node0  s=  € ð �9�9‰9Ø�z�zˆzô —=’=“? SÔ(ØŸ9™9×,Ñ,�DØ#Ÿx™x�D”HØ!%§¡�D”JØ—M‘M–OàŸ:™:×-Ñ-�DØ#Ÿx™x�D”HØ!%§¡�D”JØ—M‘M–Oà—y‘y�Ø26·(±(¸D¿I¹IÀtÇzÁzÐ/�”˜$œ) T¤ZØ!ŸZ™Z�”
Ø#'—	‘	Ô Ø$(—
‘
Ö!Ø�Z�ZˆZØ—:‘:ˆDØ.2¯h©h¸¿	¹	À4Ç:Á:Ð+ˆDŒH�d”i ¤ØŸ™ˆDŒJØ#�I‰IÔØ $�J‰JÖð 15Ð4ˆDŒHÐ4�t”y 4¤:ØˆDŽJr	   c                ó¬  € V P                  V4      pV'       g@   Wn        W#n        V P                  VR7      V P                  VR7      uVn        Vn        RV3# VP                  V8X  d   Wn        W#n        RV3# \        P                  ! 4       R8  d"   \        P                  VP                  WR7      # \        P                  VP
                  WR7      # )zû
Adds a node containing I{key} to the subtree
rooted at I{self}, returning the added node.

@type  key: arbitrary type
@param key: key
@type  value: arbitrary type
@param value: data
@rtype:      L{BinaryTree}
@return:     (replaced flag, added node)
rx   FTr�   r&   )	Úfindr   r   r‰   r   r   rŽ   r   rW   )r!   r   r   r7   s   &&& r   rW   ÚBinaryTree.addV  sª   € ð �y‰y˜‹~ˆßØŒHØŒJØ$(§N¡N¸$ NÓ$?ÀÇÁÐW[ÀÓA\Ð!ˆDŒI�t”zØ˜4�=Ð Ø�X‰X˜Œ_ØŒHØŒJØ˜$�<Ðä�}Š}‹ Ô$Ü!—~‘~ d§i¡i°S�~ÓFÐFä!—~‘~ d§j¡j°c�~ÓGÐGr	   c                ón   € V P                  V4      pV'       d   VP                  4        R# \        R4      h)a  
Removes a node containing I{key} from the
subtree rooted at I{self}, raising an error
if the subtree does not contain I{key}.

@type        key: arbitrary type
@param       key: data
@raise ValueError: if key is not contained in the
                   subtree rooted at I{self}
útree.remove(x): x not in treeN)r”   r�   Ú
ValueError©r!   r   r7   s   && r   ÚremoveÚBinaryTree.remover  s)   € ð �y‰y˜‹~ˆßØ�M‰MŽOäÐ<Ó=Ð=r	   c                ó”   € V P                   pV'       d+   VP                  VP                  3pVP                  4        V# \	        R4      h)zÓ
Removes minimum node from subtree rooted at I{self},
raising an exception if the subtree does not have any
nodes.

@raise ValueError: if key is not contained in the
                   subtree rooted at I{self}
r—   )r�   r   r   r�   r˜   ©r!   r7   r   s   &  r   Ú
remove_minÚBinaryTree.remove_minƒ  ó>   € ð �|‰|ˆßð —h‘h §
¡
Ð+ˆFØ�M‰MŒOØˆMäÐ<Ó=Ð=r	   c                ó”   € V P                   pV'       d+   VP                  VP                  3pVP                  4        V# \	        R4      h)zÓ
Removes maximum node from subtree rooted at I{self},
raising an exception if the subtree does not have any
nodes.

@raise ValueError: if key is not contained in the
                   subtree rooted at I{self}
r—   )r3   r   r   r�   r˜   r�   s   &  r   Ú
remove_maxÚBinaryTree.remove_max–  r    r	   c                óN   €  V P                  V4       R#   \         d     R# i ; i)z©
Discards a node containing I{key} from the subtree
rooted at I{self} (without raising an error if the key
is not present).

@type  key: arbitrary type
@param key: data
N)rš   r˜   ©r!   r   s   &&r   ÚdiscardÚBinaryTree.discard©  s%   € ð	Ø�K‰K˜ÖøÜô 	Úð	ús   ‚ •$£$c                óÌ   € V '       d\   V P                  V4      pV'       dC   VP                  P                  V4      VP                  P                  V4      ,           ^,           # ^ # )z¨
Returns the number of occurrences of I{key} in
the subtree rooted at I{self}.

@type  key: arbitrary type
@param key: data
@rtype:      C{int}
@return:     data count
)r”   r   Úcountr   r™   s   && r   r©   ÚBinaryTree.count·  sF   € ÷ Ø—9‘9˜S“>ˆDßØ—y‘y—‘ sÓ+¨d¯j©j×.>Ñ.>¸sÓ.CÕCÀaÕGÐGÙr	   c                ó¼   € \        V 4      \        V4      ,           p\        P                  ! V4       V P                  4       pV F  pVP	                  V4       K  	  V# )aP  
Returns a tree with elements from the subtree
rooted at I{self} and I{iterable}.  I{iterable}
may be any iterable, not necessarily another
tree.

@type  iterable: any iterable type
@param iterable: an iterable object
@rtype:          L{BinaryTree}
@return:         tree containing the elements in I{self}
                 and iterable
)ÚlistrŽ   Úshuffler‰   rW   )r!   ÚiterableÚitemsra   Úitems   &&   r   Ú__add__ÚBinaryTree.__add__Ç  sH   € ô �T“
œT (›^Õ+ˆÜ�Š�uÔØ�~‰~ÓˆÛˆDØ�H‰H�TŽNñ àˆr	   c                ó|   € \        V4      p\        P                  ! V4       V F  pV P                  V4       K  	  R# )zŒ
Adds the elements in I{iterable} to the
subtree rooted at I{self}.

@type  iterable: any iterable type
@param iterable: an iterable object
N)r¬   rŽ   r­   rW   )r!   r®   r¯   r°   s   &&  r   Ú__iadd__ÚBinaryTree.__iadd__Û  s.   € ô �X“ˆÜ�Š�uÔÛˆDØ�H‰H�TŽNó r	   c                óÈ   € V '       dZ   V P                   V8X  d   V # WP                   8  d   V P                  P                  V4      # V P                  P                  V4      # V # )a?  
Finds and returns a node containing I{key} in the
subtree rooted at I{self}.  If I{key} is not in
the tree, then a sentinel in the location where
I{key} can be inserted is returned.

@type  key: arbitrary type
@param key: data
@rtype:      L{BinaryTree}
@return:     node containing key, or sentinel
             node
)r   r   r”   r   r¥   s   &&r   r”   ÚBinaryTree.findè  sK   € ÷ Ø�x‰x˜3ŒØ�Ø—x‘x”Ø—y‘y—~‘~ cÓ*Ð*à—z‘z—‘ sÓ+Ð+Øˆr	   c                ó,  € V P                   '       d   V P                   P                  # V P                  '       g   R# W P                  P                  J d   V P                  # Y P                  r!V'       d   VP                   VJ d   Y"P                  r!K&  V# )z‰
Returns the predecessor of I{self}, or None if
self has no predecessor.

@rtype:  L{BinaryTree} or None
@return: predecessor of I{self}
N)r   r3   r    r   ©r!   Úcurrentr    s   &  r   ÚpredecessorÚBinaryTree.predecessorþ  sh   € ð �9�9ˆ9Ø—9‘9×$Ñ$Ð$à—;—;�;ÙØ—{‘{×(Ñ(Ó(Ø—{‘{Ð"à"&¯©˜ß §¡°Ó!7Ø&,¯m©mšVØ�r	   c                ó,  € V P                   '       d   V P                   P                  # V P                  '       g   R# W P                  P                  J d   V P                  # Y P                  r!V'       d   VP                   VJ d   Y"P                  r!K&  V# )zƒ
Returns the successor of I{self}, or None if
self has no successor.

@rtype:  L{BinaryTree} or None
@return: successor of I{self}
N)r   r�   r    r   r¹   s   &  r   Ú	successorÚBinaryTree.successor  sh   € ð �:�:ˆ:Ø—:‘:×%Ñ%Ð%à—;—;�;ÙØ—{‘{×'Ñ'Ó'Ø—{‘{Ð"à"&¯©˜ß §¡°Ó!8Ø&,¯m©mšVØ�r	   c              #  ó
  "  € V '       dw   V P                   '       d&   V P                   P                  4        F  pVx € K	  	  V x € V P                  '       d(   V P                  P                  4        F  pVx € K	  	  R# R# R# 5i)z—
Returns a generator of nodes in the subtree
rooted at I{self} in sorted order of node keys.

@rtype:  C{generator}
@return: generator of sorted nodes
N)r   Úin_orderr   r‘   s   & r   rÁ   ÚBinaryTree.in_order*  sc   é € ÷ Ø�y�yˆyØ ŸI™I×.Ñ.Ö0�DØ”Jñ 1àŠJØ�z�zˆzØ ŸJ™J×/Ñ/Ö1�DØ”Jó 2ñ ñ ùs   ‚B�:BÁ+Bc                óD  € V P                   '       d+   V P                   P                  W^,           V^,          4       V! W P                  V P                  W#4       V P                  '       d4   V P                  P                  W^,           V^,          ^,           4       R# R# )z1Do an inorder traversal - with lots of parametersN)r   rL   r   r   r   )r!   Úvisitr8   r9   s   &&&&r   rL   Ú%BinaryTree.detailed_inorder_traversal;  sl   € à�9�9ˆ9Ø�I‰I×0Ñ0°À½	À9ÈqÅ=ÔQÙˆd—H‘H˜dŸj™j¨%Ô;Ø�:�:ˆ:Ø�J‰J×1Ñ1°%À½ÀIÐPQÅMÐTUÕDUÖVñ r	   c                ó0   € R V P                  4        4       # )z˜
Returns a generator of the node keys in
the subtree rooted at I{self} in sorted
order.

@rtype:  C{generator}
@return: generator of sorted node values
c              3   ó8   "  € T F  qP                   x € K  	  R # 5ir_   )r   )Ú.0Úns   & r   Ú	<genexpr>Ú&BinaryTree.__iter__.<locals>.<genexpr>L  s   é € Ð/™˜!—–›ùó   ‚©rÁ   r'   s   &r   Ú__iter__ÚBinaryTree.__iter__C  s   € ñ 0˜tŸ}™}œÓ/Ð/r	   c              #  ó¾   "  € V '       dQ   V P                   P                  4        F  pVx € K	  	  V x € V P                  P                  4        F  pVx € K	  	  R# R# 5i)z§
Returns a generator of nodes in the subtree
rooted at I{self} in reverse sorted order
of node keys.

@rtype:  C{generator}
@return: generator of reverse sorted nodes
N)r   Ú
in_reverser   r‘   s   & r   rÑ   ÚBinaryTree.in_reverseN  sL   é € ÷ ØŸ
™
×-Ñ-Ö/�Ø”
ñ 0àŠJØŸ	™	×,Ñ,Ö.�Ø”
ó /ñ	 ùs   ‚AAc              #  ó
  "  € V '       dw   V x € V P                   '       d&   V P                   P                  4        F  pVx € K	  	  V P                  '       d(   V P                  P                  4        F  pVx € K	  	  R# R# R# 5i)z�
Returns a generator of the nodes in the
subtree rooted at I{self} in preorder.

@rtype:  C{generator}
@return: generator of nodes in preorder
N)r   Ú	pre_orderr   r‘   s   & r   rÔ   ÚBinaryTree.pre_order^  sc   é € ÷ ØŠJØ�y�yˆyØ ŸI™I×/Ñ/Ö1�DØ”Jñ 2à�z�zˆzØ ŸJ™J×0Ñ0Ö2�DØ”Jó 3ñ ñ ùs   ‚B¡6BÁ+Bc              #  ó  "  € V '       du   V P                   '       d&   V P                   P                  4        F  pVx € K	  	  V P                  '       d&   V P                  P                  4        F  pVx € K	  	  V x € R# R# 5i)z‘
Returns a generator of the nodes in the
subtree rooted at I{self} in postorder.

@rtype:  C{generator}
@return: generator of nodes in postorder
N)r   Ú
post_orderr   r‘   s   & r   r×   ÚBinaryTree.post_ordero  s^   é € ÷ Ø�y�yˆyØ ŸI™I×0Ñ0Ö2�DØ”Jñ 3à�z�zˆzØ ŸJ™J×1Ñ1Ö3�DØ”Jñ 4àŒJñ ùs   ‚B�6BÁ-Bc                óJ   € T pVP                   '       d   VP                   pK   V# )zÍ
Returns a node for which the node key is minimum
in the subtree rooted at I{self}.  Always returns
the minimum-valued node with no left child.

@rtype:  L{BinaryTree}
@return: node with minimum key value
)r   r‘   s   & r   r�   ÚBinaryTree.minimum€  s    € ð ˆØ�i�iˆiØ—9‘9ŠDØˆr	   c                óJ   € T pVP                   '       d   VP                   pK   V# )zÎ
Returns a node for which the node key is maximum
in the subtree rooted at I{self}.  Always returns
the maximum-valued node with no right child.

@rtype:  L{BinaryTree}
@return: node with maximum key value
)r   r‘   s   & r   r3   ÚBinaryTree.maximum�  s    € ð ˆØ�j�jˆjØ—:‘:ŠDØˆr	   c                ó2   € V P                   pVP                  # )z%
Return the miniumum key in the tree
)r�   r   r‘   s   & r   Úfind_minÚBinaryTree.find_minž  ó   € ð �|‰|ˆØ�x‰xˆr	   c                ó2   € V P                   pVP                  # )z%
Return the maxiumum key in the tree
)r3   r   r‘   s   & r   Úfind_maxÚBinaryTree.find_max¥  rà   r	   c                óî   € V '       g   V'       g   R# V '       d[   V'       dS   V P                   P                  VP                   4      ;'       d&    V P                  P                  VP                  4      # R# )z´
Two binary trees are similar if they have the
same structure.

@rtype:  C{bool}
@return: True if the subtrees rooted at I{self}
         and I{other} are similar, otherwise False
TF)r   Ú
is_similarr   ©r!   Úothers   &&r   rå   ÚBinaryTree.is_similar¬  sH   € ÷ ŸEÙß—EØ—9‘9×'Ñ'¨¯
©
Ó3×ZÐZ¸¿
¹
×8MÑ8MÈeÏkÉkÓ8ZÐZÙr	   c                ór  € V '       g   V'       g   R# V '       d�   V'       d•   V P                   VP                   8H  ;'       dt    V P                  VP                  8H  ;'       dS    V P                  P                  VP                  4      ;'       d&    V P                  P                  VP                  4      # R# )zÜ
Two binary trees are equivalent if they are similar
and corresponding nodes contain the same keys.

@rtype:  C{bool}
@return: True if the subtrees rooted at I{self}
         and I{other} are equivalent, otherwise False
TF)r   r   r   Úis_equivalentr   ræ   s   &&r   rê   ÚBinaryTree.is_equivalent»  s‡   € ÷ ŸEÙß—Eà—‘˜EŸI™IÑ%÷ 6ð 6Ø—
‘
˜eŸk™kÑ)÷6ð 6à—	‘	×'Ñ'¨¯
©
Ó3÷6ð 6ð —
‘
×(Ñ(¨¯©Ó5ð	ñ r	   c                ó   € \        V P                  4       VP                  4       4       FQ  w  r#Vf   Ru # Vf    ^# VP                  VP                  8  d   Ru # VP                  VP                  8”  g   KP   ^# 	  ^ # )a‚  
Returns C{0} if the subtrees rooted at
I{self} and I{other} contain equal keys.
I{other} need not be similar to I{self}.

@type  other: L{BinaryTree}
@param other: tree being compared to I{self}
@rtype:       C{int}
@return:      0 if the subtrees rooted at I{self}
              and I{other} do contain equal values,
              -1 if self < other.
              1 if self > other.
r/   )ÚMY_ZIP_LONGESTrÁ   r   )r!   rç   Ú	self_nodeÚ
other_nodes   &&  r   Ú__cmp__ÚBinaryTree.__cmp__í  sg   € ô &4°D·M±M³OÀUÇ^Á^ÓEUÖ%VÑ!ˆIØÒ Ø’	ØÒ#ÚØ—‘ §¡Ô/Ø’	Ø—‘ §¡Ö/Úñ &Wñ r	   c                ó*   € V P                  V4      ^ 8H  # )aa  
Returns C{True} if the subtrees rooted at
I{self} and I{other} contain equal keys.
I{other} need not be similar to I{self}.

@type  other: L{BinaryTree}
@param other: tree being compared to I{self}
@rtype:       C{bool}
@return:      True if the subtrees rooted at I{self}
              and I{other} contain equal values, otherwise
              False
©Úcmpræ   s   &&r   Ú__eq__ÚBinaryTree.__eq__	  ó   € ð �x‰x˜‹ !Ñ#Ð#r	   c                ó*   € V P                  V4      ^ 8g  # ©ao  
Returns C{True} if the subtrees rooted at
I{self} and I{other} do not contain equal keys.
I{other} need not be similar to I{self}.

@type  other: L{BinaryTree}
@param other: tree being compared to I{self}
@rtype:       C{bool}
@return:      True if the subtrees rooted at I{self}
              and I{other} do not contain equal values,
              otherwise False
ró   ræ   s   &&r   Ú__neq__ÚBinaryTree.__neq__  r÷   r	   c                ó*   € V P                  V4      ^ 8  # rù   ró   ræ   s   &&r   Ú__lt__ÚBinaryTree.__lt__'  s   € ð �x‰x˜‹ Ñ"Ð"r	   c                ó*   € VP                  V 4      ^ 8  # ©é    ró   ræ   s   &&r   Ú__gt__ÚBinaryTree.__gt__6  s   € Ø�y‰y˜‹ Ñ"Ð"r	   c                ó*   € V P                  V4      ^ 8*  # r   ró   ræ   s   &&r   Ú__le__ÚBinaryTree.__le__9  ó   € Ø�x‰x˜‹ !Ñ#Ð#r	   c                ó*   € V P                  V4      ^ 8¬  # r   ró   ræ   s   &&r   Ú__ge__ÚBinaryTree.__ge__<  r  r	   c                ó6   € \        V P                  V4      4      # )zé
Returns true if I{key} is stored in any node in
the subtree rooted at I{self}.

@type  key: arbitrary type
@param key: data
@rtype:      C{bool}
@return:     True if I{key} in subtree rooted at
             I{self}, otherwise False
)Úboolr”   r¥   s   &&r   Ú__contains__ÚBinaryTree.__contains__?  s   € ô �D—I‘I˜c“NÓ#Ð#r	   )r   r   r    r   r   r   ©NNNNNr_   )r  r  )9rA   rB   rC   rD   rE   Ú	__slots__r"   r(   rN   ÚsysÚstdoutrX   rr   ru   Ú__bool__Úpropertyry   r|   r   rƒ   r†   rŠ   r�   rW   rš   rž   r¢   r¦   r©   r±   r´   r”   r»   r¾   rÁ   rL   rÎ   rÑ   rÔ   r×   r�   r3   rÞ   râ   rå   rê   rð   rô   rõ   rú   rý   r  r  r	  r  rF   rG   rH   s   @r   r   r   L   s—  ø‡ € ñ	ð <€Iôò*ò ð< "¨¯©¸Tô ò(!!òF>ð €Hàñ#ó ð#ð ñ$ó ð$ð ñ
ó ð
ð ñ
ó ð
ð ñ#ó ð#ôò$$òLHò8>ò">ò&>ò&òò ò(òð, ñó ðð* ñó ðò*ô"Wò	0òò ò"ð" ñó ðð ñó ðòòòòòdð4 €Cò$ò$ò#ò#ò$ò$÷$ð $r	   r   c                   ó  a a€ ] tR tRt oRt]P                  R,           tRV 3R llt]R 4       t	]	P                  R 4       t	]R 4       tR tRV 3R lltV 3R	 ltR
 tR tR tR tR tR tR tR tR t]tR t]tR tR tRtVtV ;t# )ÚRedBlackTreeiM  a¯  
A binary tree with an extra attribute, is_red.  Colour (red
or black) is used to maintain a reasonably balanced tree.
Changes to the tree structure (rotations) are carried out
in such a way that the name bound to the initial empty
tree will always refer to the root node.  The data stored
in a given node may change, as well as its connectivity.
e.g.

>>> import trees
>>> tree = trees.RedBlackTree()
>>> tree.add(2)
2 False None None
>>> tree.key        # tree is bound to root node
2
>>> tree.add(-1)
-1 True None None
>>> tree.add(1)     # tree rotations are performed at this point
1 False -1 2
>>> tree.key        # the root node has changed (i.e. its key has been changed)
1
>>>

c                ó@   <€ \         \        V `  WW4V4       RV n        R# )a  
Initialises instance.

@type     key: arbitrary type
@param    key: data
@type    left: L{RedBlackTree} or C{None}
@param   left: left child
@type   right: L{RedBlackTree} or C{None}
@param  right: right child
@type  parent: L{RedBlackTree} or C{None}
@param parent: parent
FN)Úsuperr  r"   Úis_red)r!   r   r   r   r   r    r‰   s   &&&&&&€r   r"   ÚRedBlackTree.__init__j  s   ø€ ô 	Œl˜DÑ*¨3°tÀFÔKØˆŽr	   c                ó$   € V P                   '       * # )zp
Returns True if node colour is black.

@rtype:  C{bool}
@return: True if node colour is black, otherwise False
©r  r'   s   &r   Úis_blackÚRedBlackTree.is_blackz  s   € ð —;‘;ŒÐr	   c                ó   € V'       * V n         R# )z
Sets node colour.
Nr  )r!   Úvals   &&r   r  r  „  s   € ð
 ”gˆŽr	   c                óŠ  € V P                   '       dP   V P                   P                  '       d   V P                   P                  ^,           # V P                   P                  # V P                  '       dP   V P                  P                  '       d   V P                  P                  ^,           # V P                  P                  # ^ # )zD
@rtype:  C{int}
@return: black height of subtree rooted at I{self}
)r   r  Úblack_heightr   r'   s   &r   r"  ÚRedBlackTree.black_height‹  sƒ   € ð �9�9ˆ9Ø�y‰y×!×!Ð!Ø—y‘y×-Ñ-°Õ1Ð1à—y‘y×-Ñ-Ð-Ø�Z�ZˆZØ�z‰z×"×"Ð"Ø—z‘z×.Ñ.°Õ2Ð2à—z‘z×.Ñ.Ð.ár	   c                ó†   € V '       d9   V P                   '       d   RpMRpV P                  : RV P                  : RV: 2# R# )zí
Returns a string representation of I{self}, containing
the key in I{self}, the colour, and the key in left and
right children.  If I{self} is a sentinel the string
"sentinel" is returned.

@rtype:  C{str}
@return: string representation
ÚredÚblkr   r%   )r  r   r   )r!   Úcolor_strings   & r   r(   ÚRedBlackTree.__repr__ž  s2   € ÷ Ø�{�{ˆ{Ø$‘à$�Ø!%§¤¨4¯:¬:²|ÐDÐDár	   c                óP   <€ \         \        V `  V4      pV P                  Vn        V# )zÄ
Returns a shallow copy of the subtree rooted
at I{self} (does not copy key).

@type  parent: L{RedBlackTree} or C{None}
@param parent: parent
@rtype:        L{RedBlackTree}
@return:       a copy
)r  r  rŠ   r  )r!   r    rŠ   r‰   s   && €r   rŠ   ÚRedBlackTree.copy±  s&   ø€ ô ”\ 4Ñ-¨fÓ5ˆØ—k‘kˆŒØˆr	   c                ór   <€ \         \        V `  WR7      w  r4V'       g   RVn        VP	                  4       pV# )a+  
Adds a node containing I{key} to the subtree
rooted at I{self}, returning the node which
contains I{key}.  Note: the returned node might
be an existing node due to key swaps on rotations.

@type  key: arbitrary type
@param key: data
@rtype:      L{RedBlackTree}
@return:     node containing I{key}
r&   T)r  r  rW   r  Ú
fix_insert)r!   r   r   Úreplacedr7   r‰   s   &&&  €r   rW   ÚRedBlackTree.add¿  s7   ø€ ô !¤¨tÑ8¸SÐ8ÓNÑˆßØˆDŒKØ—?‘?Ó$ˆDØˆr	   c                ól  € V P                   f
   RV n        V # V P                   P                  '       d   V # V P                   P                  pVP                  '       dH   RV P                   n        RVn        V P                   P                   pRVn        VP	                  4        V # V P                   P                   pV P                   P
                  V J VP
                  V P                   J 8X  g-   V P                  4        V P                   P                  4        V# V P                   P                  4        V # )ag  
Carries out tree rotations, key swaps and recolourings
to ensure that the red / black properties of the tree
are preserved on node insertion. The returned node contains
the same value as I{self} (but might not be the inserted node
due to key swaps / rotations).

@rtype:  L{RedBlackTree}
@return: node containing key originally
         contained in I{self}
T)r    r  r|   r  r,  r   Úrotate)r!   ÚsibÚpars   &  r   r,  ÚRedBlackTree.fix_insertÑ  så   € ð �;‰;ÒØ ˆDŒMØˆKà�;‰;××ÐØˆKà�k‰k×!Ñ!ˆØ�:�:ˆ:Ø#'ˆD�K‰KÔ ØˆCŒLØ—+‘+×$Ñ$ˆCØˆCŒJØ�N‰NÔØˆKà�k‰k× Ñ ˆØ—‘× Ñ  DÐ(¨c¯h©h¸$¿+¹+Ð.EÔFØ�K‰KŒMØ�K‰K×ÑÔ ØˆJà�K‰K×ÑÔ ØˆKr	   c                ón  € W P                   P                  J Ed   V P                   P                  V P                  uV n        V P                   n        V P                   P                  V P                  uV n        V P                   n        V P                  V P                   n        V P                   V P                   P                  n         V P                  V n        V P                   P                  V n        V ;V P                  n         V P                  n         W P                   n        R# V P                   P                  V P                  uV n        V P                   n        V P                   P                  V P                  uV n        V P                   n        V P                  V P                   n        V P                   V P                   P                  n         V P                  V n        V P                   P                  V n        V ;V P                  n         V P                  n         W P                   n        R# )zí
Rotates I{self} with I{self.parent}.  Left / right rotations
are performed as dictated by the parent-child relationship.
The colours of I{self} and I{self.parent} are implicity swapped
(as their values are swapped during the rotation).
N)r    r   r   r   r   r'   s   &r   r0  ÚRedBlackTree.rotate÷  sb  € ð —;‘;×#Ñ#Ô#Ø(,¯©¯©¸¿¹Ð%ˆDŒH�d—k‘k”oØ,0¯K©K×,=Ñ,=¸t¿z¹zÐ)ˆDŒJ˜Ÿ™Ô)Ø#Ÿy™yˆD�K‰KÔØ&*§k¡kˆD�K‰K×ÑÔ#ØŸ
™
ˆDŒIØŸ™×*Ñ*ˆDŒJØ37Ð7ˆD�I‰IÔ˜tŸz™zÔ0Ø $�K‰KÖà(,¯©¯©¸¿¹Ð%ˆDŒH�d—k‘k”oØ,0¯K©K×,=Ñ,=¸t¿z¹zÐ)ˆDŒJ˜Ÿ™Ô)Ø $§
¡
ˆD�K‰KÔØ'+§{¡{ˆD�K‰K×ÑÔ$ØŸ™ˆDŒJØŸ™×(Ñ(ˆDŒIØ37Ð7ˆD�I‰IÔ˜tŸz™zÔ0Ø#�K‰KÖr	   c                ó6  € V P                   '       Ed,   V P                  '       d    \        P                  ! 4       R8  d   V P                   P                  pMV P                  P                  pVP
                  V P
                  uV n        Vn        VP                  V P                  uV n        Vn        VP                  4        R# V P                   pVP
                  VP                   VP                  uV n        V n         V n        VP                  V n        W P                   n        W P                  n        RV n	        R# V P                  '       d{   V P                  pVP
                  VP                   VP                  uV n        V n         V n        VP                  V n        W P                   n        W P                  n        RV n	        R# R;V n        ;V n         V n        RV n        V P                  '       d
   RV n	        R# RV n	        V P                  4        R# )z¨
Deletes a node from the subtree rooted at I{self},
but does not delete the subtree rooted at node.  To
delete a node on the basis of its key use the
I{remove} method.
r�   TN)r   r   rŽ   r3   r�   r   r   r�   r    r  r  Úfix_delr‘   s   & r   r�   ÚRedBlackTree.del_node  sf  € ð �9�9‰9Ø�z�zˆzô —=’=“? SÔ(ØŸ9™9×,Ñ,‘DàŸ:™:×-Ñ-�DØ%)§X¡X¨t¯x©xÐ"�”˜$œ(Ø)-¯©°T·Z±ZÐ&�”
˜DœJØ—‘–à—y‘y�Ø26·(±(¸D¿I¹IÀtÇzÁzÐ/�”˜$œ) T¤ZØ!ŸZ™Z�”
Ø#'—	‘	Ô Ø$(—
‘
Ô!Ø $�–Ø�Z�ZˆZØ—:‘:ˆDØ.2¯h©h¸¿	¹	À4Ç:Á:Ð+ˆDŒH�d”i ¤ØŸ™ˆDŒJØ#�I‰IÔØ $�J‰JÔØ ˆDŽMð 15Ð4ˆDŒHÐ4�t”y 4¤:ØˆDŒJØ�{�{ˆ{Ø $�–à $�”à—‘–r	   c                óì  € V P                   f   R# V P                  pVP                  '       d   VP                  4        V P                  pV P                   P                  '       dn   VP                  '       d\   VP
                  P                  '       d@   VP                  P                  '       d$   RVn        V P                   P                  4        R# V P                   P                  '       de   VP                  '       dS   VP
                  P                  '       d7   VP                  P                  '       d   RVn        RV P                   n        R# VP                  '       dä   W P                   P
                  J dT   VP                  P                  '       d8   VP
                  P                  '       d   VP
                  P                  4        MkW P                   P                  J dS   VP
                  P                  '       d7   VP                  P                  '       d   VP                  P                  4        V P                  pVP                  4        RV P                   P                  n        R# )z2
Maintains red / black property on node
deletion.
NT)r    r|   r  r0  r  r   r   r7  )r!   r1  s   & r   r7  ÚRedBlackTree.fix_del?  s  € ð �;‰;ÒÙØ�l‰lˆà�:�:ˆ:Ø�J‰JŒLØ—,‘,ˆCð —‘×$×$Ð$Ø——�Ø—‘×!×!Ð!Ø—	‘	×"×"Ð"àˆCŒJØ�K‰K×ÑÔ!Ùð —‘×"×"Ð"Ø——�Ø—‘×!×!Ð!Ø—	‘	×"×"Ð"àˆCŒJØ#'ˆD�K‰KÔ Ùà�<�<ˆ<Ø—{‘{×'Ñ'Ó'¨C¯I©I×,>×,>Ð,>À3Ç8Á8Ç?Ç?À?Ø—‘—‘Õ!ØŸ™×*Ñ*Ó*¨s¯x©x×/@×/@Ð/@ÀSÇYÁY×EU×EUÐEUØ—	‘	× Ñ Ô"Ø—,‘,ˆCà�
‰
ŒØ'+ˆ�‰×ÑÖ$r	   c                óˆ  € . pV P                  4        F‡  pVP                  '       g$   VP                  '       g   VP                  V4       VP                  '       g   KL  VP                  P
                  '       d   VP                  P
                  '       d   K†   R# 	  ^ pV'       d›   V^ ,          pVP                  '       d*   VP
                  '       d
   V^,          pVP                  pK;  VR,           FI  p^ pVP                  '       d*   VP
                  '       d
   V^,          pVP                  pK;  WC8X  d   KH   R# 	  R# )z¾
Checks whether the subtree rooted at I{self} is a valid
red black tree U{http://en.wikipedia.org/wiki/Red_black_tree}.

@rtype:  C{bool}
@return: True if the tree is valid, otherwise False
F:r.   NNT)rÁ   r   r   rk   r  r  r    )r!   Ú
leaf_nodesr7   r"  r†   s   &    r   ÚcheckÚRedBlackTree.checkk  sâ   € ð ˆ
Ø—M‘M–OˆDØ—9—9�9 T§Z§Z ZØ×!Ñ! $Ô'Ø�{�{Š{ØŸ	™	×*×*Ð*¨t¯z©z×/B×/BÒ/BÚ ñ $ð ˆßØ˜a•=ˆDØ—+—+�+Ø—=—=�=Ø  AÕ%�LØ—{‘{’Ø" 2Ÿ˜�Ø�Ø—k—k�kØ—}—}�}Ø !�˜ØŸ;™;’DØÖ-Ú ñ 'ñ r	   c                óX   € V P                  V4      pV'       d   VP                  # \        h)zGet an item by its key)r”   r   ÚKeyErrorr™   s   && r   Ú__getitem__ÚRedBlackTree.__getitem__‹  s#   € ð �y‰y˜‹~ˆßØ—:‘:ÐäˆNr	   c                ó(   € V P                  W4       R# )z-Add an item using a dictionary-like interfaceN)rW   )r!   r   r   s   &&&r   Ú__setitem__ÚRedBlackTree.__setitem__”  s   € ð 	�‰�Ör	   c                ód   € V P                  V4      pV'       d   VP                  4        R# \        h)z0Delete an item using a dictionary-like interfaceN)r”   r�   r@  r™   s   && r   Ú__delitem__ÚRedBlackTree.__delitem__™  s"   € ð �y‰y˜‹~ˆßØ�M‰MŽOäˆNr	   c                ó0   € R V P                  4        4       # )z*Iterate over the items in the "dictionary"c              3   óP   "  € T F  qP                   VP                  3x € K  	  R # 5ir_   r&   ©rÈ   r7   s   & r   rÊ   Ú)RedBlackTree.iteritems.<locals>.<genexpr>¥  s   é € ÐC±?¨4—‘˜4Ÿ:™:Õ&³?ùs   ‚$&rÍ   r'   s   &r   Ú	iteritemsÚRedBlackTree.iteritems¢  s   € ñ D°4·=±=´?ÓCÐCr	   c                ó0   € R V P                  4        4       # )z+Iterate over the values in the "dictionary"c              3   ó8   "  € T F  qP                   x € K  	  R # 5ir_   )r   rK  s   & r   rÊ   Ú*RedBlackTree.itervalues.<locals>.<genexpr>¬  s   é € Ð7¡˜t—
–
£ùrÌ   rÍ   r'   s   &r   Ú
itervaluesÚRedBlackTree.itervalues©  s   € ñ 8 t§}¡}¤Ó7Ð7r	   c                ó   € V P                   # )z.Return the number of elements in the container)r   r'   s   &r   Ú__len__ÚRedBlackTree.__len__°  s   € ð �y‰yÐr	   c                ó2   € ^ pV  F  pTpV^,          pK  	  V# )z?Compute the length of the tree using a slow-but-accurate method© )r!   r©   Úelementr:   s   &   r   Ú	_slow_lenÚRedBlackTree._slow_lenµ  s(   € ð ˆãˆGØˆEØ�Q�JŠEñ ð ˆr	   )r  r  r   r   r   r   r  r  r_   ) rA   rB   rC   rD   rE   r   r  r"   r  r  Úsetterr"  r(   rŠ   rW   r,  r0  r�   r7  r=  rA  rD  rG  rM  r¯   rR  ÚvaluesrU  rZ  rF   rG   Ú__classcell__)r‰   rI   s   @@r   r  r  M  sÄ   ù‡ € ñð2 ×$Ñ$ |Õ3€I÷ð  ñó ðð ‡_�_ñó ðð ñó ðò$÷&õò$$òL$ò8*òX*,òXò@òò
òDð
 €Eò8ð
 €Fò÷
	ò 	r	   r  )rE   Ú
__future__r   r  r   rŽ   Ú	itertoolsÚhasattrÚgetattrrí   r   Ú	NameErrorr   rK   r   r  rX  r	   r   Ú<module>rd     s�   ðñ  2õ:  ã 
Û Û Û á
ˆ9�n×%Ò%Ù˜Y¨Ó7�Ná˜Y¨Ó6€NðÙòô~$�ô ~$ôBq�:ö qøðe ô ôðús   ¼A Á
A&Á%A&