§
    bŠtje5  ã                   óÆ   — d dl Z d dlZd dlmZ  G d„ d¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d	„ d
ee¦  «        Z G d„ d¦  «        Z	 G d„ d¦  «        Z
dS )é    N)Úedges_equalc                   ó¾   — e Zd Z eej        ¦  «        Zej        Z eej	        j
        ¦  «        Z eej	        j        ¦  «        Zed„ ¦   «         Zd„ Zd„ Zd„ Zd„ ZdS )ÚTestSubGraphViewc                 ór   — t          j        d|                      ¦   «         ¬¦  «        | _        h d£| _        d S )Né	   ©Úcreate_using>   ©é   é   ©r   é   ©r   é   )ÚnxÚ
path_graphÚgraphÚGÚhide_edges_w_hide_nodes)Úclss    úg/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/networkx/classes/tests/test_subgraphviews.pyÚsetup_classzTestSubGraphView.setup_class   s4   € å”˜a¨c¯iªi©k¬kÐ:Ñ:Ô:ˆŒØ&>Ð&>Ð&>ˆÔ#Ð#Ð#ó    c                 ó€  — g d¢}t           j                             |¦  «        }| j        } || j        |¬¦  «        }| j        j        |j        z
  ddhk    sJ ‚| j        j        |j        z
  | j        k    sJ ‚|                     ¦   «         r8t          |d         ¦  «        g k    sJ ‚t          |d         ¦  «        dgk    sJ ‚n9t          |d         ¦  «        dgk    sJ ‚t          |d         ¦  «        ddhk    sJ ‚t          j        t          |j        d¦  «         t          j        t          |j        d¦  «         t          j        t          |j        d	¦  «         |                     d¦  «        |                     ¦   «         rdndk    sJ ‚|                     ¦   «         |                     ¦   «         rd
ndk    sJ ‚d S )N©r   r   éo   ©Úfilter_noder   r   r   é   é   ép   r   é   )r   ÚfiltersÚ
hide_nodesÚgviewr   ÚnodesÚedgesr   Úis_directedÚlistÚsetÚpytestÚraisesÚKeyErrorÚ__getitem__ÚdegreeÚis_multigraphÚsize)Úselfr$   Ú
nodes_goner%   r   s        r   Útest_hidden_nodesz"TestSubGraphView.test_hidden_nodes   s¥  € Ø �[�[ˆ
Ý”Z×*Ò*¨:Ñ6Ô6ˆ
Ø”
ˆØˆE�$”& jÐ1Ñ1Ô1ˆØŒvŒ|˜aœgÑ%¨!¨Q¨Ò/Ð/Ð/Ð/ØŒvŒ|˜aœgÑ%¨Ô)EÒEÐEÐEÐEØ�=Š=‰?Œ?ð 	'Ý˜˜!œ‘:”: Ò#Ð#Ð#Ð#Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ð$å˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ý�q˜”t‘9”9  A Ò&Ð&Ð&Ð&ÝŒ•h ¤¨qÑ1Ô1Ð1ÝŒ•h ¤¨sÑ3Ô3Ð3ÝŒ•h ¤¨sÑ3Ô3Ð3Ø�xŠx˜‰{Œ{ A§O¢OÑ$5Ô$5Ð<˜q˜q¸1Ò=Ð=Ð=Ð=Ø�vŠv‰xŒx §¢Ñ!2Ô!2Ð9˜A˜A¸Ò:Ð:Ð:Ð:Ð:Ð:r   c                 óv  — g d¢}|                       |¦  «        }| j        } || j        |¬¦  «        }| j        j        |j        k    sJ ‚|                     ¦   «         r’| j        j        |j        z
  dhk    sJ ‚t          |d         ¦  «        g k    sJ ‚t          |j        d         ¦  «        g k    sJ ‚t          |j        d         ¦  «        dgk    sJ ‚|                     ¦   «         dk    sJ ‚nR| j        j        |j        z
  ddhk    sJ ‚t          |d         ¦  «        dgk    sJ ‚|                     ¦   «         d	k    sJ ‚t          |d         ¦  «        d
gk    sJ ‚t          j
        t          |j        d¦  «         t          j
        t          |j        d¦  «         |                     d¦  «        dk    sJ ‚d S )N©©r   r   )é   r"   )éÞ   éß   ©Úfilter_edger7   r   r   r    r"   ©r"   r8   r   r   éÝ   r9   )Úhide_edges_filterr%   r   r&   r(   r'   r)   Úpredr1   r+   r,   r-   r.   r/   )r2   Ú
