+
    )i)                        R t ^ RIt^ RIt^ RIt^ RIt^ RIt]P                  ! R4      t]P                  ! R4      t	]P                  R4       ]P                  ! R4      tR]P                  R&   ]P                  ! ^^4      t/ RRbR	R
bRRbRRbRR^RRRRRRRRRRRRRRRRRR/
bRR bR!RbR"RbR#R$bR%R
bR&RbR'RbR(R^RRRRRRRRRR)R*R+RR,R/RRRRR-R.R/R
/
bR0R1bR2RbR3R1bR4^ bR5R6R7^ R8^ /Ct]P                   P#                  RRR]R,          3RR34      R; 4       t]P                   P#                  RR4      R< 4       tR= tR> t]P                   P#                  RR4      ]P                   P#                  RB]P,                  ]P.                  34      RC 4       4       t]P                   P#                  RB]P,                  ]P.                  34      RD 4       t]P                   P#                  RB]P,                  ]P.                  34      RE 4       tRF t]P                   P#                  RB]P,                  ]P.                  34      RG 4       t]P                   P#                  RB]P,                  ]P.                  34      RH 4       t]P                   P#                  RR]R&,          ]R&,          .3^^^.3RI^^
.334      ]P                   P#                  RB]P,                  ]P.                  34      RJ 4       4       t]P                   P#                  RR]R0,          ]R0,          .3RKRKRK.3RLR1RK.334      ]P                   P#                  RB]P,                  ]P.                  34      RM 4       4       tRN t RO t!RP t"RQ t#RR t$RS t%]P                   P#                  RR4      RT 4       t&]P                   P#                  RURR
.4      RV 4       t'RW t(RX t)]PT                  RY 4       t+]P                   P#                  RZ]PX                  ]PZ                  ]P\                  ]P^                  ]P`                  ]Pb                  ]Pd                  ]Pf                  .4      R[ 4       t4R\ t5R] t6R^ t7R_ t8R` t9]P                   P#                  RRRR?.R93RR.R@3RR.R:3RRa.RA33	4      ]P                   P#                  RbRR.34      Rc 4       4       t:]P                   P#                  RRRR?.R93RR.R@3RR.R:3RRa.RA33	4      ]P                   P#                  RbRR.34      Rd 4       4       t;Re t<Rf t=Rg t>Rh t?Ri t@]P                   P#                  RB]P,                  ]P.                  34      Rj 4       tA]P                   P#                  RR^.^334      Rk 4       tB]P                   P#                  RR^.^334      Rl 4       tC]P                   P#                  Rb. RORRR.34      Rm 4       tDRn tERo tF]P                   P#                  RLR4      Rr 4       tG]P                   P#                  RsRp.Rq.R.. RORqR1.. RO34      Rt 4       tHRu tIRv tJRw tKRx tLRy tMRz tNR{ tOR| tPR} tQR~ tRR tSR tT]P                   P#                  R^. RO34      R 4       tU]P                   P#                  RR. RO34      R 4       tVR tWR tXR tY]P                   P#                  RR4      R 4       tZ]P                   P#                  RR4      R 4       t[R t\R t]R t^R t_]P                   P#                  R]P                  ]P                  34      R 4       tb]P                   P#                  R]P                  ]P                  34      R 4       tcR td]P                   P#                  R]P.                  ! 4       ^.]P                  ! 4       ^.]P                  ! 4       ^.34      R 4       tg]P                   P#                  R]P.                  ! 4       ^.]P                  ! 4       ^.]P                  ! 4       ^.34      R 4       thR tiR tjR tk]P                   P#                  RRR1/R^/RR/R^
/R^
/34      R 4       tl]P                   P#                  R]P                  ]PX                  34      R 4       tm]P                   P#                  RRR
.4      ]P                   P#                  R]P                  ]P                  ]P                  ]P                  ]P                  .4      R 4       4       tr]P                   P#                  RL. RO4      R 4       ts]P                   P#                  RRR.4      R 4       ttR# )z,Unit tests for matplotlib drawing functions.N
matplotlibnumpyPSzmatplotlib.pyplotFztext.usetexnode_posnode_visibleT
node_colorz#1f78b4	node_sizei,  
node_labelsizecolorz#000000familyz
sans-serifweightnormalalpha      ?background_colorbackground_alphah_aligncenterv_alignbbox
node_shapeo
node_alphanode_border_widthnode_border_colorfaceedge_visible
edge_width
edge_color
edge_labelboxstyleroundecfcpos      ?rotate
edge_style-
edge_alphaedge_arrowstyleedge_arrowsizeedge_curvaturearc3edge_source_marginedge_target_marginredlimec                    \         P                  ! ^4      p\         P                  ! VRR4       \        P	                  4       P                  ^o4      p\         P                  ! V3RV/W/B  \        P                  P                  VP                  4       ^ ,          P                  4       ^ ,          V4      '       g   Q h\        P                  4        R# )   z#00FF00r   canvasN)nx
path_graphset_node_attributespltfigureadd_subplotdisplaymplcolors
same_colorget_childrenget_edgecolorsclose)
param_nameparam_valueexpectedGr5   s   &&&  _/var/www/html/photoedit/myenv/lib/python3.14/site-packages/networkx/drawing/tests/test_pylab.py$test_display_arg_handling_node_colorrH   C   s     	aA1i1ZZ\%%c*FJJq==J#<=::  !4!4!6q!9!H!H!J1!MxXXXXIIK    c           
         \         P                  ! ^4      p\         P                  ! Y"P                  4        Uu/ uF  q3^V^,           ,          bK  	  upR4       \        P                  4       P                  ^o4      p\         P                  ! W$V R7       \        VP                  4       ^ ,          P                  4       R,          V8H  4      '       g   Q h\        P                  4        R# u upi )r4   n_alpha)r5   r   N)NNN   )r6   r7   r8   nodesr9   r:   r;   r<   allr@   get_fcrB   )rD   rE   rF   nr5   s   &&   rG   $test_display_arg_handling_node_alpharR   T   s     	aA1wwyAy!!q1u+~yA9MZZ\%%c*FJJqK8a '')$/8;    IIK Bs   C+
c            	         \         P                  ! ^4      p \         P                  ! Y P                  4        Uu/ uF  qW3bK  	  upR4       \        P                  4       P                  ^o4      p\         P                  ! WRR7       \        P                  VP                  4       ^ ,          P                  4       P                  ^ ^ .^^.^^.^^..8H  4      '       g   Q h\        P                  4        R# u upi )r4   r%   )r5   r   N)r6   r7   r8   rN   r9   r:   r;   r<   nprO   r@   get_offsetsdatarB   )rF   rQ   r5   s      rG   test_display_node_positionrW   g   s    
aA1'')<)Q1&y)<eDZZ\%%c*FJJq%066a ,,.33AAAQRTUPV7WW    IIK =s   C7
c            
         \         P                  ! 4       p \         P                  ! Y P                  4        UUu/ uF   w  rW3W,           ^,          '       d   RMRbK"  	  uppR4       \        P                  4       P                  ^o4      p\         P                  ! W^
