+
    �°³jd  ã                   óJ   € R t ^ RIHtHt ^ RIt^ RItR tR t ! R R4      t	R# )z1Unit tests for the chain decomposition functions.)ÚcycleÚisliceNc              #  óŽ   "  € \        V 4      p\        V 4      pV  F$  p\        \        W!4      4      x € \	        V4       K&  	  R# 5i)z—Yields cyclic permutations of the given sequence.

For example::

    >>> list(cycles("abc"))
    [('a', 'b', 'c'), ('b', 'c', 'a'), ('c', 'a', 'b')]

N)Úlenr   Útupler   Únext)ÚseqÚnÚ
cycled_seqÚxs   &   Úf/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/algorithms/tests/test_chains.pyÚcyclesr   
   s;   é € ô 	ˆC‹€AÜ�s“€JÛˆÜ”F˜:Ó)Ó*Ò*ÜˆZÖó ùs   ‚AAc                ó²   a€ \        S4      o\        ;QJ d(    V3R l\        V 4       4       F  '       g   K   R# 	  R# ! V3R l\        V 4       4       4      # )z®Decide whether two sequences are equal up to cyclic permutations.

For example::

    >>> cyclic_equals("xyz", "zxy")
    True
    >>> cyclic_equals("xyz", "zyx")
    False

c              3   ó>   <"  € T F  q\        S4      8H  x € K  	  R # 5i)N)r   )Ú.0r   Úseq2s   & €r   Ú	<genexpr>Ú cyclic_equals.<locals>.<genexpr>'   s   øé € Ð6© A”E˜$“KÖ«ùs   ƒTF)r   Úanyr   )Úseq1r   s   &fr   Úcyclic_equalsr      s?   ø€ ô �‹;€Dß‹3Ô6¬°¬Ó6�3Œ3Ð6Š3Ð6ˆ3Ô6¬°¬Ó6Ó6Ð6ó    c                   óH   a € ] tR t^*t o RtR tR tR tR tR t	R t
RtV tR	# )
ÚTestChainDecompositionz0Unit tests for the chain decomposition function.c                ó   € \        \        V Uu. uF  p\        \        V4      4      NK  	  up4      4      pV F+  p\        W4      '       d    R# \        WE4      '       g   K*   R# 	  V P	                  R 4       R# u upi )zchain not foundN)ÚlistÚreversedr   r   Úfail)ÚselfÚchainÚexpectedÚeÚreversed_chainÚ	candidates   &&&   r   ÚassertContainsChainÚ*TestChainDecomposition.assertContainsChain-   sf   € ô œhÁEÓ'JÁE¸q¬¬h°q«kÖ(:ÁEÑ'JÓKÓLˆÛ!ˆIÜ˜U×.Ò.ÚÜ˜^×7Ô7Úñ	 "ð �I‰IÐ'Ö(ùò (Ks   �A;c                óÔ   € . ROp\         P                  ! V4      p. RORR.RR.. R	O. R
O.p\        \         P                  ! V^R7      4      p\	        V4      \	        V4      8X  g   Q hR# )é   ©ÚrootN©r'   é   ©é   é   )©r'   r-   )r-   é   ©r0   r+   )r0   r.   )r.   é   )r2   é   )r3   é   )r.   é	   )r5   é
   ©r'   r0   r*   r,   ©r.   r6   ©r2   r4   )r7   )r0   r-   )r-   r'   )r+   r0   ©r.   r0   )r8   )r6   r5   )r5   r.   )r9   )r4   r3   )r3   r2   )ÚnxÚGraphr   Úchain_decompositionr   )r   ÚedgesÚGr    Úchainss   &    r   Útest_decompositionÚ)TestChainDecomposition.test_decomposition:   sg   € ò
