+
    &iW_                        ^ RI t ^ RIt^ RIHtHtHtHtHtH	t	H
t
HtHtHtHtHt ^ RIHtHtHtHtHtHtHt  ! R R4      t ! R R4      t ! R R	4      t ! R
 R4      t ! R R4      t ! R R4      tR t ! R R4      tR t  ! R R4      t!R t"R t#] PH                  PK                  RRR^^.R'.4      R 4       t&R t'R t(R t)R t*R  t+R! t,R" t-] PH                  PK                  R#. R(O4      R$ 4       t.R% t/R& t0R# ))    N)c_diag_indicesdiag_indices_fromfill_diagonal	index_expix_mgridndenumeratendindexogridr_s_)assert_assert_almost_equalassert_array_almost_equalassert_array_equalassert_equalassert_raisesassert_raises_regexc                      a  ] tR t^t o R tR tR tR tR tR t	R t
]P                  P                  R. RO4      R	 4       tR
 tR tRtV tR# )TestRavelUnravelIndexc                	   \        \        P                  ! ^R4      R4       \        \        P                  ! ^RR7      R4       \        \        4      ;_uu_ 4        \        P                  ! ^RR7       RRR4       \        \        4      ;_uu_ 4        \        P                  ! ^RR7       RRR4       \        \        4      ;_uu_ 4        \        P                  ! ^RR7       RRR4       \        \        4      ;_uu_ 4        \        P                  ! ^RR7       RRR4       \        \        P
                  ! RR4      ^4       \        \        P                  ! ^R4      R4       \        \        P
                  ! RR4      ^4       \        \        \        P                  RR4       \        \        \        P                  RR4       \        \        \        P                  ^R4       \        \        \        P
                  RR4       \        \        \        P
                  RR4       \        \        \        P
                  RR4       \        \        \        P
                  RR4       \        \        \        P
                  RR4       \        \        P                  ! ^.R4      . RO4       \        \        P
                  ! . ROR4      ^.4       \        P                  ! . RO. RO.4      p\        \        P
                  ! VR4      . RO4       \        \        P
                  ! VRRR	7      . RO4       \        \        P
                  ! VRR
R7      . RO4       \        \        P
                  ! VR R!R7      . R"O4       \        \        P
                  ! R#R$4      R4       \        \        P                  ! \        P                  ! . RO4      R4      . RO. RO.4       \        \        P                  ! \        P                  ! . RO4      RRR	7      . RO. RO.4       \        \        P                  ! RR$4      . R#O4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELf; i)%   )indicesshape)r   hapeN)r   )ims)dimsg      ?ForderclipmodeiU  r   r      r   )   ^   )r   B   )r'   )r   r'   )r   r,   r   r   )皙?g        )         r   r'   r/   )r0   r1   r1   )r/      r'   )   r1   )   )   %   )   r6      )r/   r1   )r5         r/   r/   )r"   wrap)   r9   r9   )r0   r'   r/   r'   )r1   r4      	   )r   npunravel_indexr   	TypeErrorravel_multi_index