R7       VP                  4        Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  up^ ,          p\        VP                  4       4      \        V P                  4        UUu. uF  w  rW,           ^,          '       g   K  ^NK   	  upp4      8X  g   Q h\        P!                  4        R# u uppi u upi u uppi )   -|>r)   
arrowstyle)r5   r,   N)r6   karate_club_graphset_edge_attributesedgesr9   r:   r;   r<   r@   
isinstancer=   collectionsLineCollectionlen	get_pathssumrB   )rF   uvr5   llcs         rG   test_display_line_collectionri   r   s   
A	ggiHidaQFaeq[[Ec1iH, ZZ\%%c*FJJq3 $$&
&Aa778 	
&
 	
	B
 r||~#QWWY&NYTQ15A++qqY&N"OOOOIIK I


 'Os   &E.5,E4&E4&E9E9ryellowblue
graph_typec                 8  a \         P                  ! ^VR7      p\         P                  ! VRR4       \        P	                  4       P                  ^o4      p\         P                  ! W0VR7       VP                  4       '       d[   VP                  4        Uu. uF?  p\        V\        P                  P                  4      '       g   K/  VP                  4       NKA  	  ppM]VP                   Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  up^ ,          P!                  4       p\"        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g   Q h\        P%                  4        R# u upi u upi )	rM   create_using#0000FFr   )r   r5   c              3   d   <"   T F%  p\         P                  P                  VS4      x  K'  	  R # 5iN)r=   r>   r?   ).0crE   s   & rG   	<genexpr>1test_display_edge_single_color.<locals>.<genexpr>   s%     B6aszz$$Q116s   -0FTN)r6   r7   r]   r9   r:   r;   r<   is_directedr@   r_   r=   patchesFancyArrowPatchrP   r`   ra   
get_colorsrO   rB   )r   rE   rm   rF   r5   fr>   rg   s   &f&     rG   test_display_edge_single_colorr}      s,    	aj1A1i1ZZ\%%c*FJJq7}} ((*
*!S[[889 AHHJ* 	 
 ''
'!S__;;< A'
 	 Z\	 	
 3B6B333B6BBBBBIIK

s   ,FF+,FFc                    \         P                  ! ^V R7      p\         P                  ! VRRR	R
/R4       \        P	                  4       P                  ^o4      p\         P                  ! WR7       RR.pVP                  4       '       d[   VP                  4        Uu. uF?  p\        V\        P                  P                  4      '       g   K/  VP                  4       NKA  	  ppM]VP                   Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  up^ ,          P!                  4       p\        P"                  P%                  WS4      '       g   Q h\        P'                  4        R# u upi u upi )rM   ro   #FF0000r   r5   r1   rl   N       r   rY   r   r   r   )r6   r7   r]   r9   r:   r;   r<   rx   r@   r_   r=   ry   rz   rP   r`   ra   r{   r>   r?   rB   )rm   rF   axrE   r|   r>   rg   s   &      rG   !test_display_edge_multiple_colorsr      s    
aj1A1vy&)DgN		!	!#	&BJJqvH}} __&
&!S[[889 AHHJ& 	 
 ~~
%!As7U7U)VAA~

Z\ 	 ::  2222IIK

s   ,E=E=1,F"Fc           	         \         P                  ! ^V R7      p\         P                  ! YP                  4        Uu/ uF  q"W"3bK  	  upR4       \        P                  4       P                  ^o4      p\         P                  ! WR7       VP                  4       '       d   VP                  4        Uu. uFq  p\        V\        P                  P                  4      '       g   K/  VP                  4       P                  R,          VP                  4       P                  R,          3NKs  	  ppMVP                    Uu. uF1  p\        V\        P                   P"                  4      '       g   K/  VNK3  	  up^ ,          pVP%                  4        Uu. uF(  qP                  R,          VP                  R,          3NK*  	  ppR	R
.p	Rp
\'        WY4       FY  w  rVw  rVw  pp\)        \+        W,
          4      W38  4      '       d(   \)        \+        VV,
          4      W38  4      '       d   KY  Q h	  \        P-                  4        R# u upi u upi u upi u upi )rM   ro   r%   r   g?N)r   rL   )rL   )rL   )r   r   r   r   )r   rY   rY   )r6   r7   r8   rN   r9   r:   r;   r<   rx   r@   r_   r=   ry   rz   get_pathverticesr`   ra   rc   ziprO   absrB   )rm   rF   rQ   r   r|   
end_pointsrg   line_collectionprE   	thresholdae	act_startact_end	exp_startexp_ends   &                rG   test_display_edge_positionr      s   
aj1A1'')<)Q1&y)<eD		!	!#	&BJJq}} __&
&!S[[889 HQZZ\""4(!**,*?*?*FG& 	 

 ~~
%!As7U7U)VAA~

 <K;T;T;V
;VaZZqzz%01;V 	 
 !"23H IJ)		73y,-0FFGGC'!"i%;;M
 M
 	
 
 * IIK5 =


s$   I 
1,I"AI9,I
*I
.Ic                  *   \         P                  ! 4       p R  pV! V 4      p\        P                  4       P	                  ^o4      p\         P
                  ! WVR7       \        V P                  4       VP                  4       ^ ,          P                  4       P                  4       UUu/ uF  w  rEV\        V4      bK  	  pppV P                  4        F%  p\        W$,          Wd,          8H  4      '       d   K%  Q h	  \        P                  4        R# u uppi )c                 2    \         P                  ! V R R7      # )i/ seed)r6   spring_layoutrF   s   &rG   fixed_layout4test_display_position_function.<locals>.fixed_layout   s    //rI   )r   r5   N)r6   r\   r9   r:   r;   r<   r   rN   r@   rU   rV   tuplerO   rB   )rF   r   r%   r   rQ   r   act_poss          rG   test_display_position_functionr      s    
A0 q/C		!	!#	&BJJq3 !$AGGIr/@/C/O/O/Q/V/V W W58 W   WWY36WZ'(((( IIKs   &Dc                 .   \         P                  ! ^V R7      p\         P                  ! VR
^ R^/R4       \        P                  R,          p\         P
                  ! VRRVRR7       \        P                  4       P                  ^o4      p\         P                  ! WR7       \        P                  P                  VR7      pVP                  ^ ^4       VP                  ^ 4      VP                  ^4      .pVP                  4       '       d[   VP                  4        Uu. uF?  p\!        V\        P"                  P$                  4      '       g   K/  VP'                  4       NKA  	  ppM]VP(                   Uu. uF1  p\!        V\        P(                  P*                  4      '       g   K/  VNK3  	  up^ ,          P-                  4       p\        P.                  P1                  V^ ,          VP2                  R
,          R,          4      '       g   Q h\        P.                  P1                  V^,          VP2                  R,          R,          4      '       g   Q h\        P.                  P1                  WW4      '       g   Q h\        P5                  4        R	# u upi u upi )rM   ro   r   plasmar   F)rN   r   cmapNr   r   )r6   r7   r]   r=   	colormapsapply_matplotlib_colorsr9   r:   r;   r<   cmScalarMappableset_climto_rgbarx   r@   r_   ry   rz   get_facecolorr`   ra   r{   r>   r?   r^   rB   )	rm   rF   r   r5   mapperrE   r|   r>   rg   s	   &        rG   test_display_edge_colormapsr      s   
aj1A1vq&!4h?=="Dq(GTGZZ\%%c*FJJq VV"""-F
OOAqq!6>>!#45H}} ((*
*!S[[889 AOO* 	 
 ''
'!S__;;< A'
 	 Z\	 	
 ::  !aggdmG.DEEEE::  !aggdmG.DEEEE::  2222IIK

s   ,JJ3,J$Jc           	         \         P                  ! ^V R7      p\         P                  ! V^ ^ ^R^^/R4       \        P                  R,          p\         P
                  ! VRRV4       \        P                  4       P                  ^o4      p\         P                  ! WR7       \        P                  P                  VR7      pVP                  ^ ^4       VP                  ^ 4      VP                  R4      VP                  ^4      .pVP                   Uu. uF1  p\        V\        P                  P                   4      '       g   K/  VNK3  	  up^ ,          P#                  4       p\        P$                  P'                  V^ ,          VP(                  ^ ,          R,          4      '       g   Q h\        P$                  P'                  V^,          VP(                  ^,          R,          4      '       g   Q h\        P$                  P'                  V^,          VP(                  ^,          R,          4      '       g   Q h\        P$                  P'                  WW4      '       g   Q h\        P+                  4        R# u upi )	rM   ro   r&   r   r   r   r   r   N)r6   r7   r8   r=   r   r   r9   r:   r;   r<   r   r   r   r   r`   r_   PathCollectionrA   r>   r?   rN   rB   )rm   rF   r   r5   r   rE   sr>   s   &       rG   test_display_node_colormapsr     s   
aj1A1q!QQ2H==="Dq(GT:ZZ\%%c*FJJq VV"""-F
OOAqq!6>>##6q8IJH%%%aAs7U7U)V%			  ::  !aggaj.ABBBB::  !aggaj.ABBBB::  !aggaj.ABBBB::  2222IIKs   ,I4I4widthc           	         \         P                  ! ^VR7      p\         P                  ! VR^R^
/R4       \        P	                  4       P                  ^o4      p\         P                  ! W0VR7       VP                  4       '       d[   VP                  4        Uu. uF?  p\        V\        P                  P                  4      '       g   K/  VP                  4       NKA  	  ppMf\        VP                   Uu. uF1  p\        V\        P                  P                   4      '       g   K/  VNK3  	  up^ ,          P#                  4       4      pWa8X  g   Q hR# u upi u upi )rM   ro   r   )r   r5   Nr   r   )r6   r7   r]   r9   r:   r;   r<   rx   r@   r_   r=   ry   rz   get_linewidthlistr`   ra   get_linewidths)rD   rE   rm   rF   r5   r|   widthsrg   s   &&&     rG   test_display_edge_widthr     s    	aj1A1vq&"5w?ZZ\%%c*FJJq8}} ((*
*!S[[889 AOO* 	 
   +++Aa!?!?@ + 	  !
 
s   ,E	E3,E$E:stylec           	      V   \         P                  ! ^VR7      p\         P                  ! VRRRR/R4       \        P	                  4       P                  ^o4      p\         P                  ! W0VR7       VP                  4       '       d[   VP                  4        Uu. uF?  p\        V\        P                  P                  4      '       g   K/  VP                  4       NKA  	  ppMR	RR
R/pVP                   Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  up^ ,          P!                  4        U	u. uF1  p	Yy^ ,          V	^,          e   \#        V	^,          4      MR3,          NK3  	  pp	Wa8X  g   Q h\        P%                  4        R# u upi u upi u up	i )rM   ro   r)   r   r   )r(   r5   Nr   r   )r   N)r   )r   gffffff?)r6   r7   r]   r9   r:   r;   r<   rx   r@   r_   r=   ry   rz   get_linestyler`   ra   get_linestylesr   rB   )
rD   rE   rm   rF   r5   r|   styles
linestylesrg   r   s
   &&&       rG   test_display_edge_styler   <  ss    	aj1A1vsFC8'BZZ\%%c*FJJq8}} ((*
*!S[[889 AOO* 	 
  nc:

  +++Aa!?!?@ + 	  !	"
" !QqT-=eAaDk4HII" 	 
 IIK#

s   ,F	F4,F!%F!7F&c                  (   \         P                  ! ^4      p \        P                  4       P	                  ^o4      p\         P
                  ! WR^/R7       VP                  4        Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  pp\        V P                  4       V4       F<  w  rEVP                  4       \        V4      8X  g   Q hVP                  4       R8X  d   K<  Q h	  \        P!                  4        R# u upi )r4   r
   )r5   r	   g      4@N)r6   r7   r9   r:   r;   r<   r@   r_   r=   textTextr   rN   get_textstrget_sizerB   )rF   r5   tlabelsrQ   rg   s         rG   test_display_node_labelsr   _  s    
aAZZ\%%c*FJJqVRL9,,.O.A*Q2Naa.FOAGGIv&zz|s1v%%%zz|t### ' IIK	 Ps   &,DDc                     \         P                  ! ^4      p \        P                  4       P	                  ^o4      p\         P
                  ! Y P                  4        UUu/ uF  w  r#W#3RW#,           /bK  	  upp4       \         P                  ! WRR/RR7       VP                  4        Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  pp\        V4       \        V P                  4       V4       FQ  w  rgVP                  4       \!        V^ ,          V^,          ,           4      8X  g   Q hVP#                  4       R8X  d   KQ  Q h	  \        P%                  4        R# u uppi u upi )r4   labelr   rj   N)r5   r    r	   )r6   r7   r9   r:   r;   r]   r^   r<   r@   r_   r=   r   r   printr   r   r   	get_colorrB   )rF   r5   re   rf   r   r   r   rg   s           rG   test_display_edge_labelsr   j  s   
aAZZ\%%c*F 1GGINIDAv'77INOJJqWcNtL,,.O.A*Q2Naa.FO	&MAGGIv&zz|s1Q4!A$;////{{}### ' IIK OOs   E2),E8E8c                     \         P                  ! 4       p V P                  . RO4       V P                  . R	O4       \         P                  ! Y P                  RR7       Uu/ uF  qRR\        V^,          4      ,           2bK!  	  upR4       \        P                  4       P                  ^o4      p\         P                  ! WR7       VP                  4        Uu. uFI  p\        V\        P                  P                  4      '       g   K/  VP!                  4       P"                  NKK  	  ppV. R
O8X  g   Q h\        P%                  4        R# u upi u upi )AT)keysz	arc3,rad=皙?	curvaturer   N)r   BCD))r   r   0)r   r   1)r   r   -1)r   r   r   )r   r   r   )r   r   r   )        r   皙ɿr   r   r   )r6   
MultiGraphadd_nodes_fromadd_edges_fromr]   r^   intr9   r:   r;   r<   r@   r_   r=   ry   rz   get_connectionstyleradrB   )rF   r   r5   r|   radss        rG   (test_display_multigraph_non_integer_keysr   y  s   
A)*	
	 	gg4g6HI6H3QqT?+,,6HI; ZZ\%%c*FJJq  $$&&Aa445 	$##& 	 
 3333IIK Js    %E
,E
Ec                     \         P                  ! 4       p \        P                  ! \         P                  4      ;_uu_ 4        \         P
                  ! V R R7       \        P                  4        RRR4       R#   + '       g   i     R# ; i)bad_arg)r   N)r6   r\   pytestraisesNetworkXErrorr<   r9   rB   r   s    rG   test_display_raises_for_bad_argr     sK    
A	r''	(	(


1i(		 
)	(	(	(s   -A99B
	c            
      J   \         P                  ! ^\         P                  R7      p \         P                  ! Y P	                  4        UUu/ uF  w  rW3W,           ^,           ^,          bK  	  uppR4       \
        P                  4       p\         P                  ! WR7       . ROVP                  4        Uu. uF?  p\        V\        P                  P                  4      '       g   K/  VP                  4       NKA  	  up8X  g   Q h\
        P                  4        R# u uppi u upi )r4   ro   	arrowsizer   N)	      1   )r6   r7   DiGraphr]   r^   r9   axesr<   r@   r_   r=   ry   rz   get_mutation_scalerB   )rF   re   rf   r   r|   s        rG   test_display_arrow_sizer     s    
abjj1A	;QFQUQY1$$;[ 
BJJq""Aa445 	"   
 IIK <s   
#D6,D 'D c                    \         P                  ! ^4      p \         P                  ! V ^ R^R^R^R/R4       \         P                  ! Y P                  4        Uu/ uF  qV^8  bK
  	  upR4       \        P
                  ! \         P                  4      ;_uu_ 4        \         P                  ! V 4       RRR4       R# u upi   + '       g   i     R# ; i)zH
This test ensures that a error is raised for incomplete position data.
r%   visibleNr   r   r   )r4   r4   )r6   r7   r8   rN   r   r   r   r<   )rF   rQ   s     rG   %test_display_mismatched_edge_positionr     s     	aA1q&!VQ6JER1;A!a%x;YG 
r''	(	(


1 
)	( < 
)	(	(s   B<
CC	c                   \         P                  4       P                  ^o4      p\        P                  ! R.4      p\        P
                  ! V^ R^R/R4       \        P                  ! W!V R7       VP                  4        Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  up^ ,          pVP                  4       P                  4       R,          p\         P                  4       P                  ^o4      p\        P                  ! VV^d^dV R7       VP                  4        Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  up^ ,          pVP                  4       P                  4       R,          pV^ ,          V^ ,          8  g   Q hV^,          V^,          8  g   Q h\         P                  4        R# u upi u upi )	a  
Test that there is a wider gap between the node and the start of an
incident edge when min_source_margin is specified.

This test checks that the use os min_{source/target}_margin edge
attributes result is shorter (more padding) between the edges and
source and target nodes.


As a crude visual example, let 's' and 't' represent source and target
nodes, respectively:

   Default:
   s-----------------------------t

   With margins:
   s   -----------------------   t

r%   )r5   r   )r5   r/   r0   r   Nr   r   r   :NNrY   r   )r9   r:   r;   r6   r   r8   r<   r@   r_   r=   ry   rz   get_extentscornersrB   )r   r   rF   r|   default_arrowdefault_extentpadded_arrowpadded_extents   &       rG   test_display_edge_marginsr    s   * 
	!	!#	&B


F8A1q&!V4e<JJq
3??$$a
1ckk6Q6Q(R$	M #..088:6BN		!	!#	&BJJ	 ??$$a
1ckk6Q6Q(R$	L !,,.668@M nQ////nQ////IIK-s   ,G!2G!7,G&(G&ticksc           	         \         P                  ! ^4      p\         P                  ! YP                  4        Uu/ uF  q"W"3bK  	  upR4       \        P                  4       p\         P                  ! WR7       VP                  VP                  3 F#  p\        VP                  4       4      V 8w  d   K#  Q h	  \        P                  4        R# u upi )rM   r%   )
hide_ticksN)r6   r7   r8   rN   r9   r   r<   xaxisyaxisboolget_ticklabelsrB   )r  rF   rQ   r   axiss   &    rG   test_display_hide_ticksr    s    
aA1'')<)Q1&y)<eD	BJJq#288$D'')*e333 % IIK =s   C
c                     \         P                  4       p \        P                  ! 4       pVP	                  ^ 4       VP                  ^ ^ 4       \        P                  ! V^ R/R4       \        P                  ! WR7       V P                  4        Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  up^ ,          pVP                  4       p\        VP                  4       \        VP                   4       VP                  ^ 8  d   VP                   ^ 8  g   Q h\         P#                  V 4       \         P%                  4        R# u upi )r   r%   r   Nr   )r9   r   r6   r   add_nodeadd_edger8   r<   r@   r_   r=   ry   rz   r   r   r   heightdelaxesrB   )r   rF   r|   arrowr   s        rG   test_display_self_loopr    s    	B


AJJqMJJq!1q&k51JJq??$$a
1ckk6Q6Q(R$	E D	$**	$++::>dkkAo--KKOIIKs   ,EEc                     \         P                  ! 4       p \         P                  ! V 4       \         P                  ! V R4      / 8X  g   Q hR# )z
If the pos attribute isn't provided or is a function, display computes the layout
and adds it to the graph. We need to ensure that this new attribute is removed from
the returned graph.
z!display's position attribute nameN)r6   r\   r<   get_node_attributesr   s    rG   test_display_remove_pos_attrr    s9     	AJJqM!!!%HIROOOrI   c               #      "   \         P                  4       w  rW3x  \         P                  V4       \         P                  4        R # 5irs   )r9   subplotsr  rB   )figr   s     rG   r  r    s-     llnGC
'MKKOIIKs   AA	functionc                     V \         P                  8X  d   \        P                  ! R RR7       Vw  r4RRR^dR^/pV ! \        3/ VB  VP                  VR,          4       R# )	scipyz draw_kamada_kawai requires scipy)reasonr   blackr   r   test.psN)r6   draw_kamada_kawair   importorskipbarbellsavefig)r  r  tmp_pathr  _optionss   &&&   rG   	test_drawr)     sZ     2'''G,NOFCWk3CGW  KK9$%rI   c                     V w  r#\        \        ^4      4      \        \        ^^
4      4      \        \        ^
^4      4      .p\        P                  ! \        VR7       VP                  VR,          4       R# )r4   )nlistr!  N)r   ranger6   
draw_shellr$  r%  )r  r&  r  r'  r+  s   &&   rG   test_draw_shell_nlistr.  6  sR    FC%(^T%2,/eBm1DEEMM''KK9$%rI   c                     V w  r#\         P                  ! ^^4      p\         P                  ! V4       VP                  VR,          4       R# )rY   r!  N)r6   complete_bipartite_graphdraw_bipartiter%  )r  r&  r  r'  rF   s   &&   rG   test_draw_bipartiter2  =  s:    FC
##Aq)AaKK9$%rI   c                      \        \        P                  4       4      p \        P                  ! \        V ^\
        P                  P                  RR7       R# )r4   T)r   r   	edge_cmapwith_labelsN)r,  r$  number_of_edgesr6   draw_springr9   r   Blues)r>   s    rG   test_edge_colormapr9  D  s5    7**,-FNNF!svv||QUrI   c                     V w  r#Rp\         P                  ! V.4      pV Uu/ uF  qfWf3bK  	  pp\         P                  ! WWR7       \         P                  ! WWVR/R7       VP	                  VR,          4       R# u upi )r   )r%   edgeedge_labelsr!  Nr   )r6   r   drawdraw_networkx_edge_labelsr%  )r  r&  r  r'  r;  rF   rQ   r%   s   &&      rG   test_draw_networkx_edge_labelsr@  L  sl    FCD


D6A
 aqf9aC
 GGA  dF^DKK9$% !s   A;c                  V    \         P                  ! \        P                  4       4       R # rs   )r6   r7  r$  to_directed rI   rG   test_arrowsrD  V  s    NN7&&()rI   #0000ffedgelistc                    \         P                  ! ^4      p\         P                  ! V\         P                  ! V4      W R7      p\        P
                  P                  VP                  4       V4      '       g   Q hR# )z\Tests ways of specifying all edges have a single color for edges
drawn with a LineCollectionr%   rF  r   N)r6   r7   draw_networkx_edgesrandom_layoutr=   r>   r?   r   )r   rE   rF  rF   drawn_edgess   &&&  rG   !test_single_edge_color_undirectedrL  [  s\    & 	aA((	r"XK ::  !6!6!8(CCCCrI   c                *   \         P                  ! ^\         P                  R7      p\         P                  ! V\         P                  ! V4      W R7      pV F9  p\
        P                  P                  VP                  4       V4      '       d   K9  Q h	  R# )z]Tests ways of specifying all edges have a single color for edges drawn
with FancyArrowPatchesro   rH  N)	r6   r7   r   rI  rJ  r=   r>   r?   get_edgecolor)r   rE   rF  rF   rK  faps   &&&   rG   test_single_edge_color_directedrP  u  sl    & 	abjj1A((	r"XK zz$$S%6%6%8(CCCC rI   c                    \         P                  ! ^\         P                  R7      p \        \	        V 4      4       Uu/ uF  qW3bK  	  ppR F  p\         P
                  ! WVR7      pV F9  p\        P                  P                  VP                  4       V4      '       d   K9  Q h	  \         P
                  ! WR	R
.VR7      pV F9  p\        P                  P                  VP                  4       V4      '       d   K9  Q h	  K  	  \         P
                  ! W. RORR7      pV F9  p\        P                  P                  VP                  4       R4      '       d   K9  Q h	  \         P
                  ! W. RORR7      pV F9  p\        P                  P                  VP                  4       R4      '       d   K9  Q h	  \         P
                  ! W. RORR7      p\        P                  P                  V^ ,          P                  4       V^,          P                  4       4      '       g   Q hV F9  p\        P                  P                  VP                  4       R4      '       g   K9  Q h	  \         P
                  ! W. RORR7      p\        P                  P                  V^ ,          P                  4       V^,          P                  4       4      '       g   Q h\        P                  P                  V^,          P                  4       V^,          P                  4       4      '       g   Q hV F9  p\        P                  P                  VP                  4       R4      '       g   K9  Q h	  R# u upi )zIf edge_color is a sequence with the same length as edgelist, then each
value in edge_color is mapped onto each edge via colormap.ro   r   )rF  r   rl   Nr   r   r   r   r   )r   rS  r   r   r   r   rY   rM   )r   r   rU  )rM   r4   )
r6   r7   r   r,  rb   rI  r=   r>   r?   rN  )rF   rQ   r%   r#   rK  rO  s         rG   $test_edge_color_tuple_interpretationrV    s    	abjj1A#CFm
,mqf9mC
, (,,QCC::(():):)<bAAAA  ,,ff-"
 C::(():):)<bAAAA  ( ((	1lK zz$$S%6%6%8&AAAA  ((	9iK zz$$S%6%6%8&AAAA  ((	1iK ::  A$$&A(D(D(F    ::(():):)<fEEEE  ((	9lK ::  A$$&A(D(D(F    ::  A$$&A(D(D(F    ::(():):)<fEEEE c -s   M%c                 T   \         P                  4       p \        P                  ! \         4      pRp\        P                  ! WVR7      p\        V\        P                  ! V4      4       F;  w  rE\        P                  P                  VP                  4       V4      '       d   K;  Q h	  R# )zVTest that the edge colors are cycled when there are fewer specified
colors than edges.rR  Nrj   gb)r$  rB  r6   rJ  rI  r   	itertoolscycler=   r>   r?   rN  rF   r%   
edgecolorsrK  rO  rE   s         rG   .test_fewer_edge_colors_than_num_edges_directedr_    s|     	A


7
#C J((JGK[)//**EFzz$$S%6%6%8(CCCC GrI   c                 T   \         P                  ! ^\         P                  R7      p \         P                  ! \        4      pRp\         P
                  ! WVR7      p\        W2RR 4       F;  w  rE\        P                  P                  VP                  4       V4      '       d   K;  Q h	  R# )zXTest that extra edge colors are ignored when there are more specified
colors than edges.ro   rR  N)rj   rY  rZ  ru   r   )r6   r7   r   rJ  r$  rI  r   r=   r>   r?   rN  r]  s         rG   -test_more_edge_colors_than_num_edges_directedra    s|     	abjj1A


7
#C%J((JGK[Sb/:zz$$S%6%6%8(CCCC ;rI   c                  j   \         P                  ! \        \         P                  ! \        4      RR.RRR7      p V P	                  4       P                  4       p\        V P                  4       4      ^8X  g   Q h\        P                  P                  VRR R4      '       g   Q hVR,          R8X  g   Q hR# r   purpler   )r%   rF  r   r   Nr   r   r   )r6   rI  r$  rJ  r   squeezerb   rc   r=   r>   r?   )edge_collectionr#   s     rG   3test_edge_color_string_with_global_alpha_undirectedrg    s    ,,W%&!O 
	"	"	$	,	,	.B((*+q000::  CR(3333b6S==rI   c                  `   \         P                  ! \        P                  4       \         P                  ! \        4      RR.RRR7      p \        V 4      ^8X  g   Q hV  FN  pVP                  4       p\        P                  P                  VRR R4      '       g   Q hVR,          R8X  d   KN  Q h	  R# rc  )
r6   rI  r$  rB  rJ  rb   rN  r=   r>   r?   )rK  rO  r#   s      rG   1test_edge_color_string_with_global_alpha_directedri    s    ((W%&!K {q    zz$$RWh7777"v}} rI   c                    \         P                  ! ^V R7      p\        \        V4      4       Uu/ uF  q"W"3bK  	  pp\         P                  ! W4      p\        V\        4      '       d
   V^ ,          pVP                  4       ^8X  g   Q hR# u upi )zZTest the default linewidth for edges drawn either via LineCollection or
FancyArrowPatches.ro   N)r6   r7   r,  rb   rI  r_   r   r   )rm   rF   rQ   r%   rK  s   &    rG   test_edge_width_default_valuerk    sv     	aj1A#CFm
,mqf9mC
,((0K+t$$!!n$$&!+++	 -s   Bc                 "   \         P                  ! ^4      p\        \        V4      4       Uu/ uF  q3W33bK  	  pp\         P                  ! W$V R7      p\        VP                  4       4      ^8X  g   Q hVP                  4       V8X  g   Q hR# u upi )r4   r   N)r6   r7   r,  rb   rI  rc   r   )	edgewidthrE   rF   rQ   r%   rK  s   &&    rG   'test_edge_width_single_value_undirectedro    s|     	aA#CFm
,mqf9mC
,((yAK{$$&'1,,,$$&(222 -s   Bc                 8   \         P                  ! ^\         P                  R7      p\        \	        V4      4       Uu/ uF  q3W33bK  	  pp\         P
                  ! W$V R7      p\	        V4      ^8X  g   Q hV F  pVP                  4       V8X  d   K  Q h	  R# u upi )r4   ro   rm  N)r6   r7   r   r,  rb   rI  r   )rn  rE   rF   rQ   r%   rK  rO  s   &&     rG   %test_edge_width_single_value_directedrq    s     	abjj1A#CFm
,mqf9mC
,((yAK{q     "h...  -   Bc                    \         P                  4       p\        P                  ! V4      pRp\        P                  ! WWR7      p\        V\        P                  ! V4      4       F  w  rVVP                  4       V8X  d   K  Q h	  R# )r&   )rF  r   N)r&   g       @g      (@)	r$  rB  r6   rJ  rI  r   r[  r\  r   )rF  rF   r%   r   rK  rO  expected_widths   &      rG   test_edge_width_sequenceru  '  sn     	A


1
CF(((QK";	0GH  "n444  IrI   c                    \         P                  ! ^\         P                  R7      p \         P                  ! V 4      p\         P                  ! W^ R.R7      pV Uu. uF  q3P                  4       NK  	  pp\         P                  ! WRR.RRR7      pV Uu. uF  q3P                  4       NK  	  pp\        P                  P                  WE4      '       g   Q hR# u upi u upi )zuTest that edge_vmin and edge_vmax properly set the dynamic range of the
color map when num edges == len(edge_colors).ro   r   rR  r   g?)r   	edge_vmin	edge_vmaxN)	r6   r7   r   rJ  rI  rN  r=   r>   r?   )rF   r%   rK  r   orig_colorsscaled_colorss         rG   #test_edge_color_with_edge_vmin_vmaxr{  8  s     	abjj1A


1
C((QHEK.9:k??$kK:((	C:K 1<<1__&M<::  <<<< ;
 =s   CCc                 4   \         P                  ! ^\         P                  R7      p \        \	        V 4      4       Uu/ uF  qW3bK  	  pp\         P
                  ! W4      p\	        V4      ^8X  g   Q hV F  pVP                  4       R8X  d   K  Q h	  R# u upi )z>Test default linestyle for edges drawn with FancyArrowPatches.ro   solidNr6   r7   r   r,  rb   rI  r   )rF   rQ   r%   rK  rO  s        rG   %test_directed_edges_linestyle_defaultr  H  s    
abjj1A#CFm
,mqf9mC
, ((0K{q     "g---  -s   Bdashed--c                8   \         P                  ! ^\         P                  R7      p\        \	        V4      4       Uu/ uF  q"W"3bK  	  pp\         P
                  ! WV R7      p\	        V4      ^8X  g   Q hV F  pVP                  4       V 8X  d   K  Q h	  R# u upi )zTests support for specifying linestyles with a single value to be applied to
all edges in ``draw_networkx_edges`` for FancyArrowPatch outputs
(e.g. directed edges).ro   r   Nr~  )r   rF   rQ   r%   rK  rO  s   &     rG   *test_directed_edges_linestyle_single_valuer  T  s     	abjj1A#CFm
,mqf9mC
,((u=K{q     "e+++ 	 -rr  	style_seqc                x   \         P                  ! ^\         P                  R7      p\        \	        V4      4       Uu/ uF  q"W"3bK  	  pp\         P
                  ! WV R7      p\	        V4      ^8X  g   Q h\        V\        P                  ! V 4      4       F  w  rVVP                  4       V8X  d   K  Q h	  R# u upi )zTests support for specifying linestyles with sequences in
``draw_networkx_edges`` for FancyArrowPatch outputs (e.g. directed edges).ro   r  N)
r6   r7   r   r,  rb   rI  r   r[  r\  r   )r  rF   rQ   r%   rK  rO  r   s   &      rG   &test_directed_edges_linestyle_sequencer  j  s     	abjj1A#CFm
,mqf9mC
,((yAK{q   +yy'AB
  "e+++ C	 -s   B7c                     ^ RI Hp Hp ^ RIHp \
        P                  ! \
        P                  R7      p\
        P                  ! \
        P                  R7      p\
        P                  ! V^*R7      p\
        P                  ! V^*R7      p\
        P                  ! W54      p\        Wq4      '       g   Q h\
        P                  ! WFRR7      p\        V\        4      '       g   Q h\        V4      ^ 8  d   \        V^ ,          V4      '       g   Q h\
        P                  ! WFRR7      p\        W4      '       g   Q h\
        P                  ! W6RR7      p\        W4      '       g   Q h\
        P                  ! WERR7      p\        V\        4      '       g   Q h\        V4      ^ 8  d   \        V^ ,          V4      '       g   Q hR# R# )	r   )ra   r   )rz   ro   r   TarrowsFN)matplotlib.collectionsra   r   matplotlib.patchesrz   r6   frucht_graphGraphr   r   draw_networkx_nodesr_   rI  r   rb   )	ra   r   rz   rF   dGr%   dposrN   r^   s	            rG   test_return_typesr    sJ   E2
RXX.A	bjj	1B


12
&CBR(D""1*Ee,,,,""2D9EeT""""
5zA~%(O4444""2E:Ee,,,,""148Ee,,,,""248EeT""""
5zA~%(O4444 rI   c                  B   \         P                  ! 4       p \         P                  ! V ^*R7      p\         P                  ! W. RORRRR7       \         P                  ! V V. RORR. ROR7       \         P                  ! WRRR	7       \         P                  ! V V. R O^RRR
7       \         P                  ! V V. R"O^RRR
7       \         P                  ! V V. R"ORRR^RR7       / pRV^ &   RV^&   RV^&   RV^&   RV^&   RV^&   RV^&   RV^&   \        ^4       Uu/ uF  q3V^,          ^ 8X  d   RMRbK  	  pp\         P                  ! WV^R7       \         P                  ! WV^VR7       \         P                  ! WRRR7       \         P                  ! WR!R/R7       R# u upi )#*   r   rj   i        ?)nodelistr   r   r   rZ  r&   r   )r   r   )rF  r   r   r   T)rF  r  min_source_marginmin_target_marginr   r   z$a$z$b$z$c$z$d$z$\alpha$z$\beta$z$\gamma$z$\delta$k)	font_size)r  
font_colorNF)r=  r'   z4-5r<  )r   r   rY   rM   )r4            )      ?r&   r  r   )r   r   rU  )rM   r   r4   r  )r  )r  r  )r  r  )r  r4   )r6   cubical_graphr   r  rI  r,  draw_networkx_labelsr?  )rF   r%   r   rQ   r>   s        rG   test_labels_and_colorsr    s   
A


12
&C	#D 	$ 1C8	1 	1 	1	 FF1IF1IF1IF1IF1IF1IF1IF1I5:1X>XA
+XF>AFb9AFbVL  T%H  fe_E	 ?s   Fc                     V w  r\         P                  ! \        VR 7       \         P                  ! \        \         P                  ! \        4      VR 7       R# )r   N)r6   r>  r$  r?  circular_layout)r  r  r   s   &  rG   	test_axesr    s4    GCGGG  "*<*<W*E"MrI   c                  \    \         P                  ! 4       p \         P                  ! V 4       R # rs   )r6   r  r>  r   s    rG   test_empty_graphr    s    

AGGAJrI   c                     ^ RI p \        P                  ! RR.4      p\        P                  ! RR.4      p\        P                  ! V4      p\        \        P                  ! W. R7      \        P                  P                  4      '       g   Q h\        \        P                  ! W#. R7      \        P                  P                  4      '       g   Q h\        P                  ! W. RR7      . 8X  g   Q h\        P                  ! W. RR7      . 8X  g   Q h\        P                  ! W#. RR7      . 8X  g   Q h\        P                  ! W#. RR7      . 8X  g   Q hR# )r   N)r  T)rF  r  Fr   rU  )r  r6   r  r   r  r_   r  r=   r`   r   rI  )r   rF   DGr%   s       rG   #test_draw_empty_nodes_return_valuesr    s   !
&&!"A	VV$	%B


Q
C
q3S__5S5S    
r4coo6T6T    !!!2dCrIII!!!2eDJJJ!!"BuEKKK!!"BtDJJJrI   c                      \         P                  ! ^\         P                  R7      p \         P                  ! V R.R7       \         P                  ! V R.. ROR7       R# )rM   ro   rF  )rF  r   N)r   r   r   )
      r   )r6   r7   MultiDiGraphdraw_networkxr   s    rG   test_multigraph_edgelist_tuplesr    s<    
aboo6AQ)-Q)DrI   c                  ,   \         P                  ! \        4      p \        P	                  4       pVP                  ^4       \         P                  ! \        V RR.R7       \        \        P                  4      p\        V4       Uu. uF  q3V,          NK  	  pp\        V4      pVP                  ^4       \         P                  ! \        WVR7       VP                  ^4       VP                  ^4       \         P                  ! \        WR7       R# u upi )   皙?r   )r   )r   r   N)r6   rJ  r$  r9   r:   r;   r  rb   rN   r,  append)r%   r  	num_nodesxr   r>   s         rG   test_alpha_iterr    s    


7
#C
**,COOC7CSz:GMM"I$))$45$4q]]$4E59FOOC7C%H	LLOOOC7C5 6s   Dc                 4   V w  r\         P                  ! ^4      p\         P                  ! V. ROVR7       VP                  4        Uu. uF1  p\	        V\
        P                  P                  4      '       g   K/  VNK3  	  pp\        V4      ^8X  g   Q hR# u upi )r4   )r   r   N)r   hr   ^)	r6   r7   r>  r@   r_   r=   r`   r   rb   )r  r  r   rF   r   scatterss   &     rG   test_multiple_node_shapesr    sz    GC
aAGGA.26??$$a
1coo6T6T(U$   x=As   ,B9Bc                 Z   \         P                  ! 4       pV w  r#\         P                  ! TTVP                  4        Uu/ uF  qDV^,          '       d   RMRbK  	  upVP                  4        Uu/ uF  qD\	        VR,          ^,           4      bK  	  upR7       \        VP                  4       VP                  4        Uu. uFQ  p\        V\        P                  P                  4      '       g   K/  \        VP                  4       4      ^ 8  g   KO  VNKS  	  up4       F|  w  rEV^,          '       d   RMRp\        P                  P                  VP                  4       V4      '       g   Q h\	        VR,          ^,           4      VP!                  4       8X  d   K|  Q h	  R# u upi u upi u upi )rY   r  rj   )r   r  r  r   r1   Ng""""""@)r6   r\   r>  rN   r   r   r@   r_   r=   r   r   rb   r   r>   r?   r   r   )r  rF   r  r   rQ   r   rE   s   &      rG   #test_individualized_font_attributesr    sG   
AGCGG	67ggi@ia!ees,i@67ggi@ic!w-!+,,i@	 		 __&	
&!SXX]]+ 03AJJL0AA0E A&	
  !ee7zz$$Q[[]H====1=1$%555 A@	
s   F."F#>,F(
/F(
F(
c                    \         P                  ! 4       pV w  r#VP                  4        UUu. uF  w  rEWE,           ^,          ^ 8X  d   RMRNK  	  pppVP                  4        UUu. uF*  w  rE^
V^,          V^,          ,           ,          ^
,           NK,  	  ppp\         P                  ! WRWgR7       VP	                  4        Uu. uF1  p\        V\        P                  P                  4      '       g   K/  VNK3  	  p	p\        VP                  4       V	4       F  w  rVP                  4       ^
V
^ ,          ^,          V
^,          ^,          ,           ,          ^
,           8X  g   Q h\        V
4      ^,          '       d%   \        P                  P                  P                  M#\        P                  P                  P                  p\        VP                  4       V4      '       d   K  Q h	  R# u uppi u uppi u upi )rY   rZ   -[T)r   r  r[   r   N)r6   r\   r^   r>  r@   r_   r=   ry   rz   r   r   rd   
ArrowStyleBracketBCurveFilledBget_arrowstyle)r  rF   r  r   re   rf   arrowstyles
arrowsizesr|   r  r   r   rE   s   &            rG   #test_individualized_edge_attributesr  4  s|   
AGCCD779M941QUaK1,5$69KM89	B	"AA&++	JBGGATkP??$$a
1ckk6Q6Q(R$   AGGIv&##%qtax!A$(/B)Cb)HHHH 1vzz KK""++''44 	
 !**,h7777 ' NBs   #G,&0G2,G85G8c                      \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \
        RR7       RRR4       R#   + '       g   i     R# ; i)zReceived invalid argumentmatchbar)fooN)r   r   
ValueErrorr6   r>  r$  rC  rI   rG   test_error_invalid_kwdsr  G  s2    	z)D	E	E
U# 
F	E	E	Es   AA	c                      \         P                  ! . RO4      p . ROp\        P                  ! \        RR7      ;_uu_ 4        \         P
                  ! WR7       RRR4       R#   + '       g   i     R# ; i)r   z1arrowsize should have the same length as edgelistr  )r   N)r   r   rY   r   rM   r   rM   )r   rY   rM   )r6   r   r   r   r  r>  )rF   r   s     rG   +test_draw_networkx_arrowsize_incorrect_sizer  L  sP    


34AI	M
 
 	'
 
 
 
s   A##A4	r   c                    \         P                  ! . RO4      p^ R^R^R/p\         P                  ! WV R7      p\        V \        4      '       d   \
        P                  ! V 4      MT p \        W04       FH  w  rE\        V\        P                  P                  4      '       g   Q hVP                  4       V8X  d   KH  Q h	  R# )r   )r%   r   Nr   r   r  r   r   r   r   )r6   r   rI  r_   r   r[  repeatr   r=   ry   rz   r   )r   rF   r%   r^   rO  rE   s   &     rG   test_draw_edges_arrowsizer  U  s    


+,AfaF
+C""1CE/9)S/I/I	  +yIU.#s{{::;;;;%%'8333 /rI   r[   rZ   c                 ~   \         P                  ! . RO4      p^ R^R^R	/p\         P                  ! WV R7      p\        V \        4      '       d   \
        P                  ! V 4      MT p R\        P                  P                  P                  R\        P                  P                  P                  R\        P                  P                  P                  /p\        W04       FY  w  rV\        V\        P                  P                  4      '       g   Q h\        VP                  4       WF,          4      '       d   KY  Q h	  R# )
r   )r%   r[   rZ   r  <|-|>Nr   r  r   r  )r6   r   rI  r_   r   r[  r  r=   ry   r  r  r  CurveFilledABr   rz   r  )r[   rF   r%   r^   arrow_objectsrO  rE   s   &      rG   test_draw_edges_arrowstyler  b  s    


+,AfaF
+C""1*EE )3:s(C(C	$ 
 	s{{%%22ckk$$--''55M U/#s{{::;;;;#,,.0GHHHH 0rI   c                  h    \         P                  ! \        \        P	                  RR.4      R7       R# )r   r  Nr  r  )r6   r  r$  rT   arrayrC  rI   rG   test_np_edgelistr  w  s     Wrxx0@'ABrI   c                      \         P                  ! ^4      p ^ R^R/p\        P                  ! \         P                  RR7      ;_uu_ 4        \         P
                  ! W4       RRR4       R#   + '       g   i     R# ; i)rM   zhas no positionr  Nr   r   )r6   r7   r   r   r   r  )rF   r%   s     rG   *test_draw_nodes_missing_node_from_positionr  |  sT    
aAfa
 C	r''/@	A	A
q& 
B	A	A	As   A,,A=	c                    V w  r\         P                  ! ^4      pV Uu/ uF  qDWD3bK  	  pp. ROp\         P                  ! VVRVVR7      p\        VP	                  4       4      ^ 8  g   Q hR# u upi )zEnsure draw_networkx_nodes works when node_shape is a Python list.

This covers the case where node_shape is a sequence (list) and node_color
is a single scalar color, which should be supported.
r1   )r   r   r   N)r   r  r   r  r   )r6   empty_graphr  rb   rU   )r  r  r   rF   ir%   shapesrN   s   &       rG   :test_draw_networkx_nodes_node_shape_list_with_scalar_colorr    sx     GC
qA
 aqf9aC
 &F""	E u  "#a''' !s   A.c           	        Vw  r#\         P                  ! R.4      p^ R^R/p\         P                  ! WEW0R7      ^ ,          pVP                  4       P	                  4       R,          p\         P                  ! VVVV ^d^dR7      ^ ,          pVP                  4       P	                  4       R,          p	V	^ ,          V^ ,          8  g   Q hV	^,          V^,          8  g   Q hR# )  Test that there is a wider gap between the node and the start of an
incident edge when min_source_margin is specified.

This test checks that the use of min_{source/target}_margin kwargs result
in shorter (more padding) between the edges and source and target nodes.
As a crude visual example, let 's' and 't' represent source and target
nodes, respectively:

   Default:
   s-----------------------------t

   With margins:
   s   -----------------------   t

r   r   r   r   r  r  Nr   r   r  r   )r6   r   rI  r   r   )
r   r  r  r   rF   r%   default_patchr  padded_patchr  s
   &&        rG   )test_draw_edges_min_source_target_marginsr    s    & GC


F8Afa
 C **1bPQRSM"..088:6BN ))	 	L !,,.668@M nQ////nQ////rI   c           	     "   Vw  r#\         P                  ! RR.4      p^ R^R^R/p\         P                  ! WEW0R7      pV Uu. uF'  qwP                  4       P	                  4       R	,          NK)  	  pp\         P                  ! VVVV ^b^f.^b^f.R7      p	V	 U
u. uF'  qP                  4       P	                  4       R	,          NK)  	  pp
\        W4       F3  w  rzV
^ ,          V^ ,          8  g   Q hV
^,          V^,          8  d   K3  Q h	  R# u upi u up
i )
r  r  r  Nr   r   r   r  )rY   r   r   )r6   r   rI  r   r   r   )r   r  r  r   rF   r%   r  dr  r  r   r  s   &&          rG   4test_draw_edges_min_source_target_margins_individualr    s   & GC


FF#$AfaF
+C **1bPMANOAmmo--/77NO ))	s)s)L AMM1]]_,,.v66MMN2 tad{{tad{{ 3 P Ns   -D-Dc                &   V w  r\         P                  ! 4       pVP                  ^ 4       VP                  ^ ^ 4       \         P                  ! V^ R/4      ^ ,          pVP                  4       pVP                  ^ 8  d   VP                  ^ 8  g   Q hR# )zDEnsure that selfloop extent is non-zero when there is only one node.Nr   )r6   r   r  r  rI  r   r   r  )r  r  r   rF   patchr   s   &     rG   &test_nonzero_selfloop_with_single_noder    su     GC


AJJqMJJq!""1q&k215ED::>dkkAo--orI   c                h   V w  r\         P                  ! ^\         P                  R7      pVP                  ^^4       VP                   Uu/ uF  qDWD3bK  	  pp\         P
                  ! W5R.R7      ^ ,          pVP                  4       pVP                  ^ 8  d   VP                  ^ 8  g   Q hR# u upi )z^Ensure that selfloop extent is non-zero when only a single edge is
specified in the edgelist.
ro   r  Nr   )	r6   r7   r   r  rN   rI  r   r   r  )r  r  r   rF   rQ   r%   r  r   s   &       rG   2test_nonzero_selfloop_with_single_edge_in_edgelistr    s    
 GC
abjj1AJJq!gg
&gqf9gC
&""1VH=a@ED::>dkkAo--o 's   B/c                     . ROp . ROpRp\         P                  P                  P                  WV 4      p\	        VR,          V8H  4      '       g   Q hR# )z^Test apply_alpha when there is a mismatch between the number of
supplied colors and elements.
r&   N)r   r   rY   rX  )rL   r   )r6   drawingnx_pylabapply_alpharO   )r  	colorlistr   rgba_colorss       rG   test_apply_alphar     sJ     HIE**%%11)HMK{5!U*++++rI   c                    ^ RI p ^ RIp \        P                  ! ^4      p\        P                  ! ^\        P                  R7      pV Uu/ uF  q3W33bK  	  ppW3 Fs  p\        P
                  ! WTRR7      p\        V4      \        VP                  4      8X  g   Q h\        V^ ,          \        P                  P                  4      '       d   Ks  Q h	  W3 FG  p\        P
                  ! WTRR7      p\        V\        P                  P                  4      '       d   KG  Q h	  \        P
                  ! W4      p\        V\        P                  P                  4      '       g   Q h\        P
                  ! W$4      p\        V4      \        XP                  4      8X  g   Q h\        V^ ,          \        P                  P                  4      '       g   Q hR# u upi )a  
The `arrows` keyword argument is used as a 3-way switch to select which
type of object to use for drawing edges:
  - ``arrows=None`` -> default (FancyArrowPatches for directed, else LineCollection)
  - ``arrows=True`` -> FancyArrowPatches
  - ``arrows=False`` -> LineCollection
Nro   Tr  F)r  r  r6   r7   r   rI  rb   r^   r_   r=   ry   rz   r`   ra   )r   UGr  rQ   r%   rF   r^   s          rG   *test_draw_edges_toggling_with_arrows_kwargr  '  s[    "	q	B	qrzz	2B 
!bqf9bC
! X&&qd;5zS\)))%(CKK$?$?@@@@  X&&qe<%!?!?@@@@ 
 ""2+EeS__;;<<<<""2+Eu:QWW%%%eAh ; ;<<<<% "s   	Gdrawing_funcc                    ^ RI p\        P                  ! ^4      pVw  rEV ! W5R7       \        ;QJ d&    R VP                   4       F  '       g   K   RM	  RM! R VP                   4       4      '       g   Q hVP
                  '       d   Q hR# )r   Nr  c              3   j   "   T F)  p\        V\        P                  P                  4      x  K+  	  R # 5irs   r_   r=   r`   ra   rt   ru   s   & rG   rv   ?test_draw_networkx_arrows_default_undirected.<locals>.<genexpr>P  s$     Unz!S__;;<<n   13TF)r  r6   r7   anyr`   ry   r  r  r   rF   r  r   s   &&    rG   ,test_draw_networkx_arrows_default_undirectedr  I  sa    !
aAGC3UbnnU333UbnnUUUUUzzz>zrI   c                 <   ^ RI p\        P                  ! ^\        P                  R7      pVw  rEV ! W5R7       \        ;QJ d&    R VP
                   4       F  '       g   K   RM	  RM! R VP
                   4       4      '       d   Q hVP                  '       g   Q hR# )r   Nro   r  c              3   j   "   T F)  p\        V\        P                  P                  4      x  K+  	  R # 5irs   r  r  s   & rG   rv   =test_draw_networkx_arrows_default_directed.<locals>.<genexpr>[  s'      ?M!
1coo4455~r
  TF)r  r6   r7   r   r  r`   ry   r  s   &&    rG   *test_draw_networkx_arrows_default_directedr  T  sy    !