hide_edgesÚ
edges_goner%   r   s        r   Útest_hidden_edgesz"TestSubGraphView.test_hidden_edges%   s­  € Ø1Ð1Ð1ˆ
Ø×+Ò+¨JÑ7Ô7ˆ
Ø”
ˆØˆE�$”& jÐ1Ñ1Ô1ˆØŒvŒ|˜qœwÒ&Ð&Ð&Ð&Ø�=Š=‰?Œ?ð 		!Ø”6”< !¤'Ñ)¨f¨XÒ5Ð5Ð5Ð5Ý˜˜!œ‘:”: Ò#Ð#Ð#Ð#Ý˜œ˜qœ	‘?”? bÒ(Ð(Ð(Ð(Ý˜œ˜qœ	‘?”? q cÒ)Ð)Ð)Ð)Ø—6’6‘8”8˜q’=�=�=�=�=à”6”< !¤'Ñ)¨f°fÐ-=Ò=Ð=Ð=Ð=Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ø—6’6‘8”8˜q’=�=�=�=Ý�A�a”D‰zŒz˜a˜SÒ Ð Ð Ð ÝŒ•h ¤¨sÑ3Ô3Ð3ÝŒ•h ¤¨sÑ3Ô3Ð3Ø�xŠx˜‰{Œ{˜aÒÐÐÐÐÐr   c                 ó  — t           j                             g d¢¦  «        }| j        } || j        |¬¦  «        }t          |j        ¦  «        ddhk    sJ ‚|                     ¦   «         rt          |d         ¦  «        g k    sJ ‚nt          |d         ¦  «        dgk    sJ ‚t          |d         ¦  «        dgk    sJ ‚t          j
        t          |j        d¦  «         t          j
        t          |j        d¦  «         t          j
        t          |j        d¦  «         |                     d¦  «        |                     ¦   «         rdndk    sJ ‚|                     ¦   «         |                     ¦   «         rdndk    sJ ‚d S )	N)r   r   r   r   r   r   r   r!   r   r    )r   r#   Ú
show_nodesr%   r   r*   r&   r(   r)   r+   r,   r-   r.   r/   r0   r1   )r2   Úinduced_subgraphr%   r   s       r   Útest_shown_nodez TestSubGraphView.test_shown_node:   sa  € Ýœ:×0Ò0°°°Ñ=Ô=ÐØ”
ˆØˆE�$”&Ð&6Ð7Ñ7Ô7ˆÝ�1”7‰|Œ|  1˜vÒ%Ð%Ð%Ð%Ø�=Š=‰?Œ?ð 	%Ý˜˜!œ‘:”: Ò#Ð#Ð#Ð#Ð#å˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ý�A�a”D‰zŒz˜a˜SÒ Ð Ð Ð ÝŒ•h ¤¨qÑ1Ô1Ð1ÝŒ•h ¤¨sÑ3Ô3Ð3ÝŒ•h ¤¨sÑ3Ô3Ð3Ø�xŠx˜‰{Œ{ A§O¢OÑ$5Ô$5Ð<˜q˜q¸1Ò=Ð=Ð=Ð=Ø�vŠv‰xŒx §¢Ñ!2Ô!2Ð9˜A˜A¸Ò:Ð:Ð:Ð:Ð:Ð:r   c                 ó€  — g d¢}|                       |¦  «        }|                      | j        |¬¦  «        }| j        j        |j        k    sJ ‚|                     ¦   «         r¡|j        dhk    sJ ‚t          |d         ¦  «        g k    sJ ‚t          |d         ¦  «        dgk    sJ ‚t          |j        d         ¦  «        dgk    sJ ‚t          |j        d         ¦  «        g k    sJ ‚|                     ¦   «         dk    sJ ‚na|j        ddhk    sJ ‚t          |d         ¦  «        dgk    sJ ‚t          |d         ¦  «        dgk    sJ ‚|                     ¦   «         dk    sJ ‚t          j
        t          |j        d¦  «         t          j
        t          |j        d	¦  «         |                     d¦  «        dk    sJ ‚d S )
