Ë
    ÌiŸ  ã                   ó²   — d dl mZ d dlZd dlZd dlmc mZ d dl	m
Z
mZ d„ Zd„ Z G d„ d«      Z G d„ d	«      Z G d
„ d«      Z G d„ d«      Z G d„ d«      Zy)é    )ÚBytesION)Úedges_equalÚnodes_equalc                  óœ   — t        j                  d«      } t        j                  d«      }t         j                  j                  | |«      sJ ‚y)zSee gh-7557s#   >>graph6<<P~~~~~~~~~~~~~~~~~~~~~~{
s"   >>graph6<<P~~~~~~~~~~~~~~~~~~~~~~{N)ÚnxÚfrom_graph6_bytesÚutilsÚgraphs_equal)ÚGÚHs     úe/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/networkx/readwrite/tests/test_graph6.pyÚ.test_from_graph6_invariant_to_trailing_newliner   
   s>   € ä
×ÑÐDÓE€AÜ
×ÑÐBÓC€AÜ�8‰8× Ñ   AÔ&Ð&Ñ&ó    c                  óž   — t        j                  t        j                  «      5  t        j                  d«      } ddd«       y# 1 sw Y   yxY w)z>graph6 headers must not be followed by a newline. See gh-7557.s#   >>graph6<<
P~~~~~~~~~~~~~~~~~~~~~~{N)ÚpytestÚraisesr   ÚNetworkXErrorr   )r   s    r   Ú&test_from_graph6_raises_header_newliner      s>   € ä	�‰”r×'Ñ'Ó	(ñ JÜ× Ñ Ð!HÓIˆ÷J÷ Jñ Júó   ¤AÁAc                   ó   — e Zd Zd„ Zy)ÚTestGraph6Utilsc                 ó@  — dD ]™  }t        j                  t        j                  |«      «      d   |k(  sJ ‚t        j                  t        j                  |«      «      d   g k(  sJ ‚t        j                  t        j                  |«      ddgz   «      d   ddgk(  rŒ™J ‚ y )N)
r   é   é*   é>   é?   é@   iÿï i ð i-v l   ÿÿ? r   r   r   é+   )Úg6Ú	data_to_nÚ	n_to_data)ÚselfÚis     r   Útest_n_data_n_conversionz(TestGraph6Utils.test_n_data_n_conversion   sŒ   € ØMò 	KˆAÜ—<‘<¤§¡¨Q£Ó0°Ñ3°qÒ8Ð8Ð8Ü—<‘<¤§¡¨Q£Ó0°Ñ3°rÒ9Ð9Ð9Ü—<‘<¤§¡¨Q£°2°r°(Ñ :Ó;¸AÑ>À2ÀrÀ(ÓJÐJÐJñ	Kr   N)Ú__name__Ú
__module__Ú__qualname__r$   © r   r   r   r      s   „ óKr   r   c                   ó   — e Zd Zd„ Zd„ Zy)ÚTestFromGraph6Bytesc                 óª   — d}t        j                  |«      }t        |j                  «       g d¢«      sJ ‚t	        |j                  «       g d¢«      sJ ‚y )Nó   DF{)r   r   é   é   é   ))r   r.   )r   r/   )r   r.   )r   r/   )r-   r.   )r-   r/   )r.   r/   )r   r   r   Únodesr   Úedges)r"   Údatar   s      r   Útest_from_graph6_bytesz*TestFromGraph6Bytes.test_from_graph6_bytes    sK   € ØˆÜ× Ñ  Ó&ˆÜ˜1Ÿ7™7›9¢oÔ6Ð6Ð6ÜØ�G‰G‹IÒOô
ð 	
ñ 
r   c                 ó  — d}t        j                  |«      }t        |«      }t        j                  |«      }t	        |j                  «       |j                  «       «      sJ ‚t        |j                  «       |j                  «       «      sJ ‚y )Nr,   )r   r   r   Úread_graph6r   r0   r   r1   )r"   r2   r   ÚfhÚGins        r   Útest_read_equals_from_bytesz/TestFromGraph6Bytes.test_read_equals_from_bytes(   sf   € ØˆÜ× Ñ  Ó&ˆÜ�T‹]ˆÜ�n‰n˜RÓ ˆÜ˜1Ÿ7™7›9 c§i¡i£kÔ2Ð2Ð2Ü˜1Ÿ7™7›9 c§i¡i£kÔ2Ð2Ñ2r   N)r%   r&   r'   r3   r8   r(   r   r   r*   r*      s   „ ò
ó3r   r*   c                   ó   — e Zd Zd„ Zy)ÚTestReadGraph6c                 óº   — d}t        |«      }t        j                  |«      }t        |«      dk(  sJ ‚|D ]$  }t	        |«      t        t        d«      «      k(  rŒ$J ‚ y)z5Test for reading many graphs from a file into a list.s   DF{
D`{
DqK
D~{
r/   é   N)r   r   r5   ÚlenÚsortedÚlistÚrange)r"   r2   r6   Úglistr   s        r   Útest_read_many_graph6z$TestReadGraph6.test_read_many_graph62   sW   € à&ˆÜ�T‹]ˆÜ—‘˜rÓ"ˆÜ�5‹z˜QŠÐˆØò 	/ˆAÜ˜!“9¤¤U¨1£X£Ó.Ð.Ð.ñ	/r   N)r%   r&   r'   rB   r(   r   r   r:   r:   1   s   „ ó/r   r:   c                   ó  — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	e
j                  j                  d ej                  «        ej                  «       f«      d	„ «       Zd
„ Zd„ Zd„ Ze
j                  j                  dd«      d„ «       Zy)ÚTestWriteGraph6z:Unit tests for writing a graph to a file in graph6 format.c                 ó’   — t        «       }t        j                  t        j                  «       |«       |j	                  «       dk(  sJ ‚y ©Nó   >>graph6<<?
)r   r   Úwrite_graph6Ú
null_graphÚgetvalue©r"   Úresults     r   Útest_null_graphzTestWriteGraph6.test_null_graph?   s3   € Ü“ˆÜ
�‰œŸ™›¨Ô0Ø�‰Ó Ð$4Ò4Ð4Ñ4r   c                 ó’   — t        «       }t        j                  t        j                  «       |«       |j	                  «       dk(  sJ ‚y ©Ns   >>graph6<<@
)r   r   rH   Útrivial_graphrJ   rK   s     r   Útest_trivial_graphz"TestWriteGraph6.test_trivial_graphD   s6   € Ü“ˆÜ
�‰œ×(Ñ(Ó*¨FÔ3Ø�‰Ó Ð$4Ò4Ð4Ñ4r   c                 ó”   — t        «       }t        j                  t        j                  d«      |«       |j	                  «       dk(  sJ ‚y ©Nr/   s   >>graph6<<C~
©r   r   rH   Úcomplete_graphrJ   rK   s     r   Útest_complete_graphz#TestWriteGraph6.test_complete_graphI   s8   € Ü“ˆÜ
�‰œ×)Ñ)¨!Ó,¨fÔ5Ø�‰Ó Ð$5Ò5Ð5Ñ5r   c                 ó˜   — t        «       }t        j                  t        j                  d«      |d¬«       |j	                  «       dk(  sJ ‚y ©NéC   F©Úheadersv  ~?@B~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~w
rT   rK   s     r   Útest_large_complete_graphz)TestWriteGraph6.test_large_complete_graphN   s:   € Ü“ˆÜ
�‰œ×)Ñ)¨"Ó-¨v¸eÕDØ�‰Ó Ð$AÒAÐAÑAr   c                 ó˜   — t        «       }t        j                  t        j                  d«      |d¬«       |j	                  «       dk(  sJ ‚y ©Nr/   FrZ   s   C~
rT   rK   s     r   Útest_no_headerzTestWriteGraph6.test_no_headerS   s9   € Ü“ˆÜ
�‰œ×)Ñ)¨!Ó,¨f¸UÕCØ�‰Ó  GÒ+Ð+Ñ+r   c                 óž   — t        «       }t        j                  dd«      }t        j                  ||d¬«       |j	                  «       dk(  sJ ‚y ©Né   é	   FrZ   s   N??F~z{~Fw^_~?~?^_?
)r   r   Úcomplete_bipartite_graphrH   rJ   )r"   rL   r   s      r   Útest_complete_bipartite_graphz-TestWriteGraph6.test_complete_bipartite_graphX   sA   € Ü“ˆÜ×'Ñ'¨¨1Ó-ˆÜ
�‰˜˜6¨%Õ0à�‰Ó Ð$<Ò<Ð<Ñ<r   r   c                 ó°   — t        j                  t        j                  «      5  t        j                  |t        «       «       d d d «       y # 1 sw Y   y xY w©N)r   r   r   ÚNetworkXNotImplementedrH   r   ©r"   r   s     r   Ú test_no_directed_or_multi_graphsz0TestWriteGraph6.test_no_directed_or_multi_graphs_   s9   € ä�]‰]œ2×4Ñ4Ó5ñ 	*Ü�O‰O˜Aœw›yÔ)÷	*÷ 	*ñ 	*ús   ¤AÁAc                 ób  — t        t        d«      «      g d¢z   D ]“  }t        j                  j	                  |||z  dz  |¬«      }t        «       }t        j                  ||d¬«       |j                  «       j                  «       }t        |«      |dz
  |z  dz  d	z   d
z  |dk  rdndz   k(  rŒ“J ‚ y ©Né   ©é   é/   r   r   r   éH   r/   ©ÚseedFrZ   r   r-   r<   rb   r   )
r?   r@   r   Úrandom_graphsÚgnm_random_graphr   rH   rJ   Úrstripr=   )r"   r#   ÚgÚgstrs       r   Útest_lengthzTestWriteGraph6.test_lengthd   s¨   € Ü”e˜B“i“Ò#;Ñ;ò 	SˆAÜ× Ñ ×1Ñ1°!°Q¸±U¸a±ZÀaÐ1ÓHˆAÜ“9ˆDÜ�O‰O˜A˜t¨EÕ2à—=‘=“?×)Ñ)Ó+ˆDÜ�t“9 ! a¡%¨1¡°Ñ!1°AÑ!5¸!Ñ ;ÀAÈÂF¹qÐPQÑ RÓRÐRÐRñ	Sr   c                 óÄ  — t        t        d«      «      g d¢z   D ]Ä  }t        j                  j	                  |||z  dz  |¬«      }t        «       }t        j                  ||«       |j                  d«       t        j                  |«      }t        |j                  «       |j                  «       «      sJ ‚t        |j                  «       |j                  «       «      rŒÄJ ‚ y )Nrm   rn   r/   rr   r   )r?   r@   r   rt   ru   r   rH   Úseekr5   r   r0   r   r1   )r"   r#   r   Úfr   s        r   Útest_roundtripzTestWriteGraph6.test_roundtripm   sª   € Ü”e˜B“i“Ò#;Ñ;ò 	5ˆAÜ× Ñ ×1Ñ1°!°Q¸±U¸a±ZÀaÐ1ÓHˆAÜ“	ˆAÜ�O‰O˜A˜qÔ!Ø�F‰F�1ŒIÜ—‘˜qÓ!ˆAÜ˜qŸw™w›y¨!¯'©'«)Ô4Ð4Ð4Ü˜qŸw™w›y¨!¯'©'«)Õ4Ð4Ð4ñ	5r   c                 óê   — t        |dz  d«      5 }t        j                  t        j                  «       |«       |j                  d«       |j                  «       dk(  sJ ‚	 d d d «       y # 1 sw Y   y xY w)Nztest.g6zw+br   rG   )Úopenr   Úwrite_graph6_filer   rI   r{   Úread)r"   Útmp_pathr|   s      r   Útest_write_pathzTestWriteGraph6.test_write_pathw   s^   € Ü�(˜YÑ&¨Ó.ð 	0°!Ü× Ñ ¤§¡£°!Ô4Ø�F‰F�1ŒIØ—6‘6“8Ð/Ò/Ð/Ñ/÷	0÷ 	0ñ 	0ús   �AA)Á)A2Úedge©)r   r   )r   r-   )r   r   c                 ó¼   — t        j                  |g«      }t        «       }t        j                  ||«       |j	                  d«       |j                  «       dk(  sJ ‚y )Nr   ó   >>graph6<<A_
)r   ÚGraphr   rH   r{   r�   )r"   r„   r   r|   s       r   Útest_relabelingzTestWriteGraph6.test_relabeling}   sG   € ä�H‰H�d�VÓˆÜ‹IˆÜ
�‰˜˜1ÔØ	�‰ˆqŒ	Ø�v‰v‹xÐ,Ò,Ð,Ñ,r   N)r%   r&   r'   Ú__doc__rM   rQ   rV   r\   r_   re   r   ÚmarkÚparametrizer   Ú
MultiGraphÚDiGraphrj   ry   r}   rƒ   r‰   r(   r   r   rD   rD   <   s–   „ ÙDò5ò
5ò
6ò
Bò
,ò
=ð ‡[�[×Ñ˜S = 2§=¡=£?°J°B·J±J³LÐ"AÓBñ*ó Cð*òSò5ò0ð ‡[�[×Ñ˜VÐ%>Ó?ñ-ó @ñ-r   rD   c                   ó  — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Ze	j                  j                  d ej                  «        ej                  «       f«      d„ «       Zd	„ Zd
„ Ze	j                  j                  dd«      d„ «       Zy)ÚTestToGraph6Bytesc                 ó`   — t        j                  «       }t        j                  |«      dk(  sJ ‚y rF   )r   rI   r   Úto_graph6_bytesri   s     r   rM   z!TestToGraph6Bytes.test_null_graph‡   s'   € Ü�M‰M‹OˆÜ×!Ñ! !Ó$Ð(8Ò8Ð8Ñ8r   c                 ó`   — t        j                  «       }t        j                  |«      dk(  sJ ‚y rO   )r   rP   r   r’   ri   s     r   rQ   z$TestToGraph6Bytes.test_trivial_graph‹   s*   € Ü×ÑÓˆÜ×!Ñ! !Ó$Ð(8Ò8Ð8Ñ8r   c                 ó^   — t        j                  t        j                  d«      «      dk(  sJ ‚y rS   )r   r’   r   rU   )r"   s    r   rV   z%TestToGraph6Bytes.test_complete_graph�   s'   € Ü×!Ñ!¤"×"3Ñ"3°AÓ"6Ó7Ð;LÒLÐLÑLr   c                 óf   — t        j                  d«      }t        j                  |d¬«      dk(  sJ ‚y rX   ©r   rU   r   r’   ri   s     r   r\   z+TestToGraph6Bytes.test_large_complete_graph’   s.   € Ü×Ñ˜bÓ!ˆÜ×!Ñ! !¨EÔ2Ð6SÒSÐSÑSr   c                 óf   — t        j                  d«      }t        j                  |d¬«      dk(  sJ ‚y r^   r–   ri   s     r   r_   z TestToGraph6Bytes.test_no_header–   s-   € Ü×Ñ˜aÓ ˆÜ×!Ñ! !¨EÔ2°gÒ=Ð=Ñ=r   c                 óh   — t        j                  dd«      }t        j                  |d¬«      dk(  sJ ‚y ra   )r   rd   r   r’   ri   s     r   re   z/TestToGraph6Bytes.test_complete_bipartite_graphš   s0   € Ü×'Ñ'¨¨1Ó-ˆÜ×!Ñ! !¨EÔ2Ð6NÒNÐNÑNr   r   c                 óž   — t        j                  t        j                  «      5  t	        j
                  |«       d d d «       y # 1 sw Y   y xY wrg   )r   r   r   rh   r   r’   ri   s     r   rj   z2TestToGraph6Bytes.test_no_directed_or_multi_graphsž   s7   € ä�]‰]œ2×4Ñ4Ó5ñ 	"Ü×Ñ˜qÔ!÷	"÷ 	"ñ 	"úr   c                 ó,  — t        t        d«      «      g d¢z   D ]x  }t        j                  j	                  |||z  dz  |¬«      }t        j                  |d¬«      j                  «       }t        |«      |dz
  |z  dz  d	z   d