abjj1AGCs ?A~~sss ?A~~     ::::rI   c                     \         P                  ! ^4      pVP                  ^ ^ 4       V w  r#\         P                  ! VRR.VR7       VP                  '       d   Q hR# )rM   )rF  r   Nr   r   )r6   r7   r  r>  ry   )r  rF   r  r   s   &   rG   test_edgelist_kwarg_not_ignoredr  a  sJ    
aAJJq!GCGGA(R0zzz>zrI   c           	     R   \        . RO4       F,  w  pw  r4V P                  W4\        V^,          ^4      R7       K.  	  V  Uu/ uF  qUWU3bK  	  ppRRR.. RO3 FE  p\        P                  ! WVR7       \        P                  ! WVR7      p\        V4      V8X  d   KE  Q h	  R# u upi )zGDraws edges correctly for 3 types of graphs and checks for valid lengthr   arc3,rad=0.1connectionstyleNr   r   r   r  )r  r  arc3,rad=0.2)	enumerater  r"   r6   rI  rb   )	rF   expected_n_edgesr  re   rf   rQ   r%   
conn_styler  s	   &&       rG   2test_draw_networkx_edges_multiedge_connectionstyler  j  s     ?@	6A	

1a!eQ
0 A
 aqf9aC
  		(8

 	qzB''
K6{.... !s   B$c           	        \        . RO4       F,  w  pw  r4V P                  W4\        V^,          ^4      R7       K.  	  V  Uu/ uF  qUWU3bK  	  pp\        P                  ! W. ROR7      pRRR.. RO3 Fa  p\        P
                  ! WVR7      p	\        V	4      V8X  g   Q hV	P                  4        F   p
V
P                  P                  R8X  d   K   Q h	  Kc  	  R# u upi )	zXDraws labels correctly for 3 types of graphs and checks for valid length and class namesr  r  r  r  CurvedArrowTextNr  )r  r  r  )
r  r  r"   r6   rI  r?  rb   values	__class____name__)rF   r  r  re   rf   rQ   r%   r  r  
text_itemstis   &&         rG   8test_draw_networkx_edge_labels_multiedge_connectionstyler&  ~  s     ?@	6A	

1a!eQ
0 A
 aqf9aC
 ##	 PF 		(8

 11!*U
:"2222##%B<<((,==== & !s   Cc                  8   \         P                  ! 4       p V P                  ^ ^^
R7       V P                  ^ ^^R7       \         P                  ! V R4      pV  Uu/ uF  q"W"3bK  	  pp\         P                  ! V VVRR.R7      p\        V4      ^8X  g   Q hR# u upi )r   r  r   r  r  r=  r  N)r6   r   r  get_edge_attributesr?  rb   )rF   r=  rQ   r%   r$  s        rG   'test_draw_networkx_edge_label_multiedger*    s    
AJJq!BJJJq!BJ((H5K
 aqf9aC
 --	'8	J z?a !s   Bc                     \         P                  ! ^4      p V P                   Uu/ uF  qW3bK  	  pp\         P                  ! W/ R7      / 8X  g   Q hR# u upi )zKRegression test for draw_networkx_edge_labels with empty dict. See
gh-5372.r<  N)r6   r7   rN   r?  )rF   rQ   r%   s      rG   (test_draw_networkx_edge_label_empty_dictr,    sN     	aAgg
&gqf9gC
&''B?2EEE 's   Ac                `   V w  r. ROp. ROp\         P                  ! V4      pVP                   Uu/ uF  qfWf3bK  	  pp\         P                  ! WWW#VR7       \	        VP
                  4      ^8X  g   Q h\        P                  VRR 4      \        P                  ^ R.4      ,           p\        VP
                  VRR V4       Fc  w  rpV	P                  4       P                  V4      '       g   Q h\        P                  P                  V	P                  4       V
4      '       d   Kc  Q h	  R# u upi )zpWhen an edgelist is supplied along with a sequence of colors, check that
the self-loops have the correct colors.)r   rF  r   Nr  )r  r   rU  r   rM   rM   r   )pinkcyanr   r1   rl   green)r6   r  rN   rI  rb   ry   rT   r  r   r   contains_pointr=   r>   r?   rN  )r  r  r   rF  edge_colorsrF   rQ   r%   	sl_pointsrO  clrslps   &           rG   3test_draw_networkx_edges_undirected_selfloop_colorsr8    s     GC?HCK
Agg
&gqf9gC
&1bT rzz?a
 "#'"((As8*<<I RZZRS)99E#||~,,S1111zz$$S%6%6%8#>>>> F 's   D+fap_only_kwargr  r  r  r  c           	     p   \         P                  ! ^4      pV Uu/ uF  q3W33bK  	  ppVw  rV\        V P                  4       4      ^ ,          p\        P
                  ! \        RV R2R7      ;_uu_ 4        \         P                  ! W$3RV/V B  RRR4       \        P                  ! 4       ;_uu_ 4        \        P                  ! R4       \        P                  ! R\        R7       \         P                  ! W$3RVR	R
/V B  RRR4       R# u upi   + '       g   i     L; i  + '       g   i     R# ; i)zUsers should get a warning when they specify a non-default value for
one of the kwargs that applies only to edges drawn with FancyArrowPatches,
but FancyArrowPatches aren't being used under the hood.z

The z# keyword argument is not applicabler  r   Nerrorignore)categoryr  T)r6   r7   r   r   r   warnsUserWarningrI  warningscatch_warningssimplefilterfilterwarningsDeprecationWarning)r9  r  rF   rQ   r%   r  r   
kwarg_names   &&      rG   1test_user_warnings_for_unused_edge_drawing_kwargsrF    s     	aA
 aqf9aC
 GC n))+,Q/J	Xj\1TU
 
 	q?"??
 
	 	 	"	"g&3EF