ValueErrorarray)selfarrs   & _/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numpy/lib/tests/test_index_tricks.py
test_basic TestRavelUnravelIndex.test_basic   s   R%%a0&9 	R%%a,24&,	. 9%%QV4 & 9%%QV, & 9%%Sh/ & 9%%Sx0 & 	R))&&91=R%%c84g>R))'8<cBj""2"2B?i!1!13?j""2"2Av>j""6"6Hj""6"6Gj""6"6Hj""6"6Gi!5!5y&IR%%&99EyQ  I68K	M hh	9-.R))#v6E  fC8,	H  f6:L	JR))#v<LM!	#R)),EtLR%%bhh|&<fE+	-RXXl3V3G	"	$ 	R%%dL9<HW &%% &%% &%% &%%s0   P=QQ%Q9=Q	Q"	%Q6	9R
	c           
        R pRp\        \        V\        P                  . R4       \        \        V\        P                  RR4       \        \        V\        P                  \        P                  ! . 4      R4       \        \        P                  ! \        P                  ! . \        R7      R4      . . . .4       \        \        V\        P                  . . 3R4       \        \        V\        P                  . R.3R4       \        \        V\        P                  \        P                  ! . 4      \        P                  ! . 4      3R4       \        \        P                  ! \        P                  ! . \        R7      \        P                  ! . \        R7      3R4      . 4       \        \        P                  ! \        P                  ! . . .\        R7      R4      . 4       R# )	z9indices must be integral: the provided empty sequence waszonly int indices permitteddtypeabcN)
   r0   r3    rP   r0   )r3   r0   )r   rC   rA   rB   rF   r   intrD   )rG   msg1msg2s   &  rI   test_empty_indices(TestRavelUnravelIndex.test_empty_indicesU   sT   J+ItR-=-=r:NItR-=-=r:NItR-=-=rxx|&	(R%%bhhr&=zJ"b\	#ItR-A-AB8#	%ItR-A-AB=#	%ItR-A-AXXb\288B<0&	:R))"C("((2S*ABFLMO	QR))"((B83*G 	"    c                   \         P                  \         P                  8X  d;   ^^.^^.^^u.^^.RR.^^.^ ^.3p\        \         P                  ! VR4      RR.4       \        \        \         P                  ^R	4       ^ .^ .3p\         P                  ! \         P                  4      P                  ^,          p\        \         P                  ! W#^34      ^ .4       \        \        \         P                  W#^,           ^34       \        \         P                  ! W#^3RR7      ^ .4       \        \        \         P                  W#^,           ^3RR7       R# )
r'   iK	  i  l   z l   nm r   r    N)r6   r4   x   $   i
  r?   r1   )l    l       )
rA   intpint64r   rD   r   rE   rB   iinfomax)rG   rH   	dummy_arrhalf_maxs   &   rI   test_big_indices&TestRavelUnravelIndex.test_big_indicesi   s)   77bhhr7QFQHr1g$<!Q!Q1C$$S*FG\*,
 	j""2"2A7MN S1#J	88BGG$((A-  qM:QC	Aj  )lA->	@  qMEs	Lj  )lA->c	KrX   c           
        \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  3 EF  p\         P                  ! . RO. RO.VR7      pRp^V^ ,          ,          V^,          ,           p\        \         P                  ! W#4      V4       \        V\         P                  ! WC4      4       V^ ,          ^V^,          ,          ,           p\        \         P                  ! W#RR7      V4       \        V\         P                  ! WCRR7      4       \         P                  ! . RO. RO. RO.VR7      pR	p^
^V^ ,          ,          V^,          ,           ,          V^,          ,           p\        \         P                  ! W#4      V4       \        V\         P                  ! WC4      4       V^ ,          ^V^,          ^V^,          ,          ,           ,          ,           p\        \         P                  ! W#RR7      V4       \        V\         P                  ! WCRR7      4       EK  	  R# )
r'   rM   r   r    N)r'   r   r'   r   r0   r/   )r'   r1   r'   r0   r   r   )r3   r?   )r'   r0   r'   r   r@   r3   )r3   r?   rP   )rA   int16uint16int32uint32r]   uint64rF   r   rD   rB   )rG   rN   coordsr   uncoordss   &    rI   test_dtypes!TestRavelUnravelIndex.test_dtypes   s   hh		288ii2996EXX#%78GFE6!9}vay0H--f<hG!1!1(!BCay1vay=0H$$V#>J!1!1(!MNXX#%79KLF EQ]VAY67&)CH--f<hG!1!1(!BCay1q	Aq	M(A#BBH$$V#>J!1!1(!MN/6rX   c                :   \        \        P                  ! . RORRR7      \        P                  ! . ROR4      4       \        \        P                  ! . RORRR7      \        P                  ! . ROR4      4       \        \        \        P                  . ROR4       R# )	r3   r=   r#   N)r3   r'   r+   r   )r/   r0   r4   r>   )r'   r'   r1   r   )r=   raiser"   ro   )r'   r'   r   r   )r   rA   rD   r   rE   rG   s   &rI   test_clipmodes$TestRavelUnravelIndex.test_clipmodes   s{      FK  }=	? 	R))-0PQ )),F	H 	,,m]	LrX   c                    \         P                  ! . ROR4      w  r\        VP                  P                  4       \        VP                  P                  4       R# )r'   Nr'   r   r0   )r/   r3   )rA   rB   r   flags	writeable)rG   xys   &  rI   test_writeability'TestRavelUnravelIndex.test_writeability   s:    	62!!"!!"rX   c                    \         P                  ! ^ R4      p\        VR4       \        \        R\         P                  ^ .R4       \        \        R\         P                  ^.R4       R# )r   z0d arrayzout of boundsNrQ   )rA   rB   r   r   rE   rG   rw   s   & rI   test_0dTestRavelUnravelIndex.test_0d   sR    Q#QJ
B4D4Dqc2N)9)9A3	DrX   r$   c           	        \         P                  ! \         P                  ! R\         P                  R7      RVR7      pVP                  R8X  g   Q h\        \        4      ;_uu_ 4        \         P                  ! \         P                  ! R\         P                  R7      RVR7       RRR4       R#   + '       g   i     R# ; i)r0   rM   r#   N)r0   r   r   r'   r   r   )r0   r'   )rA   rD   zerosr\   r   r   rE   )rG   r$   ress   && rI   test_empty_array_ravel,TestRavelUnravelIndex.test_empty_array_ravel   sz    ""HHV2773YTKyyD   :&&  HHV2773YTK '&&&s   (>B00C	c                   \         P                  ! \         P                  ! ^ \         P                  R7      R4      p\	        V4      ^8X  g   Q h\
        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   Q h\        \        4      ;_uu_ 4        \         P                  ! ^.R4       RRR4       R#   + '       g   i     R# ; i)r   rM   c              3   >   "   T F  qP                   R8H  x  K  	  R# 5i)r   Nr   r   ).0as   & rI   	<genexpr>ATestRavelUnravelIndex.test_empty_array_unravel.<locals>.<genexpr>   s     0Cq77d?Cs   FTNr   )rA   rB   r   r\   lenallr   rE   )rG   r   s   & rI   test_empty_array_unravel.TestRavelUnravelIndex.test_empty_array_unravel   s    rxx99E3x1}}s0C0sss0C00000:&&aS), '&&&s   !CC	c                    \         P                  ! \         P                  ! . RO.\         P                  R7      R4       R# )r'   rM   N)r'   r   r'   r   )r/   )rA   rB   rF   rh   rp   s   &rI   test_regression_size_1_index2TestRavelUnravelIndex.test_regression_size_1_index   s%     	<.		BDIrX   rQ   N)r"   r=   ro   )__name__