Nr6   r;   r7   r   r   r    r=   r>   r9   )Úshow_edges_filterr%   r   r&   r(   r'   r)   r@   r1   r+   r,   r-   r.   r/   ©r2   Ú
show_edgesÚedge_subgraphr   s       r   Útest_shown_edgesz!TestSubGraphView.test_shown_edgesJ   s²  € Ø1Ð1Ð1ˆ
Ø×.Ò.¨zÑ:Ô:ˆØ�JŠJ�t”v¨=ˆJÑ9Ô9ˆØŒvŒ|˜qœwÒ&Ð&Ð&Ð&Ø�=Š=‰?Œ?ð 	!Ø”7˜v˜hÒ&Ð&Ð&Ð&Ý˜˜!œ‘:”: Ò#Ð#Ð#Ð#Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ý˜œ˜qœ	‘?”? q cÒ)Ð)Ð)Ð)Ý˜œ˜qœ	‘?”? bÒ(Ð(Ð(Ð(Ø—6’6‘8”8˜q’=�=�=�=�=à”7˜v vÐ.Ò.Ð.Ð.Ð.Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ø—6’6‘8”8˜q’=�=�=�=ÝŒ•h ¤¨sÑ3Ô3Ð3ÝŒ•h ¤¨sÑ3Ô3Ð3Ø�xŠx˜‰{Œ{˜aÒÐÐÐÐÐr   N)Ú__name__Ú
__module__Ú__qualname__Ústaticmethodr   Úsubgraph_viewr%   ÚGraphr   r#   rA   r?   rK   rI   Úclassmethodr   r4   rC   rG   rM   © r   r   r   r      s¬   € € € € € ØˆL˜Ô)Ñ*Ô*€EØŒH€EØ$˜ R¤ZÔ%:Ñ;Ô;ÐØ$˜ R¤ZÔ%:Ñ;Ô;Ðàð?ð ?ñ „[ð?ð;ð ;ð ;ð& ð  ð  ð*;ð ;ð ;ð  ð  ð  ð  ð  r   r   c                   ó²   — e Zd Z eej        ¦  «        Zej        Z eej	        j
        ¦  «        Z eej	        j        ¦  «        Zg d¢Zh d£Zd„ Zd„ Zd„ ZdS )ÚTestSubDiGraphViewr6   >   r7   r
   r   r   c                 ó6  — |                       | j        ¦  «        }g d¢}t          j                             |¦  «        }|                      | j        ||¬¦  «        }| j        j        |j        z
  | j        k    sJ ‚| j        j	        |j	        z
  | j        k    sJ ‚d S )Nr   ©r   r<   )
r?   rA   r   r#   r$   r%   r   Úin_edgesÚexcludedÚ	out_edges©r2   rB   r$   r3   r   s        r   Útest_inoutedgesz"TestSubDiGraphView.test_inoutedgesh   s‘   € Ø×+Ò+¨D¬OÑ<Ô<ˆ
Ø �[�[ˆ
Ý”Z×*Ò*¨:Ñ6Ô6ˆ
Ø�JŠJ�t”v¨:À:ˆJÑNÔNˆàŒvŒ ¤Ñ+¨t¬}Ò<Ð<Ð<Ð<ØŒvÔ !¤+Ñ-°´Ò>Ð>Ð>Ð>Ð>Ð>r   c                 ó<  — |                       | j        ¦  «        }g d¢}t          j                             |¦  «        }|                      | j        ||¬¦  «        }t          |j        d         ¦  «        dgk    sJ ‚t          |j        d         ¦  «        g k    sJ ‚d S )Nr   rY   r   r    r   )	r?   rA   r   r#   r$   r%   r   r)   r@   r]   s        r   Ú	test_predzTestSubDiGraphView.test_predq   s�   € Ø×+Ò+¨D¬OÑ<Ô<ˆ
Ø �[�[ˆ
Ý”Z×*Ò*¨:Ñ6Ô6ˆ
Ø�JŠJ�t”v¨:À:ˆJÑNÔNˆå�A”F˜1”I‰Œ 1 #Ò%Ð%Ð%Ð%Ý�A”F˜1”I‰Œ "Ò$Ð$Ð$Ð$Ð$Ð$r   c                 ó�  — |                       | j        ¦  «        }g d¢}t          j                             |¦  «        }|                      | j        ||¬¦  «        }|                     d¦  «        dk    sJ ‚|                     d¦  «        dk    sJ ‚| 	                    d¦  «        dk    sJ ‚| 
                    ¦   «         dk    sJ ‚d S )Nr   rY   r   r    r   r   ©r?   rA   r   r#   r$   r%   r   r/   Ú
out_degreeÚ	in_degreer1   r]   s        r   Útest_inout_degreez$TestSubDiGraphView.test_inout_degreez   ó¸   € Ø×+Ò+¨D¬OÑ<Ô<ˆ
Ø �[�[ˆ
Ý”Z×*Ò*¨:Ñ6Ô6ˆ
Ø�JŠJ�t”v¨:À:ˆJÑNÔNˆà�xŠx˜‰{Œ{˜aÒÐÐÐØ�|Š|˜A‰Œ !Ò#Ð#Ð#Ð#Ø�{Š{˜1‰~Œ~ Ò"Ð"Ð"Ð"Ø�vŠv‰xŒx˜1Š}ˆ}ˆ}ˆ}ˆ}ˆ}r   N)rN   rO   rP   rQ   r   rR   r%   ÚDiGraphr   r#   Úhide_diedgesr?   Úshow_diedgesrI   rA   r[   r^   r`   re   rU   r   r   rW   rW   `   sš   € € € € € ØˆL˜Ô)Ñ*Ô*€EØŒJ€EØ$˜ R¤ZÔ%<Ñ=Ô=ÐØ$˜ R¤ZÔ%<Ñ=Ô=ÐØ-Ð-Ð-€JØ/Ð/Ð/€Hð?ð ?ð ?ð%ð %ð %ð	ð 	ð 	ð 	ð 	r   rW   c                   ó²   — e Zd Z eej        ¦  «        Zej        Z eej	        j
        ¦  «        Z eej	        j        ¦  «        Zed„ ¦   «         Zd„ Zd„ ZdS )ÚTestMultiGraphViewc                 ó®   — t          j        d|                      ¦   «         ¬¦  «        | _        ddh}| j                             |¦  «         h d£| _        d S )Nr   r   ©r   r   r   )r   r   r   >   ©r   r   r   ©r   r   r   ©r   r   r   )r   r   r   r   Úadd_edges_fromr   )r   Ú