z  |dk  rdndz   k(  rŒxJ ‚ y rl   )	r?   r@   r   rt   ru   r   r’   rv   r=   )r"   r#   r   rx   s       r   ry   zTestToGraph6Bytes.test_length£   s˜   € Ü”e˜B“i“Ò#;Ñ;ò 	SˆAÜ× Ñ ×1Ñ1°!°Q¸±U¸a±ZÀaÐ1ÓHˆAä×%Ñ% a°Ô6×=Ñ=Ó?ˆDÜ�t“9 ! a¡%¨1¡°Ñ!1°AÑ!5¸!Ñ ;ÀAÈÂF¹qÐPQÑ RÓRÐRÐRñ		Sr   c                 ó¨  — t        t        d«      «      g d¢z   D ]¶  }t        j                  j	                  |||z  dz  |¬«      }t        j                  |«      }t        j                  |j                  «       «      }t        |j                  «       |j                  «       «      sJ ‚t        |j                  «       |j                  «       «      rŒ¶J ‚ y )Nrm   rn   r/   rr   )r?   r@   r   rt   ru   r   r’   r   rv   r   r0   r   r1   )r"   r#   r   r2   r   s        r   r}   z TestToGraph6Bytes.test_roundtripª   s¢   € Ü”e˜B“i“Ò#;Ñ;ò 	5ˆAÜ× Ñ ×1Ñ1°!°Q¸±U¸a±ZÀaÐ1ÓHˆAÜ×%Ñ% aÓ(ˆDÜ×$Ñ$ T§[¡[£]Ó3ˆAÜ˜qŸw™w›y¨!¯'©'«)Ô4Ð4Ð4Ü˜qŸw™w›y¨!¯'©'«)Õ4Ð4Ð4ñ	5r   r„   r…   c                 ód   — t        j                  |g«      }t        j                  |«      dk(  sJ ‚y )Nr‡   )r   rˆ   r   r’   )r"   r„   r   s      r   r‰   z!TestToGraph6Bytes.test_relabeling²   s,   € ä�H‰H�d�VÓˆÜ×!Ñ! !Ó$Ð(9Ò9Ð9Ñ9r   N)r%   r&   r'   rM   rQ   rV   r\   r_   re   r   r‹   rŒ   r   r�   rŽ   rj   ry   r}   r‰   r(   r   r   r�   r�   †   s�   „ ò9ò9òMòTò>òOð ‡[�[×Ñ˜S = 2§=¡=£?°J°B·J±J³LÐ"AÓBñ"ó Cð"òSò5ð ‡[�[×Ñ˜VÐ%>Ó?ñ:ó @ñ:r   r�   )Úior   r   Únetworkxr   Únetworkx.readwrite.graph6Ú	readwriteÚgraph6r   Únetworkx.utilsr   r   r   r   r   r*   r:   rD   r�   r(   r   r   ú<module>r£      sY   ðÝ ã ã ß &Ð &ß 3ò'òJ÷Kñ K÷3ñ 3÷$/ñ /÷G-ñ G-÷T/:ò /:r   