__module____qualname____firstlineno__rJ   rV   rb   rl   rq   ry   r}   pytestmarkparametrizer   r   r   __static_attributes____classdictcell____classdict__s   @rI   r   r      sh     5In"(K0O6
L#D [[V%>?K @K-J JrX   r   c                      a  ] tR t^t o R tR tR tR t]P                  P                  RRR.4      R 4       tR tR	 tR
 tRtV tR# )TestGridc                   \         R^R1,          p\         R^R1,          p\        VP                  R8H  4       \        VP                  R8H  4       \        V^ ,          R8H  4       \        VR,          ^4       \        V^ ,          R8H  4       \        V^,          V^ ,          ,
          R^4       \        VR,          V^ ,          R,           ^4       \        V^,          V^ ,          ,
          R^4       R# )	r'                 $@r.   Nr+   )rP   )   ggfffff?gqq?)r	   r   r   r   )rG   r   bs   &  rI   rJ   TestGrid.test_basic   s    "Qs(O"Qs(O5 !5 !!
AbE1%!
AaD1Q4Kb1AbE1Q4(?B7AaD1Q4KB7rX   c                    \         P                  ! ^^
RR7      w  r\        VR4       \        V\        R,          ^4       R# )r   T)retstep:r   rP   y              I@Ng9/?)rA   linspacer   r   r	   )rG   rx   sts   &  rI   test_linspace_equivalence"TestGrid.test_linspace_equivalence   s0    Ar40B)!!U8_b9rX   c                L   \         R^R1R^R13,          p\         R^R1R^R13,          p\        VP                  R8H  4       \        VP                  R	8H  4       \        V^ ,          R
,          \        P
                  ! ^
R4      ) 4       \        V^,          R,          R\        P
                  ! ^
R4      ,          4       \        V^ ,          R,          \        P
                  ! ^
R4      ^4       \        V^,          R,          ^\        P
                  ! ^
R4      ,          ^4       \        VR,          VR,          ,
          R\        P
                  ! ^R4      ,          ^4       \        VR,          VR,          ,
          R\        P
                  ! ^R4      ,          ^4       R# )r'   r   r.   g?dNr+   )r   rP   rP   )r   r   r   )r   NNN)r   r   )r+   r   )r   r+   )r   r'   r   )r   r   r   )r'   r   r'   )r'   r   r   )r	   r   r   r   rA   onesr   )rG   cr   s   &  rI   test_ndTestGrid.test_nd   s7   "Qs(BqH$%"Qs(BqH$%;&';&'1Q4:C(8'891Q4:rBGGB,<'<=!!A$u+rwwr3/?D!!A$u+q2772s3C/CRH!!G*qz"9"%C(8"8"	>!!G*qz"9"%C(8"8"	>rX   c                    \         R^R1R^R13,          p\        R^R1R^R13,          p\        P                  ! V!  p\	        W4       F  w  rE\        WE4       K  	  R# )r'   r   Nr+   r   )r	   r   rA   broadcast_arrayszipr   )rG   	grid_fullgrid_sparsegrid_broadcastfr   s   &     rI   test_sparseTestGrid.test_sparse   sc    "Qs(BqH,-	BqHb3h./ ,,k:	2DA 3rX   zstart, stop, step, expectedNc                    \         WV1WV13,          p\         WV1,          p\        VP                  V^ ,          4       \        VP                  V^,          4       R# )r   N)r	   r   size)rG   startstopstepexpectedgrid