multiedgess     r   r   zTestMultiGraphView.setup_class�   sT   € å”˜a¨c¯iªi©k¬kÐ:Ñ:Ô:ˆŒØ Ð+ˆ
ØŒ×Ò˜ZÑ(Ô(Ð(Ø&GÐ&GÐ&GˆÔ#Ð#Ð#r   c                 ó¼  — g d¢}|                       |¦  «        }|                      | j        |¬¦  «        }| j        j        |j        k    sJ ‚|                     ¦   «         r°| j        j        |j        z
  dhk    sJ ‚t          |d         ¦  «        dgk    sJ ‚t          |d         ¦  «        dgk    sJ ‚t          |j        d         ¦  «        dgk    sJ ‚t          |j        d         ¦  «        dgk    sJ ‚|                     ¦   «         dk    sJ ‚np| j        j        |j        z
  dd	hk    sJ ‚t          |d         ¦  «        ddgk    sJ ‚t          |d         ¦  «        ddgk    sJ ‚|                     ¦   «         d
k    sJ ‚| 	                    d¦  «        dk    sJ ‚t          j        t          |j        d¦  «         t          j        t          |j        d¦  «         d S )N©rm   )r   r   r   ©r8   r"   r   ©r9   r:   r   r;   rm   r   r   r   r    r   ©r"   r8   r   r8   r>   r9   )r?   r%   r   r&   r(   r'   r)   r@   r1   r/   r+   r,   r-   r.   )r2   rA   rB   r   s       r   rC   z$TestMultiGraphView.test_hidden_edges”   sÌ  € ØEÐEÐEˆ
Ø×+Ò+¨JÑ7Ô7ˆ
Ø�JŠJ�t”v¨:ˆJÑ6Ô6ˆØŒvŒ|˜qœwÒ&Ð&Ð&Ð&Ø�=Š=‰?Œ?ð 	!Ø”6”< !¤'Ñ)¨i¨[Ò8Ð8Ð8Ð8Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ý˜œ˜qœ	‘?”? q cÒ)Ð)Ð)Ð)Ý˜œ˜qœ	‘?”? q cÒ)Ð)Ð)Ð)Ø—6’6‘8”8˜q’=�=�=�=�=à”6”< !¤'Ñ)¨i¸Ð-CÒCÐCÐCÐCÝ˜˜!œ‘:”: ! Q Ò'Ð'Ð'Ð'Ý˜˜!œ‘:”: ! Q Ò'Ð'Ð'Ð'Ø—6’6‘8”8˜q’=�=�=�=Ø�xŠx˜‰{Œ{˜aÒÐÐÐÝŒ•h ¤¨sÑ3Ô3Ð3ÝŒ•h ¤¨sÑ3Ô3Ð3Ð3Ð3r   c                 óH  — g d¢}|                       |¦  «        }|                      | j        |¬¦  «        }| j        j        |j        k    sJ ‚|                     ¦   «         r…|j        dhk    sJ ‚t          |d         ¦  «        g k    sJ ‚t          |j        d         ¦  «        dgk    sJ ‚t          |j        d         ¦  «        g k    sJ ‚|                     ¦   «         dk    sJ ‚nE|j        ddhk    sJ ‚|                     ¦   «         dk    sJ ‚t          |d         ¦  «        dgk    sJ ‚| 	                    d¦  «        dk    sJ ‚t          |d         ¦  «        dgk    sJ ‚t          j        t          |j        d¦  «         t          j        t          |j        d	¦  «         d S )
Nrt   r;   rm   r   r   r    rw   r>   r9   )rI   r%   r   r&   r(   r'   r)   r@   r1   r/   r+   r,   r-   r.   rJ   s       r   rM   z#TestMultiGraphView.test_shown_edges©   s•  € ØEÐEÐEˆ
Ø×.Ò.¨zÑ:Ô:ˆØ�JŠJ�t”v¨=ˆJÑ9Ô9ˆØŒvŒ|˜qœwÒ&Ð&Ð&Ð&Ø�=Š=‰?Œ?ð 		%Ø”7˜y˜kÒ)Ð)Ð)Ð)Ý˜˜!œ‘:”: Ò#Ð#Ð#Ð#Ý˜œ˜qœ	‘?”? q cÒ)Ð)Ð)Ð)Ý˜œ˜qœ	‘?”? bÒ(Ð(Ð(Ð(Ø—6’6‘8”8˜q’=�=�=�=�=à”7˜y¨)Ð4Ò4Ð4Ð4Ð4Ø—6’6‘8”8˜q’=�=�=�=Ý˜˜!œ‘:”: ! Ò$Ð$Ð$Ð$Ø�xŠx˜‰{Œ{˜aÒÐÐÐÝ�A�a”D‰zŒz˜a˜SÒ Ð Ð Ð ÝŒ•h ¤¨sÑ3Ô3Ð3ÝŒ•h ¤¨sÑ3Ô3Ð3Ð3Ð3r   N)rN   rO   rP   rQ   r   rR   r%   Ú
MultiGraphr   r#   Úhide_multiedgesr?   Úshow_multiedgesrI   rT   r   rC   rM   rU   r   r   rk   rk   ‡   s‘   € € € € € ØˆL˜Ô)Ñ*Ô*€EØŒM€EØ$˜ R¤ZÔ%?Ñ@Ô@ÐØ$˜ R¤ZÔ%?Ñ@Ô@ÐàðHð Hñ „[ðHð4ð 4ð 4ð*4ð 4ð 4ð 4ð 4r   rk   c                   ó¦   — e Zd Z eej        ¦  «        Zej        Z eej	        j
        ¦  «        Z eej	        j        ¦  «        Zg d¢Zh d£Zd„ ZdS )ÚTestMultiDiGraphView)©r   r   r   ru   rv   >   r~   rn   ro   rp   c                 ó�  — |                       | j        ¦  «        }g d¢}t          j                             |¦  «        }|                      | j        ||¬¦  «        }|                     d¦  «        dk    sJ ‚|                     d¦  «        dk    sJ ‚| 	                    d¦  «        dk    sJ ‚| 
                    ¦   «         dk    sJ ‚d S )Nr   rY   r   r   r    r   rb   r]   s        r   re   z&TestMultiDiGraphView.test_inout_degreeÇ   rf   r   N)rN   rO   rP   rQ   r   rR   r%   ÚMultiDiGraphr   r#   Úhide_multidiedgesr?   Úshow_multidiedgesrI   rA   r[   re   rU   r   r   r}   r}   ¿   s|   € € € € € ØˆL˜Ô)Ñ*Ô*€EØŒO€EØ$˜ R¤ZÔ%AÑBÔBÐØ$˜ R¤ZÔ%AÑBÔBÐØ6Ð6Ð6€JØ;Ð;Ð;€Hð	ð 	ð 	ð 	ð 	r   r}   c                   ó<   — e Zd Zed„ ¦   «         Zd„ Zd„ Zd„ Zd„ ZdS )ÚTestInducedSubGraphc                 ó   — t          j        d¦  «        x| _        }g |j        d<   g |j        d         d<   |                     dd¦  «         g }|                     dd|¬¦  «         |                     dd|¬¦  «         d S )Nr   Úfoor   r    r   )r†   )r   Úcomplete_graphÚK3r   r&   Úremove_edgeÚadd_edge)r   r   Úlls      r   r   zTestInducedSubGraph.setup_classÕ   sƒ   € åÔ& qÑ)Ô)Ð)ˆŒ�ØˆŒ�‰ØˆŒ�Œ