ˆô$ �HŠH�U‹Oˆâ$Ø�VÐØ�VÐÚ&Ú$ð
ˆô ”b×,Ò,¨Q°QÔ7Ó8ˆÜ�6‹{œc (›mÔ+Ð+Ò+r   c                óð   € \         P                  ! ^^ 4      p\        \         P                  ! V^ R7      4      p. RO. RO.p\	        V4      \	        V4      8X  g   Q hV F  pV P                  WC4       K  	  R# )r0   r(   N©)é    r'   r/   )r-   rE   ©r1   )r+   r.   r:   )r;   Úbarbell_graphr   r=   r   r$   )r   r?   r@   r    r   s   &    r   Útest_barbell_graphÚ)TestChainDecomposition.test_barbell_graphX   sd   € ä×Ò˜Q Ó"ˆÜ”b×,Ò,¨Q°QÔ7Ó8ˆÚ,Ò.FÐGˆÜ�6‹{œc (›mÔ+Ð+Ð+ÛˆEØ×$Ñ$ UÖ5ó r   c                ó¾  € \         P                  ! ^^ 4      p\         P                  ! ^^ 4      p\        \        \	        ^4      R4      4      p\         P
                  ! W#RR7       \         P                  ! W4      p\        \         P                  ! V4      4      p. RO. RO. RO. RO.p\        V4      \        V4      8X  g   Q hV F  pV P                  We4       K  	  R# )	z4Test for a graph with multiple connected components.ÚabcdefF©ÚcopyNrD   rF   ©)ÚaÚb)rP   Úc)rQ   rO   ©)Údr!   )r!   Úf)rT   rS   ©r;   rG   ÚdictÚzipÚrangeÚrelabel_nodesÚunionr   r=   r   r$   ©r   r?   ÚHÚmappingr@   r    r   s   &      r   Útest_disconnected_graphÚ.TestChainDecomposition.test_disconnected_grapha   s°   € ä×Ò˜Q Ó"ˆÜ×Ò˜Q Ó"ˆÜ”sœ5 ›8 XÓ.Ó/ˆÜ
×Ò˜¨%Õ0Ü�HŠH�Q‹NˆÜ”b×,Ò,¨QÓ/Ó0ˆâ$Ú$Ú0Ú0ð	
ˆô �6‹{œc (›mÔ+Ð+Ð+ÛˆEØ×$Ñ$ UÖ5ó r   c                ó¶  € \         P                  ! ^^ 4      p\         P                  ! ^^ 4      p\        \        \	        ^4      R4      4      p\         P
                  ! W#RR7       \         P                  ! W4      p\        \         P                  ! VRR7      4      p. RO. RO.p\        V4      \        V4      8X  g   Q hV F  pV P                  We4       K  	  R# )	z4Test for a single component of a disconnected graph.rK   FrL   rO   r(   NrN   rR   rU   r[   s   &      r   Ú!test_disconnected_graph_root_nodeÚ8TestChainDecomposition.test_disconnected_graph_root_nodes   s¬   € ä×Ò˜Q Ó"ˆÜ×Ò˜Q Ó"ˆÜ”sœ5 ›8 XÓ.Ó/ˆÜ
×Ò˜¨%Õ0Ü�HŠH�Q‹NˆÜ”b×,Ò,¨Q°SÔ9Ó:ˆâ0Ú0ð
ˆô �6‹{œc (›mÔ+Ð+Ð+ÛˆEØ×$Ñ$ UÖ5ó r   c                ó  € \         P                  ! 4       pVP                  . RO4       \        P                  ! \         P
                  4      ;_uu_ 4        \         P                  ! V^R7       RRR4       R#   + '       g   i     R# ; i)z2Test chain decomposition when root is not in graphr(   N)r'   r-   r0   )r;   r<   Úadd_nodes_fromÚpytestÚraisesÚNodeNotFoundÚhas_bridges)r   r?   s   & r   Ú&test_chain_decomposition_root_not_in_GÚ=TestChainDecomposition.test_chain_decomposition_root_not_in_Gƒ   sK   € ä�HŠH‹JˆØ	×ÑšÔ#Ü�]Š]œ2Ÿ?™?×+Õ+Ü�NŠN˜1 1Õ%÷ ,×+×+Ò+ús   ÁA8Á8B		© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r$   rA   rH   r^   ra   ri   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   *   s+   ø‡ € Ù:ò)ò,ò<6ò6ò$6÷ &ð &r   r   )
rp   Ú	itertoolsr   r   re   Únetworkxr;   r   r   r   rk   r   r   Ú<module>rv      s'   ðÙ 7ç #ã ã òò 7÷ ^&ó ^&r   