grid_smalls   &&&&&  rI   test_mgrid_size_none_handling&TestGrid.test_mgrid_size_none_handling   sO     U_eo56 5d?+
TYY,Z__hqk2rX   c                h   \         R,          p\         \        P                  ! R4      \        P                  ! R4      \        P                  ! R4      13,          p\        W4       VP                  \        P                  8X  g   Q hVP                  \        P
                  8X  g   Q h\         R ,          p\         \        P                  ! R4      \        P                  ! R4      \        P                  ! R4      1,          p\        VP                  \        P
                  8H  4       \        W4       R# )g?gQ?g?r.   Q?Nr   )r	   rA   float32r   rN   float64r   )rG   grid64grid32s   &  rI   test_accepts_npfloating TestGrid.test_accepts_npfloating  s    }&rzz#rzz$'7

3GHJ!&1||rzz)))||rzz))) |$rzz#rzz$'7

3GH

*+!&1rX   c                h   \         R,          p\         \        P                  ! R4      \        P                  ! R4      \        P                  ! R4      13,          p\        VP                  \        P                  8H  4       \        W4       \         ^ \        P                  ! ^4      R1,          p\         ^ \        P                  ! ^4      R13,          p\        VP                  VP                  u;8H  ;'       d    \        P                  8H  Mu 4       \        W4^ ,          4       \         R ,          p\         \        P                  ! R4      \        P                  ! R4      \        P                  ! R4      1,          p\        VP                  \        P                  8H  4       \        W4       R# )r   r.   r   y        333333@Nr   )r	   rA   
longdoubler   rN   r   r   )rG   r   grid128
grid128c_a
grid128c_bs   &    rI   test_accepts_longdouble TestGrid.test_accepts_longdouble  s   }&MM#r}}T22==3EEF
 	./!&21R]]1-d23
1R]]1-d235

  J$4$4EEEF:!}5 |$MM#r}}T22==3EE
 	./!&2rX   c           	        \        \        R,          \        RR\        P                  ! R4      13,          4       \        \        R ,          \        RR\        P                  ! R4      1,          4       \        R,          p\        R,          ^ ,          p\	        VP
                  VP
                  u;8H  ;'       d    \        P                  8H  Mu 4       \        W4       \        RR\        P                  ! R4      1,          p\        RR\        P                  ! R4      13,          ^ ,          p\	        VP
                  VP
                  u;8H  ;'       d    \        P                  8H  Mu 4       \        W4       R# )	g?g333333?y              @r.   g333333?y              @g?g333333?y        ffffff