qL"LTL^L	 
#	" !

 
 
#	"	"s   D5D4AD$D!	$D5	draw_fnc                     Vw  r#\         P                  ! ^4      p\        P                  ! RR7      ;_uu_ 4       pV ! WCR7       RRR4       \	        X4      ^ 8X  g   Q hR#   + '       g   i     L$; i)r  T)recordr  N)r6   cycle_graphr@  rA  rb   )rG  r  r  r   rF   ws   &&    rG   *test_no_warning_on_default_draw_arrowstylerL    sR     GC
qA		 	 	-	- 
.q6Q;; 
.	-s   
A  A0	r  methodc                    \         P                  ! ^4      pVP                   Uu/ uF  qDWD3bK  	  ppVw  rgV ! W5WqR7       VP                  VP                  3 F#  p\        VP                  4       4      V8w  d   K#  Q h	  R# u upi )rM   )r%   r   r  N)r6   r7   rN   r	  r
  r  r  )	rM  r  r  rF   rQ   r%   r'  r   r  s	   &&&      rG   test_hide_ticksrO    sw     	aAgg
&gqf9gC
&EA
1"4288$D'')*j888 % 's   Bc                j   V w  r#Rp\         P                  ! V.4      pV Uu/ uF  qfV^ 3bK	  	  ppVP                  R4      ^ ,          p\         P                  ! WWVR/VR7      p	V^ ,          ^ ,          V^,          ^ ,          ,           ^,          p
V^ ,          ^,          V^,          ^,          ,           ^,          pVR9   dJ   W,          P                  '       g0   Q W,          P
                  \        P                  ! W34      8H  4       hR# VR8X  d   W,          P
                  V8  g   Q hR# R# u upi )zz