�5ÑØ	�Š�a˜ÑÔÐØˆØ	�
Š
�1�a˜Rˆ
Ñ Ô Ð Ø	�
Š
�1�a˜Rˆ
Ñ Ô Ð Ð Ð r   c                 ó¾   — | j         }t          j        |g d¢¦  «        }|j        |j        k    sJ ‚|                      ||¦  «         |                      ||¦  «         d S )N)r   r    r   r   )rˆ   r   rF   ÚnameÚgraphs_equalÚsame_attrdict©r2   r   ÚHs      r   Útest_full_graphz#TestInducedSubGraph.test_full_graphß   sf   € ØŒGˆÝÔ  < < <Ñ0Ô0ˆØŒv˜œÒÐÐÐØ×Ò˜!˜QÑÔÐØ×Ò˜1˜aÑ Ô Ð Ð Ð r   c                 ó  — | j         }t          j        |d¦  «        }t          |j        ¦  «        di ik    sJ ‚t          |j        ¦  «        di ik    sJ ‚t          j        |ddg¦  «        }t          |j        ¦  «        di idi idœk    sJ ‚d S )Nr   r    ©r   r    )rˆ   r   rF   ÚdictÚadjr�   s      r   Útest_partial_subgraphz)TestInducedSubGraph.test_partial_subgraphæ   sš   € ØŒGˆÝÔ  1Ñ%Ô%ˆÝ�A”E‰{Œ{˜q "˜gÒ%Ð%Ð%Ð%Ý�A”E‰{Œ{˜q "˜gÒ%Ð%Ð%Ð%åÔ  A q 6Ñ*Ô*ˆÝ�A”E‰{Œ{ 1 b '¨q°"¨gÐ6Ð6Ò6Ð6Ð6Ð6Ð6Ð6r   c                 ód  — |d         d         d         }d|j         d         d<   |j         |j         k    sJ ‚||j         d         d<   |j         |j         k    sJ ‚|j        d         d         }d|j        d         d<   |j        |j        k    sJ ‚||j        d         d<   |j        |j        k    sJ ‚d S )Nr    r   r†   Úbaz)r    r   r   )r'   r&   )r2   r‘   r   Úold_foos       r   r�   z!TestInducedSubGraph.same_attrdictï   s½   € Ø�A”$�q”'˜%”.ˆØ$ˆŒ�Œ�eÑØŒw˜!œ'Ò!Ð!Ð!Ð!Ø&ˆŒ�Œ�eÑØŒw˜!œ'Ò!Ð!Ð!Ð!Ø”'˜!”*˜UÔ#ˆØ!ˆŒ�Œ
�5ÑØŒw˜!œ'Ò!Ð!Ð!Ð!Ø#ˆŒ�Œ
�5ÑØŒw˜!œ'Ò!Ð!Ð!Ð!Ð!Ð!r   c                 ó"  — |j         |j         k    sJ ‚|j        |j        k    sJ ‚|j        |j        k    sJ ‚|j        |j        k    sJ ‚|                     ¦   «         sf|                     ¦   «         sR|j         d         d         |j         d         d         u sJ ‚|j         d         d         |j         d         d         u sJ ‚d S |                     ¦   «         s|j         |_        |j         |_        |                     ¦   «         s|j         |_        |j         |_        |j        |j        k    sJ ‚|j        |j        k    sJ ‚|j        d         d         |j        d         d         u sJ ‚|j        d         d         |j        d         d         u sJ ‚d S )Nr    r   )Ú_adjÚ_noder   r�   r(   Ú_predÚ_succ)r2   r‘   r   s      r   rŽ   z TestInducedSubGraph.graphs_equalû   sƒ  € ØŒv˜œÒÐÐÐØŒw˜!œ'Ò!Ð!Ð!Ð!ØŒw˜!œ'Ò!Ð!Ð!Ð!ØŒv˜œÒÐÐÐØ�}Š}‰Œð 	2 q§}¢}¡¤ð 	2Ø”6˜!”9˜Q”< 1¤6¨!¤9¨Q¤<Ð/Ð/Ð/Ð/Ø”6˜!”9˜Q”< 1¤6¨!¤9¨Q¤<Ð/Ð/Ð/Ð/Ð/Ð/à—=’=‘?”?ð !Øœ&�”Øœ&�”Ø—=’=‘?”?ð !Øœ&�”Øœ&�”Ø”7˜aœgÒ%Ð%Ð%Ð%Ø”7˜aœgÒ%Ð%Ð%Ð%Ø”7˜1”:˜a”= A¤G¨A¤J¨q¤MÐ1Ð1Ð1Ð1Ø”7˜1”:˜a”= A¤G¨A¤J¨q¤MÐ1Ð1Ð1Ð1Ð1Ð1r   N)	rN   rO   rP   rT   r   r’   r—   r�   rŽ   rU   r   r   r„   r„   Ô   si   € € € € € Øð!ð !ñ „[ð!ð!ð !ð !ð7ð 7ð 7ð
"ð 
"ð 
"ð2ð 2ð 2ð 2ð 2r   r„   c                   ó´   — e Zd Zed„ ¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d„ Zd	„ Zej                             d
ej        ej        f¦  «        d„ ¦   «         ZdS )ÚTestEdgeSubGraphc                 ó  — t          j        d¦  «        x| _        }t          d¦  «        D ]}d|› �|j        |         d<   Œd|j        d         d<   d|j        d         d<   d|j        d<   t          j        |ddg¦  «        | _        d S )	Nr   Únoder�   Úedge01r”   Úedge34r
   r   )	r   r   r   Úranger&   r'   r   rL   r‘   )r   r   Úis      r   r   zTestEdgeSubGraph.setup_class  s�   € õ ”M !Ñ$Ô$Ð$ˆŒ�å�q‘”ð 	,ð 	,ˆAØ!+¨  ˆAŒG�AŒJ�vÑÐØ (ˆŒ�Œ�fÑØ (ˆŒ�Œ�fÑØ!ˆŒ�‰åÔ   V¨VÐ$4Ñ5Ô5ˆŒˆˆr   c                 ón   — g d¢t          | j        j                             d¦  «        ¦  «        k    sJ ‚dS )z.Tests that the subgraph has the correct nodes.))r   Únode0)r    Únode1)r   Únode3)r   Únode4r�   N)Úsortedr‘   r&   Údata©r2   s    r   Útest_correct_nodesz#TestEdgeSubGraph.test_correct_nodes  sL   € àGÐGÐGÍ6ØŒFŒL×Ò˜fÑ%Ô%ñL