@y        ffffff
@N)r   )r   )
r   r	   rA   	complex64r   rN   r   r   clongdoubler   )rG   grid64_agrid64_b	grid128_a	grid128_bs   &    rI   test_accepts_npcomplexfloating'TestGrid.test_accepts_npcomplexfloating-  s    !+s3r||B/?'?'@!B	

 	"*uSR\\"-=%=>	

 &(+(..>>BJJ>?8.#c".."667	#c".."6679!<		9??CCbmmCD8.rX   rQ   )NrP   r   )   rP   )ir   N)i     )r   r   r   r   rJ   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @rI   r   r      s^     
8:
> [[:"#=
 
3	
323,/ /rX   r   c                   D   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
TestConcatenatoriD  c                    \        \        R,          \        P                  ! . RO4      4       \        P                  ! ^4      p\        V^ ^ V3,          p\        V. RO4       R# )r'   N)r'   r   r0   r/   r3   r1   )r'   r'   r'   r'   r'   r   r   r'   r'   r'   r'   r'   )r   r   rA   rF   r   )rG   r   r   s   &  rI   test_1dTestConcatenator.test_1dE  sE    2./:L1MNGGAJq!QzN1BCrX   c                P    \         R,          p\        VP                  R8H  4       R# )333333$@f8N)r   :r'   rP   N)r   r   rN   rG   gs   & rI   test_mixed_type TestConcatenator.test_mixed_typeK  s    zN4 rX   c                    \         R\        P                  ! ^.4      \        P                  ! . RO4      R3,          p\        VP                  R8H  4       R# )r   g      $@r   Ng333333$)r   r0   r/   )r   rA   rF   r   rN   r   s   & rI   test_more_mixed_type%TestConcatenator.test_more_mixed_typeO  s8    ubhhsmRXXi%8$>?4 rX   c                    \         R ,          p\        VP                  R8H  4       \         ^ ^$\        P                  ! R4      1,          p\        VP                  R8H  4       R# ):r   r[   y              Y@y              Y@N)d   )r   r   r   rA   r   r   s   & rI   test_complex_step"TestConcatenator.test_complex_stepS  sI    yM6!" qBLL&&'6!"rX   c                   \         P                  P                  ^^4      p\         P                  P                  ^^4      p\        RW3,          p\	        VP
                  R8H  4       \        VR,          V4       \        VR,          V4       \        W3,          p\	        VP
                  R8H  4       \        VR,          V4       \        VR,          V4       R# )	r3   1N)r3   rP   )r   Nr3   N)r   r3   NN)rP   r3   )r   r   )r   r   )rA   randomrandr   r   r   r   )rG   r   r   r   s   &   rI   test_2dTestConcatenator.test_2d\  s    IINN1a IINN1a sAyM7"#1U8Q'1U8Q'qtH7"#1U8Q'1U8Q'rX   c                *   \        \        ^ \        P                  ! ^4      ^3,          . RO4       \        \        . RO\        P                  ! ^4      3,          . RO4       \        \        \        P                  ! ^ 4      . RO3,          . RO4       R# )r   Nr   r'   r   )r   r'   r   r0   rt   )r   r   rA   rF   rp   s   &rI   r}   TestConcatenator.test_0dh  sX    R288A;)*I6R	288A;./>RY./>rX   rQ   N)r   r   r   r   r   r   r   r   r   r}   r   r   r   s   @rI   r   r   D  s)     D!!#
(? ?rX   r   c                   &   a  ] tR tRt o R tRtV tR# )TestNdenumeratein  c                ~    \         P                  ! ^^.^^..4      p\        \        \	        V4      4      . RO4       R# )r'   N))r   r   r'   ))r   r'   r   )r&   r0   ))r'   r'   r/   )rA   rF   r   listr
   rG   r   s   & rI   rJ   TestNdenumerate.test_basico  s4    HHq!fq!f%&T+a.)I	KrX   rQ   N)r   r   r   r   rJ   r   r   r   s   @rI   r  r  n  s     K KrX   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestIndexExpressioniu  c                    \         P                  ! ^4      p\        VRR V\        RR ,          4       \        VRR V\        RR ,          4       R# )r   Nr+   )rA   aranger   r   r   r  s   & rI   test_regression_1%TestIndexExpression.test_regression_1v  sD    IIaLQsVQr#2wZ(QsVQy"~./rX   c           	        \         P                  P                  ^^^4      p\        VRR^^.3,          V\        RR^^.3,          ,          4       \        VRR^^.3,          V\
        RR^^.3,          ,          4       R# )r/   r   :Nr0   NN)rA   r   r   r   r   r   r  s   & rI   test_simple_1!TestIndexExpression.test_simple_1|  sr    IINN1a#Qq"q!f}%q1b1a&=)A'BCQq"q!f}%qArAq6M):';<rX   rQ   N)r   r   r   r   r  r  r   r   r   s   @rI   r  r  u  s     0= =rX   r  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	TestIx_i  c                   \         P                  ! \        ^ 4      4      w  p\        VP                  \         P
                  4       \         P                  ! . 4      w  p\        VP                  \         P
                  4       \         P                  ! \         P                  ! . \         P                  R7      4      w  p\        VP                  \         P                  4       R# )r   rM   N)rA   r   ranger   rN   r\   rF   r   r  s   & rI   r  TestIx_.test_regression_1  s|    VVE!HQWWbgg&VVBZQWWbgg& VVBHHRrzz23QWWbjj)rX   c           
     b  a Rp\         \        P                  3 EF  p\        P                  ! V Uu. uF
  q2! V4      NK  	  up!  p\	        \        WA4      4       F  w  ow  rS\        VP                  S,          V4       \        \        ;QJ d2    V3R l\	        VP                  4       4       F  '       d   K   RM'	  RM#! V3R l\	        VP                  4       4       4      4       \        \        P                  ! VP                  \        P                  4      4       K  	  EK  	  R# u upi )r/   c              3   D   <"   T F  w  rVS8w  g   K  V^8H  x  K  	  R# 5i)r'   NrQ   )r   jshks   &  rI   r   /TestIx_.test_shape_and_dtype.<locals>.<genexpr>  s!     N1CqAvGB!G1Cs     FTN)r/   r3   r0   r   )r  rA   r  r   	enumerater   r   r   r   r   
issubdtyperN   integer)rG   sizesfuncszarraysr   r  s   &     @rI   test_shape_and_dtypeTestIx_.test_shape_and_dtype  s    BII&DVV72d2h78F'F(:;
7AQWWQZ,N1771CNN1771CNNOaggrzz:; < '7s   D,
c                    . ROp\         P                  ! V4      w  p\        \         P                  ! V4      ^ ,          V4       R# )TN)TFTT)rA   nonzeror   r   )rG   bool_aint_as   &  rI   	test_boolTestIx_.test_bool  s.    *F#RVVF^A&.rX   c                T    . RO. RO.p\        \        \        P                  V4       R# )r'   Nrt   r/   r3   r1   )r   rE   rA   r   )rG   idx2ds   & rI   test_1d_onlyTestIx_.test_1d_only  s    I&j"&&%0rX   c                    ^p\         P                  ! V4      p\        W"4      p\        V^ ,          P                  V^34       \        V^,          P                  ^V34       \        VP                  V34       R# )r3   N)rA   r  r   r   r   )rG   length_of_vectorrw   outs   &   rI   test_repeated_inputTestIx_.test_repeated_input  sb    II&'!iSV\\$4a#89SV\\A'7#89QWW/12rX   rQ   N)r   r   r   r   r  r%  r+  r0  r5  r   r   r   s   @rI   r  r    s#     
*</
13 3rX   r  c                      \         \        P                  ! . RO.4      ^ ^ \        P                  ! . RO.4      3,          p \        V . RO.4       R# )r'   Nrt   r.  )r'   r   r0   r   r   r/   r3   r1   )r   rA   rF   r   )r   s    rI   test_c_r8    s9    
288YK !Q)(==>A-./rX   c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )TestFillDiagonali  c           	         \         P                  ! R\        4      p\        V^4       \	        V\         P
                  ! . RO. RO. RO.4      4       R# )r0   N)r0   r0   r3   r   r   r   r3   r   r   r   r3   rA   r   rS   r   r   rF   r  s   & rI   rJ   TestFillDiagonal.test_basic  s?    HHVS!arxx""$ %	rX   c                    \         P                  ! R\        4      p\        V^4       \	        V\         P
                  ! . RO. RO. RO. RO. RO. RO. RO. RO. RO. RO.
