Ë
    D^(hm  ã                   ó  — d Z ddlmZ ddlZddlZddlmZ  ej                  d«      Z	 G d„ d«      Z
d„ Zej                  j                  d	ej                  ej                  ej                   ej"                  g«      d
„ «       Zd„ Zy)z'Unit tests for pydot drawing functions.é    )ÚStringION)Úgraphs_equalÚpydotc                   óÔ   — e Zd Zej                  j                  d ej                  «        ej                  «       f«      ej                  j                  dd«      d„ «       «       Z	d„ Z
y)Ú	TestPydotÚGÚprog)ÚneatoÚdotc                 ó¢  — d|j                   d<   |j                  g d¢«       |j                  d«       t        j                  j                  ||¬«      }t        |t        «      sJ ‚t        j                  j                  |«      }|j                  t        j                  j                  |«      «      }t        ||«      sJ ‚|dz  }|j                  |«       t        j                  |d¬«      }t        |«      d	k(  sJ ‚|d
   }	t!        d„ |j#                  «       D «       «      }
t!        d„ |	j#                  «       D «       «      }|
|k(  sJ ‚t!        d„ |j%                  «       D «       «      }t!        d„ |	j%                  «       D «       «      }||k(  sJ ‚t        j                  j'                  |«      }|j                  |«      }t        ||«      sJ ‚y)z©
        Validate :mod:`pydot`-based usage of the passed NetworkX graph with the
        passed basename of an external GraphViz command (e.g., `dot`, `neato`).
        r   Úname)©ÚAÚB)r   ÚC©r   r   )r   ÚDÚE©r	   zout.dotzutf-8)ÚpathÚencodingé   r   c              3   ó<   K  — | ]  }|j                  «       –— Œ y ­w©N©Úget_name©Ú.0Úps     ú_/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/networkx/drawing/tests/test_pydot.pyú	<genexpr>z'TestPydot.test_pydot.<locals>.<genexpr>:   s   è ø€ Ò< Q�A—J‘J—LÑ<ùó   ‚c              3   ó<   K  — | ]  }|j                  «       –— Œ y ­wr   r   r   s     r    r!   z'TestPydot.test_pydot.<locals>.<genexpr>=   s   è ø€ Ò> Q�A—J‘J—LÑ>ùr"   c              3   ó\   K  — | ]$  }|j                  «       |j                  «       f–— Œ& y ­wr   ©Ú
get_sourceÚget_destination©r   Úes     r    r!   z'TestPydot.test_pydot.<locals>.<genexpr>C   s$   è ø€ ÒU¸a�Q—\‘\“^ Q×%6Ñ%6Ó%8Ô9ÑUùó   ‚*,c              3   ó\   K  — | ]$  }|j                  «       |j                  «       f–— Œ& y ­wr   r%   r(   s     r    r!   z'TestPydot.test_pydot.<locals>.<genexpr>F   s$   è ø€ ÒW¸a�Q—\‘\“^ Q×%6Ñ%6Ó%8Ô9ÑWùr*   N)ÚgraphÚadd_edges_fromÚadd_nodeÚnxÚnx_pydotÚpydot_layoutÚ
isinstanceÚdictÚto_pydotÚ	__class__Ú
from_pydotr   Ú	write_rawr   Úgraph_from_dot_fileÚlenÚsortedÚget_node_listÚget_edge_listÚread_dot)Úselfr   r	   Útmp_pathÚgraph_layoutÚPÚG2ÚfnameÚPin_listÚPinÚn1Ún2Úe1Úe2ÚHins                  r    Ú
test_pydotzTestPydot.test_pydot   s¥  € ð ˆ�‰�‰ð 	
×ÑÒIÔJØ	�
‰
�3Œô —{‘{×/Ñ/°¸Ð/Ó=ˆÜ˜,¬Ô-Ð-Ð-ô �K‰K× Ñ  Ó#ˆð �[‰[œŸ™×/Ñ/°Ó2Ó3ˆô ˜A˜rÔ"Ð"Ð"à˜9Ñ$ˆð 	
�‰�EÔô ×,Ñ,°%À'Ð,ÓJˆô �8‹} Ò!Ð!Ð!ð �q‰kˆô Ñ<¨!¯/©/Ó*;Ô<Ó<ˆô Ñ>¨#×*;Ñ*;Ó*=Ô>Ó>ˆð �RŠxˆˆxô ÑUÀ1Ç?Á?ÓCTÔUÓUˆô ÑWÀ3×CTÑCTÓCVÔWÓWˆð �RŠxˆˆxô �k‰k×"Ñ" 5Ó)ˆØ�k‰k˜#Óˆô ˜A˜sÔ#Ð#Ñ#ó    c                 óB  — t        j                  «       }d|j                  d<   |j                  ddd¬«       t	        «       }t         j
                  j                  ||«       |j                  d«       t         j
                  j                  |«      }t        ||«      sJ ‚y )Nr   r   Ú1Ú2Ú0)Úkeyr   )