ô L
ò 
ð 
ð 
ð 
ð 
ð 
r   c                 óh   — t          ddg| j        j                             d¦  «        ¦  «        sJ ‚dS )z.Tests that the subgraph has the correct edges.)r   r    r¤   )r   r   r¥   r�   N)r   r‘   r'   r®   r¯   s    r   Útest_correct_edgesz#TestEdgeSubGraph.test_correct_edges%  sE   € åØÐ/Ð0°$´&´,×2CÒ2CÀFÑ2KÔ2Kñ
ô 
ð 	
ð 	
ð 
ð 	
ð 	
r   c                 ó°   — | j                              d¦  «         g d¢t          | j        j        ¦  «        k    sJ ‚| j                              d¦  «         dS )zkTests that adding a node to the original graph does not
        affect the nodes of the subgraph.

        r   )r   r    r   r   N)r   Úadd_noder­   r‘   r&   Úremove_noder¯   s    r   Útest_add_nodezTestEdgeSubGraph.test_add_node+  sU   € ð
 	Œ�Š˜ÑÔÐØˆ|ˆ|�v d¤f¤lÑ3Ô3Ò3Ð3Ð3Ð3ØŒ×Ò˜1ÑÔÐÐÐr   c                 óî   — | j                              d¦  «         g d¢t          | j        j        ¦  «        k    sJ ‚| j                              dd¬¦  «         | j                              ddd¬¦  «         dS )zeTests that removing a node in the original graph
        removes the nodes of the subgraph.

        r   )r    r   r   r©   )r�   r    r¤   N)r   rµ   r­   r‘   r&   r´   rŠ   r¯   s    r   Útest_remove_nodez!TestEdgeSubGraph.test_remove_node4  ss   € ð
 	Œ×Ò˜1ÑÔÐØˆyˆy�F 4¤6¤<Ñ0Ô0Ò0Ð0Ð0Ð0ØŒ�Š˜ ˆÑ(Ô(Ð(ØŒ�Š˜˜1 8ˆÑ,Ô,Ð,Ð,Ð,r   c                 ó²  — | j         D ]*}| j        j        |         | j         j        |         k    sJ ‚Œ+d| j        j        d         d<   | j        j        d         | j         j        d         k    sJ ‚d| j         j        d         d<   | j        j        d         | j         j        d         k    sJ ‚d| j        j        d         d<   d| j         j        d         d<   dS )	z`Tests that the node attribute dictionary of the two graphs is
        the same object.

        r†   r   r�   Úbarr    r©   rª   N)r‘   r   r&   )r2   Úvs     r   Útest_node_attr_dictz$TestEdgeSubGraph.test_node_attr_dict>  sÉ   € ð
 ”ð 	6ð 	6ˆAØ”6”< ”? d¤f¤l°1¤oÒ5Ð5Ð5Ð5Ð5à"'ˆŒŒ�QŒ˜ÑØŒvŒ|˜AŒ $¤&¤,¨q¤/Ò1Ð1Ð1Ð1Ø"'ˆŒŒ�QŒ˜ÑØŒvŒ|˜AŒ $¤&¤,¨q¤/Ò1Ð1Ð1Ð1à")ˆŒŒ�QŒ˜ÑØ")ˆŒŒ�QŒ˜ÑÐÐr   c                 ó  — | j                              ¦   «         D ]1\  }}| j        j        ||f         | j         j        ||f         k    sJ ‚Œ2d| j        j        d         d<   | j        j        d         d         | j         j        d         d         k    sJ ‚d| j         j        d         d<   | j        j        d         d         | j         j        d         d         k    sJ ‚d| j        j        d         d<   d| j         j        d         d<   dS )	z`Tests that the edge attribute dictionary of the two graphs is
        the same object.

        r†   r”   r�   rº   r
   r¤   r¥   N)r‘   r'   r   )r2   Úur»   s      r   Útest_edge_attr_dictz$TestEdgeSubGraph.test_edge_attr_dictN  sû   € ð
 ”F—L’L‘N”Nð 	<ð 	<‰DˆAˆqØ”6”<  1 Ô%¨¬¬°a¸°dÔ);Ò;Ð;Ð;Ð;Ð;à%*ˆŒŒ�TÔ˜6Ñ"ØŒvŒ|˜DÔ! &Ô)¨T¬V¬\¸$Ô-?ÀÔ-GÒGÐGÐGÐGØ%*ˆŒŒ�TÔ˜6Ñ"ØŒvŒ|˜DÔ! &Ô)¨T¬V¬\¸$Ô-?ÀÔ-GÒGÐGÐGÐGà%-ˆŒŒ�TÔ˜6Ñ"Ø%-ˆŒŒ�TÔ˜6Ñ"Ð"Ð"r   c                 ó:   — | j         j        | j        j        u sJ ‚dS )zaTests that the graph attribute dictionary of the two graphs
        is the same object.

        N)r   r   r‘   r¯   s    r   Útest_graph_attr_dictz%TestEdgeSubGraph.test_graph_attr_dict^  s#   € ð
 ŒvŒ|˜tœvœ|Ð+Ð+Ð+Ð+Ð+Ð+r   c                 óZ  — t          j        t          j        | j        j        d¦  «         t          j        t          j        | j        j        d¦  «         t          j        t          j        | j        j        dd¦  «         t          j        t          j        | j        j        dd¦  «         dS )z9Tests that the subgraph cannot change the graph structurer   r   r   r    N)	r+   r,   r   ÚNetworkXErrorr‘   r´   rµ   rŠ   r‰   r¯   s    r   Útest_readonlyzTestEdgeSubGraph.test_readonlye  sz   € åŒ•bÔ&¨¬¬¸Ñ;Ô;Ð;ÝŒ•bÔ&¨¬Ô(:¸AÑ>Ô>Ð>ÝŒ•bÔ&¨¬¬¸¸AÑ>Ô>Ð>ÝŒ•bÔ&¨¬Ô(:¸A¸qÑAÔAÐAÐAÐAr   Ú
multigraphc                 ó–   —  |g d¢¦  «        }t          j        |ddg¦  «        }d|d         vsJ ‚|                     dd¦  «        rJ ‚dS )zaCheck edge visibility in FilterMultiInner on edge_subgraph's of
        multigraphs. See gh-7724.))ÚaÚb)rÇ   Úc)rÉ   rÈ   )rÇ   rÈ   r   )rÉ   rÈ   r   rÉ   rÇ   N)r   rL   Úhas_edge)r2   rÅ   r   r‘   s       r   Útest_multigraph_filtered_edgesz/TestEdgeSubGraph.test_multigraph_filtered_edgesl  sf   € ð ˆJÐ;Ð;Ð;Ñ<Ô<ˆÝÔ˜Q °Ð >Ñ?Ô?ˆØ˜!˜Cœ&Ð Ð Ð Ð Ø—:’:˜c 3Ñ'Ô'Ð'Ð'Ð'Ð'Ð'r   N)rN   rO   rP   rT   r   r°   r²   r¶   r¸   r¼   r¿   rÁ   rÄ   r+   ÚmarkÚparametrizer   ry   r€   rË   rU   r   r   r¡   r¡     sà   € € € € € Øð
6ð 
6ñ „[ð
6ð
ð 
ð 
ð
ð 
ð 
ðð ð ð-ð -ð -ð*ð *ð *ð .ð .ð .ð ,ð ,ð ,ðBð Bð Bð „[×Ò˜\¨B¬M¸2¼?Ð+KÑLÔLð(ð (ñ MÔLð(ð (ð (r   r¡   )r+   Únetworkxr   Únetworkx.utilsr   r   rW   rk   r}   r„   r¡   rU   r   r   ú<module>rÐ      sH  ðØ €€€à Ð Ð Ð Ø &Ð &Ð &Ð &Ð &Ð &ðV ð V ð V ð V ð V ñ V ô V ð V ðr#ð #ð #ð #ð #Ð)ñ #ô #ð #ðN44ð 44ð 44ð 44ð 44Ð)ñ 44ô 44ð 44ðpð ð ð ð Ð-Ð/Añ ô ð ð*92ð 92ð 92ð 92ð 92ñ 92ô 92ð 92ðzb(ð b(ð b(ð b(ð b(ñ b(ô b(ð b(ð b(ð b(r   