4      4       R# )rP   NrR   r<  r=  r>  r   r   r   r?  r  s   & rI   test_tall_matrix!TestFillDiagonal.test_tall_matrix  sT    HHWc"arxx"""""""""	$ 	%	rX   c                    \         P                  ! R\        4      p\        V^R4       \	        V\         P
                  ! . RO. RO. RO. RO. RO. RO. RO. RO. RO. RO.
4      4       R# )rP   TNrR   r<  r=  r>  rB  r?  r  s   & rI   test_tall_matrix_wrap&TestFillDiagonal.test_tall_matrix_wrap  sV    HHWc"aD!rxx"""""""""	$ 	%	rX   c           	         \         P                  ! R\        4      p\        V^4       \	        V\         P
                  ! . RO. RO. RO.4      4       R# )r0   N)r0   rP   )
r3   r   r   r   r   r   r   r   r   r   )
r   r3   r   r   r   r   r   r   r   r   )
r   r   r3   r   r   r   r   r   r   r   r?  r  s   & rI   test_wide_matrix!TestFillDiagonal.test_wide_matrix  s@    HHWc"arxx7779 :	rX   c                    \         P                  ! R\        4      p\        V^4       \         P                  ! . RO4      p\        \         P                  ! V^ 8g  4      W"W"34       R# )r0   N)r0   r0   r0   r0   r  )rA   r   rS   r   rF   r   where)rG   r   is   &  rI   test_operate_4d_array&TestFillDiagonal.test_operate_4d_array  sE    HH\3'aHHYRXXa1f%a|4rX   c                    \         P                  ! ^\        4      p\        \        R4      ;_uu_ 4        \        V^4       RRR4       R#   + '       g   i     R# ; i)r0   at least 2-dNrA   r   rS   r   rE   r   r  s   & rI   test_low_dim_handling&TestFillDiagonal.test_low_dim_handling  s8    HHQ ^<<!Q =<<<   AA	c                    \         P                  ! R\        4      p\        \        R4      ;_uu_ 4        \        V^4       RRR4       R#   + '       g   i     R# ; i)r0   equal lengthN)r0   r0   r4   r0   rR  r  s   & rI   test_hetero_shape_handling+TestFillDiagonal.test_hetero_shape_handling  s:     HH\3' ^<<!Q =<<<rU  rQ   N)r   r   r   r   rJ   rC  rF  rI  rN  rS  rX  r   r   r   s   @rI   r:  r:    s-       5    rX   r:  c            
      r   \        ^4      p \        P                  ! . RO. RO. RO. RO.4      p^dW&   \        V\        P                  ! . RO. RO. RO. R	O.4      4       \        ^^4      p\        P                  ! R