r/   Ú
MultiGraphr,   Úadd_edger   r0   Ú	write_dotÚseekr=   r   )r>   r   ÚfhÚHs       r    Útest_read_writezTestPydot.test_read_writeR   sv   € Ü�M‰M‹OˆØˆ�‰�‰Ø	�
‰
�3˜ ˆ
Ô%Ü‹ZˆÜ
�‰×Ñ˜a Ô$Ø
�‰�Œ
Ü�K‰K× Ñ  Ó$ˆÜ˜A˜qÔ!Ð!Ñ!rL   N)Ú__name__Ú
__module__Ú__qualname__ÚpytestÚmarkÚparametrizer/   ÚGraphÚDiGraphrK   rX   © rL   r    r   r      s\   „ Ø‡[�[×Ñ˜S 8 2§8¡8£:¨z¨r¯z©z«|Ð"<Ó=Ø‡[�[×Ñ˜VÐ%5Ó6ñ@$ó 7ó >ð@$óD"rL   r   c                 óv  — t        j                  «       }|j                  g d¢«       t         j                  j	                  |d¬«      }t        |t        «      sJ ‚t         j                  j                  |«      }t        j                  t         j                  j                  |«      «      }t        ||«      sJ ‚y)z»Validate that `nx_pydot.pydot_layout` handles nodes
    with characters like "
", " ".

    Those characters cause `pydot` to escape and quote them on output,
    which caused #7581.
    ))ú
A
big testr   )rc   r   r   r   r   N)
r/   r_   r-   r0   r1   r2   r3   r4   r6   r   )r?   r   r@   rA   rB   s        r    Útest_pydot_issue_7581rd   ]   sŠ   € ô 	�‰‹
€AØ×ÑÒMÔNä—;‘;×+Ñ+¨A°EÐ+Ó:€LÜ�l¤DÔ)Ð)Ð)ô 	�‰×Ñ˜QÓ€AÜ	�‰”"—+‘+×(Ñ(¨Ó+Ó	,€BÜ˜˜2ÔÐÑrL   Ú
graph_typec           	      ó²  —  | «       }|j                  dt        dg«      dd¬«       |j                  dddd	t        d
g«      ¬«       |j                  ddd¬«       dddœddddœddigt        j                  j	                  t        j                  j                  |«      «      j                  j                  «       D ��cg c]  \  }}}|‘Œ
 c}}k(  sJ ‚|j                  «       D �ch c]  }t        |«      ’Œ c}t        t        j                  j	                  t        j                  j                  |«      «      j                  «      k(  sJ ‚y c c}}w c c}w )NÚ5r   z"Example:A"F)ÚtÚlrN   é   T)Únode1rk   )Úwrh   ri   Únode)é   rn   Ústring)rl   ÚFalseÚTruez
('node1',)zfrozenset({'node1'})rl   )rS   Ú	frozensetr/   r0   r6   r4   ÚedgesÚdataÚnodesÚstrÚset)re   r   Ú_ÚattrÚis        r    Útest_hashable_pydotr{   p   s0  € ñ
 	‹€AØ‡J�Jˆs”I˜q˜c“N m°u€JÔ=Ø‡J�Jˆs�A˜ ¬y¸'¸Ó/C€JÔDØ‡J�Jˆv�v €JÔ*ð  'Ñ*Ø˜<Ð.DÑEØ	ˆhˆðô Ÿ+™+×0Ñ0´·±×1EÑ1EÀaÓ1HÓI×OÑO×TÑTÓV÷
áˆAˆq�$ò 	ó
ò	ð ð ð ŸG™G›IÖ&�qŒC��FÒ&¬#Ü
�‰×ÑœrŸ{™{×3Ñ3°AÓ6Ó7×=Ñ=ó+ò ð ñ ùó
ùò
 's   Â?EÃ&Ec                  ó   — t        j                  «       } | j                  ddg«       t         j                  j	                  | d¬«      }t        |t        «      sJ ‚d|vsJ ‚d|v sJ ‚d|vsJ ‚d|v sJ ‚d	|v sJ ‚d
|v sJ ‚y )Nr   )r   r   r   r   rP   r   rN   r   r   r   )r/   r_   r-   r0   r1   r2   r3   )r   r@   s     r    Útest_pydot_numerical_namer}   ˆ   s�   € Ü
�‰‹
€AØ×Ñ�j &Ð)Ô*Ü—;‘;×+Ñ+¨A°EÐ+Ó:€LÜ�l¤DÔ)Ð)Ð)Ø�lÑ"Ð"Ð"Ø�ÑÐÐØ�lÑ"Ð"Ð"Ø�ÑÐÐØ�,ÑÐÐØ�,ÑÐÑrL   )Ú__doc__Úior   r\   Únetworkxr/   Únetworkx.utilsr   Úimportorskipr   r   rd   r]   r^   r_   r`   rR   ÚMultiDiGraphr{   r}   ra   rL   r    ú<module>r„      s~   ðÙ -å ã ã Ý 'àˆ×Ñ˜GÓ$€÷M"ñ M"ò`ð& ‡�×ÑØ�2—8‘8˜RŸZ™Z¨¯©¸¿¹ÐHóñóðó*
rL   