Check that FancyArrowPatches with all `connectionstyle`s are supported
in edge label rendering. See gh-7735 and gh-8106.
,r;  r(  r  Nr   >   arcr.   )r6   r   splitr?  r  yr   approx)r  r   r  r   r;  rF   rQ   r%   namer   hmidvmids   &&          rG   $test_edge_label_all_connectionstylesrY    s     GCD


D6A
 aq!f9aC
 ;;sAD))	T6NEF F1IAq	!Q&DF1IAq	!Q&D|~~~Lv|~~|1LLL~	|~~$$$ 
 !s   D0	label_posg?c                4   V w  r#Rp\         P                  ! V.4      pV Uu/ uF  qfWf3bK  	  pp\         P                  ! WWVR/VRR7      pW,          P                  '       g0   Q W,          P                  \
        P                  ! W34      8H  4       hR# u upi )z@
Check that label positions can be extrapolated outside [0, 1].
r;  angle)r=  rZ  r  Nr   )r6   r   r?  r  rT  r   rU  )	r  rZ  r  r   r;  rF   rQ   r%   lbls	   &&       rG   test_edge_label_label_posr^  !  s    
 GCD


D6A
 aqf9aC
 

&
&	T6NiQXC 9;;;L	v}}i5K'LLL; !s   B)r   r   r   )rC   rD   rE   )r   r   r1   )r   r   r2   )rD   rE   ))N)r   r   r   r   )r&   )r&   r&   r&   r&   )rK   )r   r&   gUUUUUU?r  )r   rE   Nr   rj   r1   r   r   r   ra  rk   r   r   r   r   rc  r2   )r_  r`  rb  rd  )r   rl   )rq   rl   )r   r   )rE  rl   r   )rn  rE   r.  r   rT  r   r   )r  r  re  )r  r)   r   )r  r)   r   z-.)r  r     )rZ   r  r  )rF   r  )r\  angle3rR  zarc3,rad=0.0zbar,fraction=0.1g)u__doc__r[  osr@  r   networkxr6   r#  r=   rT   user9   rcParamsbarbell_graphr$  defaultsmarkparametrizerH   rR   rW   ri   r  r   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  fixturer  draw_circularr"  draw_planardraw_randomdraw_spectralr7  r-  draw_forceatlas2r)  r.  r2  r9  r@  rD  rL  rP  rV  r_  ra  rg  ri  rk  ro  rq  ru  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r>  r  r  r  r  r   r  r  r&  r*  r,  r8  rF  rL  r?  rI  r  r  rO  rY  r^  rC  rI   rG   <module>rw     s   2  	   ,'! -.#]  

1a
 ,,D, ), 	,
 ,(DD88," ##,$ #%,& ',( ),* D+,, #-,. )/,0 ,(WdOT?S88s$1,H #I,J #K,N sO,P aQ,R f!!W,^ -	tXl34(' " 
 "**'=> ?
* "**'=> ?( "**'=> ?>$ "**'=> ?8 "**'=> ?( 	&(>?@	
QF	1b' "**'=> ?, 	&(>?@	sCj	3* "**'=> ?46" z2/ 3/d 5$-0 1&P   







	&&&&&*
 
#
	H%
 
f
 dVH%56D 7D 
#
	H%
 
f
 dVH%56	D 7	D6FrDD "**'=>, ?, 
a33 
a//  	55= 	. ,, 	
			s

,

,549FzN
K,E6$6.8&$
( r<&89	4 :	4 /E'FGI HI(C
'(: z2)0 3)0\ z2) 3)X..",=D "''23C3C)DE F "''23C3C)DE	 F	 jjlA!,r/@!.DE/	/  jjlA!,r/@!.DE>	>( F?6 	s	b	N+	b!	b!	M	M. RWWb.>.>$?@ A t}5

$$


	9	 69 K%%. tSk2M 3MrI   