\
        4      p^W&   \        V\        P                  ! ^^ .^ ^ ..^ ^ .^ ^...4      4       R# )r/   N)r'   r   r0   r/   )r3   r1   r4   r?   )r@   rP      r>   )r9            )r   r   r0   r/   )r3   r   r4   r?   )r@   rP   r   r>   )r9   r\  r]  r   )r   r   r   )r   rA   rF   r   r   rS   )dir   d3s      rI   test_diag_indicesra    s    	aB
,!"$ 	%A AE	288^#%&( )
 
a	B 	C AAE	288q!f!f!f!f  
rX   c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestDiagIndicesFromi  c                    \         P                  P                  R4      p\        V4      w  r#\        V\         P                  ! ^4      4       \        V\         P                  ! ^4      4       R# )r/   Nr<   )rA   r   r   r   r  )rG   rw   rr   s   &   rI   test_diag_indices_from*TestDiagIndicesFrom.test_diag_indices_from  sF    IIV$ #1biil+1biil+rX   c                    \         P                  ! ^4      p\        \        R4      ;_uu_ 4        \	        V4       RRR4       R#   + '       g   i     R# ; i)r4   rQ  N)rA   r   r   rE   r   r|   s   & rI   test_error_small_input*TestDiagIndicesFrom.test_error_small_input  s3    GGAJ ^<<a  =<<<s   AA	c                    \         P                  ! R\        4      p\        \        R4      ;_uu_ 4        \        V4       RRR4       R#   + '       g   i     R# ; i)r0   rW  N)r0   r0   r   r0   )rA   r   rS   r   rE   r   r|   s   & rI   test_error_shape_mismatch-TestDiagIndicesFrom.test_error_shape_mismatch"  s6    HH\3' ^<<a  =<<<s   A

A	rQ   N)	r   r   r   r   rf  ri  rl  r   r   r   s   @rI   rc  rc    s     ,!
! !rX   rc  c                     \        \        ^^^4      4      p \        \        P                  ! R4      4       UUu. uF  w  rVNK	  	  ppp\        W4       \        \        R4      4      p \        W4       \        \        R4      4      p \        V \        \        ^4      4      4       \        \        4       4      p \        V R.4       \        \        R4      4      p \        V R.4       \        \        ^ .!  4      p \        V . 4       R# u uppi )r'   Nrt   r0   rQ   )r  r   r
   rA   r   r   r   )rw   ixer   s       rI   test_ndindexrr  (  s    WQ1A +BHHY,? @A @ur @HAq#WY Aq# 	WT]Aq$wqz*+ 	WYARDWR[ARD 	Wqc]AB' Bs   Dc                     \        \        P                  ! ^ ^4      4      . 8X  g   Q h\        \        P                  ! ^^ ^4      4      . 8X  g   Q h\        \        P                  ! ^ 4      4      . 8X  g   Q hR# )zJTest ndindex produces empty iterators for explicit
zero-length dimensions.N)r  rA   r   rQ   rX   rI   %test_ndindex_zero_dimensions_explicitrt  @  s]     

1a !R'''

1a#$***

1"$$$rX   	bad_shapeg      @2c                    \         P                  ! \        4      ;_uu_ 4        \        \        P
                  ! V 4      4       RRR4       R#   + '       g   i     R# ; i)z1Test that non-integer dimensions raise TypeError.N)r   raisesrC   r  rA   r   )ru  s   &rI   #test_ndindex_non_integer_dimensionsry  H  s5     
y	!	! 	RZZ	"# 
"	!	!	!    AA	c                     \         P                  ! ^^4      p \        V 4       \        P                  ! \
        4      ;_uu_ 4        \        V 4       RRR4       R#   + '       g   i     R# ; i)z<Test that StopIteration is raised properly after exhaustion.N)rA   r   r  r   rx  StopIterationnext)its    rI   $test_ndindex_stop_iteration_behaviorr  Q  s>    	Aq	BH	}	%	%R 
&	%	%	%s   AA,	c                     Rp \         P                  ! V !  p\         P                  ! V !  p\        V4       \        V4       \        \        V4      R4       \        \        V4      R4       R# )z>Test that each ndindex instance creates independent iterators.Nr   r0   r  r-   rA   r   r}  r   )r   iter1iter2s      rI   "test_ndindex_iterator_independencer  [  sM    EJJEJJEKKef%ef%rX   c                    \        \        \        P                  ! ^4      4      \        \        P                  ! R4      4      4       \        \        \        P                  ! ^^4      4      \        \        P                  ! R4      4      4       Rp \        \        \        P                  ! V !  4      \        \        P                  ! V 4      4      4       R# )zBTest that ndindex(shape) and ndindex(*shape) produce same results.N)r3   r  r2   )r   r  rA   r   r   s    rI   &test_ndindex_tuple_vs_args_consistencyr  h  s     bjjm$d2::d+;&<= bjjA&'bjj.@)AB Ebjj%()4

50A+BCrX   c                     R Fj  p \        \        P                  ! V 4      4      p\        P                  ! \        P                  ! V 4      4       UUu. uF  w  r#VNK	  	  ppp\        W4       Kl  	  R# u uppi )z2Test ndindex produces same indices as ndenumerate.N)rt   ro  r%   rQ   )r  rA   r   r
   r   r   )r   ndindex_resultrp  _ndenumerate_indicess        rI   .test_ndindex_against_ndenumerate_compatibilityr  u  sT    .bjj/0/1~~bhhuo/NO/Nebr/NO>? /Os   A3c                 b    Rp \        \        P                  ! V !  4      p. ROp\        W4       R# )zBTest ndindex produces correct indices for multidimensional arrays.N)r   r'   r0   )rB  )r   r   r'   )r   r   r   )r'   r   r   )r'   r   r'   )r'   r   r   )r  rA   r   r   )r   resultr   s      rI   )test_ndindex_multidimensional_correctnessr  }  s+    E"**e$%FH "rX   c                 `    Rp \         P                  ! V !  p\        V4      p\        VR4       R# )zFTest ndindex behaves correctly when initialized with large dimensions.N)  r  r  r  )large_shapeiter_objfirst_elements      rI   &test_ndindex_large_dimensions_behaviorr    s(    Kzz;'HNM'rX   c                 "   \         P                  ! ^ ^4      p \        \        V 4      . 4       \         P                  ! ^^ ^4      p\        P
                  ! \        4      ;_uu_ 4        \        V4       RRR4       R#   + '       g   i     R# ; i)z*Test detailed behavior of empty iterators.N)rA   r   r   r  r   rx  r|  r}  )
empty_iterempty_iter2s     rI   $test_ndindex_empty_iterator_behaviorr    sY    Aq!Jj!2&**Q1%K	}	%	%[ 
&	%	%	%s   'A==B	negative_shape_argc                    \         P                  ! \        4      ;_uu_ 4        \        V 4       RRR4       R#   + '       g   i     R# ; i)z/Test that negative dimensions raise ValueError.N)r   rx  rE   r   )r  s   &rI    test_ndindex_negative_dimensionsr    s+     
z	"	""# 
#	"	"	"s	   9A
	c                      ^ RI p \        V P                  ! 4       4      R.8X  g   Q h\        V P                  ! R4      4      R.8X  g   Q hR# )r   NrQ   )numpyr  r   )rA   s    rI   test_ndindex_empty_shaper    s=    

"%%%

2B4'''rX   c                      \         P                  ! \        4      ;_uu_ 4        \        \        P
                  ! R4      4       RRR4       R#   + '       g   i     R# ; i)r'   Nr+   )r   rx  rE   r  rA   r   rQ   rX   rI    test_ndindex_negative_dim_raisesr    s0    	z	"	"RZZ^ 
#	"	"	"rz  )g       @r0   ))r+   )r   r,   r/   )r3   r   r   )1r   r  rA   numpy.lib._index_tricks_implr   r   r   r   r   r   r	   r
   r   r   r   r   numpy.testingr   r   r   r   r   r   r   r   r   r   r  r  r  r8  r:  ra  rc  rr  rt  r   r   ry  r  r  r  r  r  r  r  r  r  r  rQ   rX   rI   <module>r     s.         pJ pJdr/ r/j'? '?TK K= ='3 '3T0
D  D N
8! !&0% sC!Q&BC$ D$
&
D@#( $$(rX   