+
    :i                        ^ RI Ht ^ RIHt ^ RIt^ RIt^ RIHtH	t	H
t
Ht ^ RIHt ^ RIHtHt ^ RIHtHt RR	/tR
R	RR	/tR t]	R 4       t]	R 4       tR tR tR tR tR tR tR tR t R t!R t"]	R 4       t#]	R 4       t$]	R 4       t%]	R 4       t&]	R 4       t'R t(R t)R  t*R! t+R" t,R# t-R$ t.]	R1R% l4       t/R& t0R' t1R2R( lt2R) t3R* t4R+ t5R, t6R- t7 ! R. R/]]4      t8]9R08X  d   ]Pt                  ! 4        R# R# )3    )partial)permutationsN)jitnjit
from_dtypetypeof)TypingError)typeserrors)TestCaseMemoryLeakMixinforceobjT_nrtnopythonc                   a  V 3R lpV# )a  Decorator for generic check functions.
Iterates over 'pyfuncs_to_use', calling 'func' with the iterated
item as first argument. Example:

@from_generic(numpy_array_reshape, array_reshape)
def check_only_shape(pyfunc, arr, shape, expected_shape):
    # Only check Numba result to avoid Numpy bugs
    self.memory_leak_setup()
    got = generic_run(pyfunc, arr, shape)
    self.assertEqual(got.shape, expected_shape)
    self.assertEqual(got.size, arr.size)
    del got
    self.memory_leak_teardown()
c                    <a  V V3R  lpV# )c                  F   < S Uu. uF  pS! V.V O5/ VB NK  	  up# u upi N )argskwargspyfuncfuncpyfuncs_to_uses   *, a/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_array_manipulation.pyresult/from_generic.<locals>.decorator.<locals>.result!   s*    @NOfD1$1&1OOOs   r   )r   r   r   s   f r   	decoratorfrom_generic.<locals>.decorator    s    	P    r   )r   r   s   f r   from_genericr!      s     r    c                 $    V P                  V4      # r   )reshapearrnewshapes   &&r   array_reshaper'   '   s    ;;x  r    c                 .    \         P                  ! W4      # r   )npr#   r$   s   &&r   numpy_array_reshaper*   +   s    ::c$$r    c                 .    \         P                  ! W4      # r   r)   broadcast_to)r%   shapes   &&r   numpy_broadcast_tor/   0   s    ??3&&r    c                  *    \         P                  ! V !  # r   )r)   broadcast_shapesr   s   *r   numpy_broadcast_shapesr3   4       %%r    c                  *    \         P                  ! V !  # r   )r)   broadcast_arraysr2   s   *r   numpy_broadcast_arraysr7   8   r4   r    c                 <    \         P                  ! W4      V,          # r   r,   )r%   r.   idxs   &&&r   numpy_broadcast_to_indexingr:   <   s    ??3&s++r    c                 "    V P                  4       # r   )flattenas   &r   flatten_arrayr?   @       99;r    c                 "    V P                  4       # r   ravelr=   s   &r   ravel_arrayrD   D   s    779r    c                 6    V P                  4       P                  # r   )rC   sizer=   s   &r   ravel_array_sizerG   H   s    779>>r    c                 .    \         P                  ! V 4      # r   )r)   rC   r=   s   &r   numpy_ravel_arrayrI   L   s    88A;r    c                 "    V P                  4       # r   	transposer=   s   &r   transpose_arrayrM   P   s    ;;=r    c                 .    \         P                  ! V 4      # r   r)   rL   r=   s   &r   numpy_transpose_arrayrP   T   s    <<?r    c                 0    \         P                  ! WR 7      # )axesrO   r%   rS   s   &&r    numpy_transpose_array_axes_kwargrU   X   s    <<''r    c                 L    \         P                  ! WR 7      P                  4       # rR   )r)   rL   copyrT   s   &&r   %numpy_transpose_array_axes_kwarg_copyrX   ]   s    <<',,..r    c                 $    V P                  V4      # r   rK   rT   s   &&r   array_transpose_axesrZ   b   s    ==r    c                 @    V P                  V4      P                  4       # r   )rL   rW   rT   s   &&r   array_transpose_axes_copyr\   g   s    ==##%%r    c                 \   \         P                  ! \         P                  ! W,          ^,          4      V ^V34      p\         P                  ! \         P                  ! V^,          4      V^34      pW#P                  ,
          P                  p\         P                  ! VR4      pV^,           pV# )   )   r      )r)   r#   arangeTrL   )mnr1r2r_difzs   &&    r   transpose_issue_4708ri   l   su    	BIIaeai(1a)	4B	BIIa!e$q!f	-B$$YMMELL	*E	AHr    c                 "    V P                  4       # r   )squeezer=   s   &r   squeeze_arrayrl   v   r@   r    c                 .    \         P                  ! W4      # r   )r)   expand_dims)r>   axiss   &&r   rn   rn   z   s    >>!""r    c                  *    \         P                  ! V !  # r   )r)   
atleast_1dr2   s   *r   rq   rq   ~       ==$r    c                  *    \         P                  ! V !  # r   )r)   
atleast_2dr2   s   *r   rt   rt      rr   r    c                  *    \         P                  ! V !  # r   )r)   
atleast_3dr2   s   *r   rv   rv      rr   r    c                     V P                   ^ ,          ^,          3V P                   R,          ,           p\        P                  P                  P	                  WR7      # )r   :r`   NNstrides)ry   r)   libstride_tricks
as_strided)r>   ry   s   & r   as_strided1r}      sB    yy|q "QYYr]2G66**1*>>r    c                    ^pV P                   RR V P                   R,          V,
          ^,           V3,           pV P                  V P                  R,          3,           p\        P                  P                  P                  WVR7      # )r^   N)r.   ry   )r.   ry   r)   rz   r{   r|   )r>   windowr.   ry   s   &   r   as_strided2r      sk    FGGCRLAGGBK&014f==Eii199R=**G66**17*KKr    c                 X    \         P                  P                  P                  WVR 7      # ))ro   )r)   rz   r{   sliding_window_view)xwindow_shapero   s   &&&r   r   r      s"    6633A$3OOr    c                 D    V P                   3pV P                  pR WV3&   R# )      ?N)r   y)r%   arr2dr   r   s   &&  r   	bad_indexr      s!    AAEQ$Kr    c                     V R,          # )r`   )r`   g       @r   r%   s   &r   bad_float_indexr      s     v;r    c                 0    \         P                  ! WV4      # r   )r)   fill_diagonal)r%   valwraps   &&&r   numpy_fill_diagonalr      s    Cd++r    c                 .    \         P                  ! V 4      # r   )r)   r.   r   s   &r   numpy_shaper      s    88C=r    c                 .    \         P                  ! V 4      # r   )r)   rF   r   s   &r   
numpy_sizer      s    773<r    c                 .    \         P                  ! V 4      # r   )r)   flatnonzeror=   s   &r   numpy_flatnonzeror      s    >>!r    c                 .    \         P                  ! V 4      # r   )r)   argwherer=   s   &r   numpy_argwherer      s    ;;q>r    c                 .    \         P                  ! W4      # r   )r)   resize)r>   	new_shapes   &&r   numpy_resizer      s    99Q""r    c                     a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR t]R3R ltR t]3R lt]3R ltR tR t]3R ltR t]3R ltR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,R* t-R+ t.R, t/R- t0R. t1R/ t2]3R0 4       t4R1 t5R2 t6R3 t7R4 t8R5 t9R6 t:R7 t;R8 t<R9 t=R: t>R; t?R< t@R= tAR> tBR? tCR@tDV tERA# )BTestArrayManipulationz,
Check shape-changing operations on arrays.
c                   a aaaa	 \         \        .pR  o	\        V4      V	V 3R l4       o\        V4      V	V 3R l4       o\        V4      V	V 3R l4       p\        V4      V	V 3R l4       o\        V4      V	V 3R l4       p\        P                  ! ^4      pS! VR4       S! VR	4       S! VR
4       S! VR4       S! VR4       \        P                  ! ^4      P                  R4      pS! VR4       S! VR	4       S! VR
4       S! VR4       S! VR4       S! VR4       S! VR4       S! VR4       \        P                  ! ^4      P                  R4      pS! VR4       S! VR	4       S! VR
4       S! VR4       \        P                  ! ^4      P                  R4      P                  pS! VR4       S! VR4       V! VR4       V! VR4       V! VR4       \        P                  ! ^4      P                  ^^4      pS! VR4       S! VR4       S! VR4       S! VR4       S! VR4       S! VR4       V! VR4       V! VR4       VVV3R lp\        P                  ! . 4      pV! V4       V! VP                  R4      4       S P                  4        R# )c                     V ! W4      # r   r   )r   r%   r.   s   &&&r   generic_run=TestArrayManipulation.test_array_reshape.<locals>.generic_run   s    #%%r    c                    < V P                  W4      pSP                  4        S! WV4      pSP                  WC4       ?SP                  4        R # r   )py_funcmemory_leak_setupassertPreciseEqualmemory_leak_teardown)r   r%   r.   expectedgotr   selfs   &&&  r   check7TestArrayManipulation.test_array_reshape.<locals>.check   sF    ~~c1H""$f51C##C2%%'r    c                    < SP                  4        S! WV4      pSP                  VP                  V4       SP                  VP                  VP                  4       ?SP	                  4        R # r   )r   assertEqualr.   rF   r   )r   r%   r.   expected_shaper   r   r   s   &&&& r   check_only_shapeBTestArrayManipulation.test_array_reshape.<locals>.check_only_shape   sX     ""$f51CSYY7SXXsxx0%%'r    c                    < SP                  \        4      ;_uu_ 4       pS! WV4       R R R 4       SP                  \        XP                  4      R4       R #   + '       g   i     L7; i)Nzincompatible shape for array)assertRaisesNotImplementedErrorr   str	exceptionr   r%   r.   raisesr   r   s   &&& r   check_err_shapeATestArrayManipulation.test_array_reshape.<locals>.check_err_shape   sM    ""#6776F/ 8S!1!12;= 87   
AA(	c                    < SP                  \        4      ;_uu_ 4       pS! WV4       R R R 4       SP                  \        XP                  4      R4       R #   + '       g   i     L7; i)Nz)total size of new array must be unchangedr   
ValueErrorr   r   r   r   s   &&& r   check_err_size@TestArrayManipulation.test_array_reshape.<locals>.check_err_size   sM    "":..&F/ /S!1!12HJ /.r   c                    < SP                  \        4      ;_uu_ 4       pS! WV4       R R R 4       SP                  \        XP                  4      R4       R #   + '       g   i     L7; i)Nzmultiple negative shape valuesr   r   s   &&& r   check_err_multiple_negativeMTestArrayManipulation.test_array_reshape.<locals>.check_err_multiple_negative   sL    "":..&F/ /S!1!12=? /.r   c                    < S! V ^ 4       S! V R4       S! V R4       S! V R4       S! V RR4       S! V RR4       S! V RR4       S! V R	R
4       S! V RR4       S! V R4       S! V ^4       S! V R4       R# )r   Nr   )r`   r   r_   )r   7   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   s   &r   check_empty=TestArrayManipulation.test_array_reshape.<locals>.check_empty  s    #qM#t#y!#'(S"d+S%.S'62S'62S*i83#3"3'r    N)   )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   r   )r   r   )r   r   r   )r   r   r   r   )r^   r_   r   )	r'   r*   r!   r)   ra   r#   rb   arraydisable_leak_check)
r   r   r   r   r%   r   r   r   r   r   s
   f     @@@@r   test_array_reshape(TestArrayManipulation.test_array_reshape   sw   ')<=	& 
n	%	( 
&	( 
n	%	( 
&	( 
n	%	= 
&	= 
n	%	J 
&	J 
n	%	? 
&	? iimc5c6c6c9c%&iim##I.c5c6c6c9c%&sBsE"sF#iim##$67c5c6c6c9 iim##I.00c9c()Y'V$W% iim##Aa(c2c5c7c:c:sG$#C8#C8	( hhrlCCKK	*+ 	!r    c           	     >  a  \         \        \        \        .p\	        V4      V 3R  l4       p\	        V4      V 3R l4       p\	        V4      V 3R l4       p\	        V4      V 3R l4       p\
        P                  ! ^4      \
        P                  ! ^4      P                  ^^4      \
        P                  ! ^4      P                  ^^^4      \
        P                  ! ^4      P                  ^^^^4      \
        P                  ! ^@4      P                  ^^^4      R,          .p\        \        V4      4       F  pV! Wg,          R4       \        \        \        Wg,          P                  4      4      4       FM  p\        V4      p	\        V U
u. uF  qV	,
          NK  	  up
4      pV! Wg,          V4       V! Wg,          V4       KO  	  K  	  \	        \        .4      R 4       pV! ^^4       V! ^^4       V! ^^4       S P                  4        V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^ ,          R4       V! V^ ,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       V! V^,          R4       S P                  \         4      ;_uu_ 4       p\#        RR	7      ! \$        4      ! \
        P&                  ! ^ ^.4      34       RRR4       S P)                  R
\+        XP,                  4      4       R# u up
i   + '       g   i     L<; i)c                 D  < V P                  W4      pV ! W4      pSP                  WC4       SP                  VP                  P                  VP                  P                  4       SP                  VP                  P
                  VP                  P
                  4       R # r   )r   r   r   flagsf_contiguousc_contiguous)r   r%   rS   r   r   r   s   &&&  r   r   >TestArrayManipulation.test_array_transpose_axes.<locals>.check9  sw    ~~c0H#C##C2SYY33%^^88:SYY33%^^88:r    c                    < SP                  \        4      ;_uu_ 4       pV ! W4       R R R 4       SP                  \        XP                  4      R4       R #   + '       g   i     L7; i)Nzrepeated axis in transposer   r   r%   rS   r   r   s   &&& r   check_err_axis_repeatedPTestArrayManipulation.test_array_transpose_axes.<locals>.check_err_axis_repeatedC  sJ    "":..&s! /S!1!129; /.   	AA'	c                    < SP                  \        4      ;_uu_ 4       pV ! W4       R R R 4       SP                  \        XP                  4      R4       R #   + '       g   i     L7; i)Nz2axis is out of bounds for array of given dimensionr   r   s   &&& r   check_err_axis_oobKTestArrayManipulation.test_array_transpose_axes.<locals>.check_err_axis_oobJ  sK    "":..&s! /S!1!12QS /.r   c                    < SP                  \        \        34      ;_uu_ 4        V ! W4       R R R 4       R #   + '       g   i     R # ; ir   )r   	TypeErrorr	   )r   r%   rS   r   s   &&&r   check_err_invalid_argsOTestArrayManipulation.test_array_transpose_axes.<locals>.check_err_invalid_argsQ  s0    ""I{#;<<s! =<<<s	   	8A		Nc                 v    V P                  W4      pV ! W4      p\        P                  P                  WC4       R # r   )r   r)   testingassert_equal)r   rc   rd   r   r   s   &&&  r   check_issue_4708ITestArrayManipulation.test_array_transpose_axes.<locals>.check_issue_4708f  s-    ~~a+H,C JJ##C2r    foog333333@Tr   z#np.transpose does not accept tuples):NNr^   :NNr_   NNN)r   )333333?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_   )rU   rX   rZ   r\   r!   r)   ra   r#   rangelenr   tuplendimri   r   r   r	   r   rP   r   assertInr   r   )r   r   r   r   r   r   arrsirS   r  r   neg_axesr   es   f             r   test_array_transpose_axes/TestArrayManipulation.test_array_transpose_axes3  s   :?.35
 
n	%	: 
&	: 
n	%	; 
&	; 
n	%	S 
&	S 
n	%	" 
&	" 		"		"%%a+		"%%aA.		"%%aAq1		"%%aA.y9	; s4y!A$'4 $U5+>%?@4y D!9Dqd((D!9:dgt$dgx(	 A	 " 
+,	-	3 
.	3 	AAA 	!tAw.tAw1tAw,tAw1Q0Q3Q647D)47E*47F+47G,47G,47I.47J/47L147M2{++q45rxxA7G6IJ ,;AKK(	*Q ":L ,+s   N$4NN	c                    \         p\        V4      pR  pV! 4        F#  w  rEV P                  V! WE4      V! WE4      4       K%  	  R# )c               3     "   \         P                  ! ^^.^^..4      R3x  \         P                  ! ^^.^^..4      R3x  \         P                  ! ^^.^^..4      R3x  \         P                  ! ^^.^^..4      R3x  \         P                  ! ^^.^^..4      R3x  \         P                  ! ^^.^^..4      R3x  \         P                  ! ^ \        R7      R	3x  \         P                  ! ^^.^^..4      R
3x  \         P                  ! ^^.^^..4      ^3x  \         P                  ! R\        R7      R	3x  \         P                  ! . \        R7      R3x  . ROR3x  Rx  R# 5i)r`   dtypeN)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   zerosfloatintr   r    r   inputs=TestArrayManipulation.test_numpy_resize_basic.<locals>.inputs  s_    ((QFQF+,f44((QFQF+,f44((QFQF+,f44((QFQF+,d22((QFQF+,f44((QFQF+,f44((1e,f44((QFQF+,d22((QFQF+,a//((63/77((2u-v55&&Os   E/E1N)r   r   r   )r   r   cfuncr  r>   r   s   &     r   test_numpy_resize_basic-TestArrayManipulation.test_numpy_resize_basic  s?    V	" #HLA##F1$8%:MN %r    c           	        V P                  4        \        \        4      pV P                  \        4      ;_uu_ 4       pV! R R4       RRR4       V P                  R\        XP                  4      4       V P                  \        4      ;_uu_ 4       pV! \        P                  ! ^ ^.^^..4      R 4       RRR4       V P                  R\        VP                  4      4       V P                  \        4      ;_uu_ 4       pV! \        P                  ! ^ ^.^^..4      R4       RRR4       V P                  R\        VP                  4      4       V P                  \        4      ;_uu_ 4       pV! \        P                  ! ^ ^.^^..4      R4       RRR4       V P                  R\        VP                  4      4       R#   + '       g   i     EL; i  + '       g   i     EL(; i  + '       g   i     L; i  + '       g   i     Lr; i)abcNz#The argument "a" must be array-likezBThe argument "new_shape" must be an integer or a tuple of integersz0All elements of `new_shape` must be non-negativer  )r   r^   r   )r   r   r   r   r	   r  r   r   r)   r   r   )r   r  r   s   &  r   test_numpy_resize_exception1TestArrayManipulation.test_numpy_resize_exception  s   !\"{++v%  ,<&**+	- {++v"((QqE1Q%=)51 , -&**+	- z**f"((QqE1Q%=)73 +I&**+	- z**f"((QqE1Q%=)2. +I&**+	-% ,++
 ,++ +*
 +*s/   
G $G?$G(-$G; G	G%	(G8	;H	c                f  a aaa \         o\        S4      oVVV 3R  loV3R lp\        P                  ! ^4      pV! V4       \        P                  ! ^4      P	                  R4      pV! V4       V! VP
                  4       V! VRRR1,          4       \        P                  ! ^*4      pV! V4       R# )c                    < S! W4      pSP                  4        S! W4      pSP                  W24       ?SP                  4        R # r   )r   r   r   )r%   ro   r   r   r  r   r   s   &&  r   r   5TestArrayManipulation.test_expand_dims.<locals>.check  s@    c(H""$"C##C2%%'r    c                    < \        V P                  ) ^,
          V P                  ^,           4       F  pS! W4       K  	  R# )r`   N)r   r  )r%   ro   r   s   & r   check_all_axes>TestArrayManipulation.test_expand_dims.<locals>.check_all_axes  s.    sxxi!mSXX\:c  ;r    Nr   r   )rn   r   r)   ra   r#   rb   r   )r   r$  r%   r  r   r   s   f  @@@r   test_expand_dims&TestArrayManipulation.test_expand_dims  s    V	(	!
 iilsiim##I.ssuus4R4y!hhrlsr    c                   \         p\        R R7      ! V4      p\        P                  ! ^4      pV P	                  4       ;_uu_ 4       pV! R^4       RRR4       V P                  R\        XP                  4      4       V P	                  4       ;_uu_ 4       pV! VR4       RRR4       V P                  R\        VP                  4      4       R#   + '       g   i     L; i  + '       g   i     LJ; i)Tr   helloNz#First argument "a" must be an arrayz"Argument "axis" must be an integer)rn   r   r)   ra   assertTypingErrorr  r   r   )r   r   r  r%   r   s   &    r   test_expand_dims_exceptions1TestArrayManipulation.test_expand_dims_exceptions  s    T"6*iil##%%'1 &;SAQAQ=RS##%%#w &:C@P@P<QR &% &%s   
C
C"C	"C2	c                  a aaa V 3R  loVVV3R lpVVVV 3R lp\         P                  ! ^*4      p\         P                  ! R4      pV! V4       V! WV4       \         P                  ! ^4      p\         P                  ! ^4      R,           pVRRR1,          p	V! V4       V! WxV	4       \         P                  ! ^4      P                  R4      p
V
P                  pV
RRR1,          pV! V
4       V! WV4       \         P                  ! ^4      P                  R4      pVP                  pVRRR1,          pV! V4       V! WV4       \         P                  ! ^4      P                  R	4      pV! V4       V! WXW4       R# )
c                    < SP                  W4       SP                  V P                  4       VP                  4       4       R # r   )assertStridesEqualr   r<   )r   r   r   s   &&r   check_result<TestArrayManipulation.check_atleast_nd.<locals>.check_result  s2     ##C2##CKKM83C3C3EFr    c                 2   < S! S! V 4      S! V 4      4       R # r   r   )argr  r0  r   s   &r   check_single<TestArrayManipulation.check_atleast_nd.<locals>.check_single  s    sVC[1r    c                     < S! V !  pS! V !  pSP                  \        V4      \        V4      4       \        W!4       F  w  r4S! W44       K  	  R # r   )r   r  zip)	r   expected_tuple	got_tupler   r   r  r0  r   r   s	   *    r   check_tuple;TestArrayManipulation.check_atleast_nd.<locals>.check_tuple  sH    #T]NtIS^S-@A!$Y!?S+ "@r    y              @              ?Nr   r  r   )r_   r_   r_   r_   )r)   r   ra   r#   rb   )r   r   r  r4  r:  a1a2b1b2b3c1c2c3d1d2d3r  r0  s   fff              @r   check_atleast_nd&TestArrayManipulation.check_atleast_nd  s+   	G	2	, 	, XXb\XXb\RBYYq\YYq\B"XRBBYYq\!!&)TT"XRBBYYr]""9-TT"XRBBIIbM!!,/QBB#r    c                X    \         p\        R R7      ! V4      pV P                  W4       R# Tr   N)rq   r   rH  r   r   r  s   &  r   test_atleast_1d%TestArrayManipulation.test_atleast_1d  $    T"6*f,r    c                X    \         p\        R R7      ! V4      pV P                  W4       R# rK  )rt   r   rH  rL  s   &  r   test_atleast_2d%TestArrayManipulation.test_atleast_2d  rO  r    c                X    \         p\        R R7      ! V4      pV P                  W4       R# rK  )rv   r   rH  rL  s   &  r   test_atleast_3d%TestArrayManipulation.test_atleast_3d"  rO  r    c                   a aa \        S4      oVVV 3R  lp\        P                  ! ^4      pV! V4       V! VP                  R4      4       V! VP                  R4      4       R# )c                 J   < S! V 4      pS! V 4      pSP                  W!4       R # r   r   )r%   r   r   r  r   r   s   &  r   r   5TestArrayManipulation.check_as_strided.<locals>.check*  s#    c{H*C##C2r    Nr   )r   r`   r   )r   r)   ra   r#   )r   r   r   r%   r  s   ff  @r   check_as_strided&TestArrayManipulation.check_as_strided'  sI    V	3
 iimc
ckk&!"ckk)$%r    c                Z    V P                  \        4       V P                  \        4       R # r   )rZ  r}   r   r   s   &r   test_as_strided%TestArrayManipulation.test_as_strided4  s    k*k*r    c                    \         R  4       pV P                  \        P                  4      ;_uu_ 4       pV! 4        RRR4       RpV P	                  V\        XP                  4      4       R#   + '       g   i     L9; i)c                      \         P                  ! ^4      P                  R4      p \         P                  P                  P                  V RR7      # )r   Nrx   r   )r)   ra   r#   rz   r{   r|   r   s    r   r   >TestArrayManipulation.test_as_strided_stride_none.<locals>.foo:  s:    ))B-''/C66''2232EEr    Nzstrides argument cannot be None)r   r   r   r	   r  r   r   )r   r   r   msgs   &   r   test_as_strided_stride_none1TestArrayManipulation.test_as_strided_stride_none8  sd    		F 
	F v1122fE 3 0c3v//01	 32s   A--A=	c                  a  V 3R  lp\         P                  ! ^4      pR F2  pS P                  RV 24      ;_uu_ 4        V! V^V4       RRR4       K4  	  \         P                  ! ^4      P                  ^
^4      pR F2  pS P                  RV 24      ;_uu_ 4        V! V^V4       RRR4       K4  	  R F2  pS P                  RV 24      ;_uu_ 4        V! VR	V4       RRR4       K4  	  \         P                  ! ^4      P                  ^^^^4      pR
 F2  pS P                  RV 24      ;_uu_ 4        V! VRV4       RRR4       K4  	  S P                  R4      ;_uu_ 4        V! VRR4       RRR4       R#   + '       g   i     EKl  ; i  + '       g   i     EK#  ; i  + '       g   i     K  ; i  + '       g   i     K  ; i  + '       g   i     R# ; i)c                    < \         P                  P                  P                  WVR R7      p\        WV4      pSP	                  WC4       R# )T)	writeableN)r)   rz   r{   r   r   )r%   r   ro   r   r   r   s   &&&  r   r   =TestArrayManipulation.test_sliding_window_view.<locals>.checkF  sF    vv++??44 @ H &c>C##C2r    Nz1d array, axis=z2d array, axis=z4d array, axis=z2d array, repeated axes)Nr   r   r   r   )Nr   r`   r`   r   )r`   r   )r   r   )r   )r   r   r^   r_   )r   r^   r^   )r   r`   r   )r)   ra   subTestr#   )r   r   arr1ro   arr2arr4s   f     r   test_sliding_window_view.TestArrayManipulation.test_sliding_window_viewE  s   	3 yy}'Dv677dAt$ 87 (
 yy~%%b"-Dv677dAt$ 87 
 4Dv677dFD) 87 4
 yy~%%aAq1&Dv677dFD) 87 '
 \\344$	9- 54+ 877 877
 877 877 544s;   E:FF$5F8%G:FF!$F58G	G	c                  a  V 3R  lpV 3R lpS P                  4        \        P                  ! ^4      p\        P                  ! ^4      P                  ^
^4      pS P	                  R4      ;_uu_ 4        V! RV^R4       RRR4       S P	                  R4      ;_uu_ 4        V! RVRR4       RRR4       S P	                  R4      ;_uu_ 4        V! RVRR4       RRR4       S P	                  R4      ;_uu_ 4        V! RVRR4       RRR4       S P	                  R	4      ;_uu_ 4        V! R
VRR4       RRR4       S P	                  R4      ;_uu_ 4        V! R
VR^4       RRR4       S P	                  R4      ;_uu_ 4        V! R
V^R4       RRR4       S P	                  R4      ;_uu_ 4        V! RV^^4       RRR4       S P	                  R4      ;_uu_ 4        V! RV^R4       RRR4       S P	                  R4      ;_uu_ 4        V! RVR R!4       RRR4       S P	                  R4      ;_uu_ 4        V! RVR R"4       RRR4       S P	                  R4      ;_uu_ 4        V! RVR4       RRR4       S P	                  R4      ;_uu_ 4        V! RVR4       RRR4       S P	                  R4      ;_uu_ 4        V! RVR#4       RRR4       S P	                  R4      ;_uu_ 4        V! RV^R4       RRR4       S P	                  R4      ;_uu_ 4        V! RV^R#4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELh; i  + '       g   i     ELO; i  + '       g   i     EL6; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELq; i  + '       g   i     ELX; i  + '       g   i     R# ; i)$c                    < SP                  \        4      ;_uu_ 4       p\        V!   R R R 4       SP                  V \	        XP
                  4      4       R #   + '       g   i     L7; ir   )r   r   r   r  r   r   rc  r   r   r   s   &* r   _raisesFTestArrayManipulation.test_sliding_window_view_errors.<locals>._raisesj  sE    "":..&#T* /MM#s6#3#345 /.r   c                    < SP                  \        P                  4      ;_uu_ 4       p\        V!   R R R 4       SP	                  V \        XP                  4      4       R #   + '       g   i     L7; ir   )r   r   r	   r   r  r   r   ru  s   &* r   _typing_errorLTestArrayManipulation.test_sliding_window_view_errors.<locals>._typing_erroro  sK    ""6#5#566&#T* 7MM#s6#3#345 76s   
A""A2	z1d window shape too largezwindow_shape cannot be largerNz2d window shape too largez1d window negative sizez&`window_shape` cannot contain negativez2d window with a negative sizez1d array, 2d window shapez%matching length window_shape and axisz$2d window shape, only one axis givenz1d window shape, 2 axes givenz1d array, second axiszArgument axis out of boundsz1d array, axis -2z2d array, fourth axisz2d array, axis -3zwindow_shape=Nonez3window_shape must be an integer or tuple of integerzwindow_shape=float@zwindow_shape=tuple(float)z
axis=floatz1axis must be None, an integer or tuple of integerzaxis=tuple(float))r      r   )r   r   )
   r_   r   r   )r   r   r   r^   r   )r{  )r   r)   ra   r#   rm  )r   rv  ry  rn  ro  s   f    r   test_sliding_window_view_errors5TestArrayManipulation.test_sliding_window_view_errorsi  sJ   	6
	6 	!yy}yy~%%b"- \\5663T2tD 7\\5663T7DI 7\\344<dBM 5\\:;;<dGTR < \\566;T7DQ 7\\@AA;T7AN B\\9::;T1fM ; \\12214A> 3\\-..14B? /\\12214H 3\\-..14I / \\-..EtT / \\.//EtS 0 \\566EtV 7 \\,''CT1c ( \\-..CT1f /.Y 766666444;;; 766AAA::: 322...222... /.. 0// 766 ('' /..s   3L) L=M:M%'M9NN!.N5O	O5O1"PP:P-&QQ)L:	=M	M"	%M6	9N
	N	!N2	5O		O	O.	1P	P	P*	-P>	Q	Q&	Cc                   \         P                  ! ^	4      P                  ^^4      pVR8X  d   VP                  p\        p\        V4      pVR8X  d   VP                  RR7      pV P                  VP                  V4       \        V33/ VB ! V4      pV! V4      pV! V4      p\         P                  P                  Wx4       R# )	   FA)layoutN)r)   ra   r#   rb   r?   r   rW   r   r  r   r   r   )	r   r   r  r>   r   
arraytype1r  r   r   s	   &&&      r   test_flatten_array(TestArrayManipulation.test_flatten_array  s    IIaL  A&S=AAY
S=#4J**F3ZM+U+F3!9Ah


.r    c                    V P                  \        R 7       V P                  \        RR7       V P                  \        RR7       R# )r   r  )r   r  r  N)r  no_pyobj_flagsr]  s   &r   test_flatten_array_npm,TestArrayManipulation.test_flatten_array_npm  s9    n5nSAnSAr    c           	       a aaa VV 3R  lp\        V\        4      o\        V\        4      oVV3R lpV! \        P                  ! ^	4      P                  ^^4      RR7       V! \        P                  ! ^	4      P                  ^^RR7      RR7       V! \        P                  ! ^4      P                  ^^^4      R,          RR7       V! \        P                  ! ^4      P                  ^^^4      RR7       V! \        P                  ! ^4      P                  ^^^RR7      RR7       V! \        P                  ! ^$4      P                  ^^^^4      R	,          RR7       R# )
c                   < \        V4      pS
P                  VP                  V4       \        V33/ S	B ! V 4      pV ! V4      pV! V4      p\        P
                  P                  WV4       VP                  P                  VP                  P                  8g  pVP                  P                  VP                  P                  8g  pS
P                  WrR 8g  4       S
P                  Wx4       R# )r  N)	r   r   r  r   r)   r   r   ctypesdata)r   r>   assume_layoutr  r  r   r   	py_copied	nb_copiedr   r   s   &&&      r   generic_check=TestArrayManipulation.test_ravel_array.<locals>.generic_check  s    JZ..>//7EayH(CJJ##H2(//*>*>>I#**//9IY(<=Y2r    c                  (   < S! V / VB  S! V / VB  R # r   r   )r   r   check_functioncheck_methods   *,r   r   5TestArrayManipulation.test_ravel_array.<locals>.check  s    $)&)D+F+r    r  )r  r  orderr  N)r   r   r   )r   r   r   r   )r   rD   rI   r)   ra   r#   )r   r   r  r   r  r  s   ff  @@r   test_ravel_array&TestArrayManipulation.test_ravel_array  s   	3  }k: 0AB	,
 	biil""1a(<biil""1as"33Gbiim##Aq!,W5SI 	biim##Aq!,C@biim##Aq!3#7sKbiim##Aq!Q/
;3Or    c                    \         P                  ! ^	4      P                  ^^4      p\        p\	        V4      p\        V33/ VB ! V4      pV! V4      pV! V4      p\         P                  P                  Wg4       R# r  N)r)   ra   r#   rG   r   r   r   r   r   r   r>   r   r  r  r   r   s   &&      r   test_ravel_array_size+TestArrayManipulation.test_ravel_array_size  sd    IIaL  A&!AY
ZM+U+F3!9Ah


.r    c                2    V P                  \        R 7       R# r  N)r  r  r]  s   &r   test_ravel_array_npm*TestArrayManipulation.test_ravel_array_npm  s    N3r    c                2    V P                  \        R 7       R# r  )r  r  r]  s   &r   test_ravel_array_size_npm/TestArrayManipulation.test_ravel_array_size_npm  s    """8r    c                R   a \        \        \        .4      V3R  l4       pV! 4        R# )c                    < \         P                  ! ^	4      P                  ^^4      p\        V4      p\	        V33/ SB ! V 4      pV ! V4      pV! V4      p\         P
                  P                  WE4       R# r  )r)   ra   r#   r   r   r   r   )r   r>   r  r  r   r   r   s   &     r   r   9TestArrayManipulation.test_transpose_array.<locals>.check  s`    		!$$Q*AJ//7EayH(CJJ##H2r    N)r!   rM   rP   )r   r   r   s   &f r   test_transpose_array*TestArrayManipulation.test_transpose_array  s(    	(=>	?	3 
@	3 	r    c                2    V P                  \        R 7       R# r  )r  r  r]  s   &r   test_transpose_array_npm.TestArrayManipulation.test_transpose_array_npm  s    !!!7r    c                    \         P                  ! ^4      P                  ^^^^^4      p\        p\	        V4      p\        V33/ VB ! V4      pV! V4      pV! V4      p\         P                  P                  Wg4       R# )r_   N)r)   ra   r#   rl   r   r   r   r   r  s   &&      r   test_squeeze_array(TestArrayManipulation.test_squeeze_array  sl    II'(00Aq!Q?AY
ZM+U+F3!9Ah


.r    c                   V P                  \        P                  4      ;_uu_ 4       pV P                  \        R 7       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r  Nrk   )r   r   r	   r  r  r  r   r   r   r   s   & r   test_squeeze_array_npm,TestArrayManipulation.test_squeeze_array_npm  sU    v1122f##.#9 3 	iV%5%5!67 32s   A..A>	c                   \         R  4       p\         R 4       p\        P                  ! R4      P                  R4      p\	        R4      \        P
                  3\        P
                  \	        R4      3\	        ^4      \        P
                  ^3\        P
                  ^\	        R4      3\	        ^4      \        \        P
                  ^3^\        P
                  \        3\        P
                  \	        ^4      \        P
                  ^3^\        R\        P
                  3\        P
                  \	        ^4      \        \        P
                  ^3^\        P
                  \        P
                  \        3\        P
                  ^\        P
                  \        3\	        ^4      ^\        P
                  R3\        P
                  ^\        R3.pVP                  pTpVP                  pTpV F  p	V! W94      p
V! W94      p\        P                  P                  W4       \        P                  ! V4      pW9,          pV! VP                  4       W4      p
V! VP                  4       W4      p\        P                  P                  W4       K  	  R# )c                     W,          # r   r   )r>   r9   s   &&r   np_new_axis_getitem@TestArrayManipulation.test_add_axis.<locals>.np_new_axis_getitem  s	    6Mr    c                     W V&   V # r   r   )r>   r9   items   &&&r   np_new_axis_setitem@TestArrayManipulation.test_add_axis.<locals>.np_new_axis_setitem  s    cFHr    NiH  )r   r   r      )r   r)   ra   r#   slicenewaxisEllipsisr   r   r   
zeros_likerW   )r   r  r  r>   	idx_casespyfunc_getitemcfunc_getitempyfunc_setitemcfunc_setitemr9   r   r   a_emptyr  s   &             r   test_add_axis#TestArrayManipulation.test_add_axis  s   		 
	 
	 
	 IIm$,,\:4["**%ZZt%1Xrzz1%ZZE$K(1XxQ/

H%ZZq2::q1$

+ZZq8RZZ;

BJJ1ZZBJJ11Xq"**d+ZZHd+
	 -44+,44+C%a-H'CJJ##H2mmA&G6D%gllnc@H:CJJ##H2 r    c           	        V P                  4       ;_uu_ 4       p\        \        P                  ! R \        P                  3R\        P                  3.4      4      p\
        P                  ! \
        P                  ^R4      p\        W#34      ! \        4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   r   r  NzUnsupported array index type)r*  r   r)   r  int32r
   Arrayr   r   r  r   r   )r   r   r  
arraytype2s   &   r   test_bad_index_npm(TestArrayManipulation.test_bad_index_npmE  s    ##%%#BHHsBHHo/2BHHo.? %@ AJU[[!S9J*)*95	 &
 	4c&:J:J6KL &%s   A>CC	c           	     ,   V P                  4       ;_uu_ 4       p\        \        P                  ! \        P                  ^R4      34      ! \
        4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r_   r  Nz$Unsupported array index type float64)	r*  r   r
   r  float64r   r  r   r   r  s   & r   test_bad_float_index_npm.TestArrayManipulation.test_bad_float_index_npmM  s_    ##%%%++emmQ467H &<&**+	- &%s   ;BB	c                  a aaa	 \         o	\        R R7      ! S	4      oR oR pV3R lpV3R lpVV	V 3R lpV! ^4       F  pV! 4        F  pV! WV4       K  	  K  	  V! ^4       F  pV! 4        F  pV! WV4       K  	  K  	  \        P                  ! R .^	,          4      P	                  ^^4      pV! VR4       V! V. R	O4       V! V\        P                  ! . R
O4      4       R# )Tr   c              3      "   W 3x  ^V ,          V 3x  V ^V ,          3x  ^V ,          ^,           ^V ,          ^,
          3x  W W 3x  Rx  R# 5i)r_   Nr`   r`   r`   r   )rd   s   &r   _shape_variationsITestArrayManipulation.test_fill_diagonal_basic.<locals>._shape_variationsW  sR     &Lq5!*a!e*EAIQ,,,Os   AAc               3     "   ^x  Rx  \         P                  x  \         P                  ) x  Rx  \         P                  ! ^4      x  Rx  ^^	.x  \         P                  ! ^64      P	                  ^	^^^4      x  \         P
                  ! \         P                  ! ^	4      P	                  ^^4      4      x  \         P                  ! ^	4      P	                  ^^4      RRR1,          x  R# 5i)r`   gA`"	@TNr  r   )r)   naninfra   r#   asfortranarrayr   r    r   _val_variationsGTestArrayManipulation.test_fill_diagonal_basic.<locals>._val_variationse  s     GK&&L66'MJ))A,Ja&L))B-''1a33##BIIaL$8$8A$>??))A,&&q!,TrT22s   C.C0c              3      <"   S! V 4       Fg  p\         P                  ! V\         P                  R 7      x  \         P                  ! \         P                  ! V\         P                  R 7      4      x  Ki  	  R# 5i)r  N)r)   r  r  r  ones)rd   r.   r  s   & r   #_multi_dimensional_array_variations[TestArrayManipulation.test_fill_diagonal_basic.<locals>._multi_dimensional_array_variationss  sJ     *1-hhuBJJ77''RZZ(HII .s   A6A9c           
   3   .  <"   S! V 4       F~  p\         P                  ! \        V Uu. uF  q"^,          NK  	  up4      \         P                  R7      p\        ;QJ d    . R V 4       F  NK  	  5M! R V 4       4      pW4,          x  K  	  R# u upi 5i)r_   r  c              3   J   "   T F  p\        ^ V^,          ^4      x  K  	  R# 5i)r   N)r  ).0r   s   & r   	<genexpr>vTestArrayManipulation.test_fill_diagonal_basic.<locals>._multi_dimensional_array_variations_strided.<locals>.<genexpr>|  s      A5auQAq115s   !#N)r)   r  r  r  )rd   r.   r   tmpslicerr  s   &    r   +_multi_dimensional_array_variations_stridedcTestArrayManipulation.test_fill_diagonal_basic.<locals>._multi_dimensional_array_variations_stridedy  sj     *1-hhuU%;U!eeU%;<BJJOA5AA5AAk! .%;s   %BB%B6Bc                    < R FQ  pV P                  4       pV P                  4       pVf   / pMRV/pS! W13/ VB  S! WA3/ VB  SP                  W44       KS  	  R # )Nr   )NTF)rW   r   )	r%   r   r   r>   bparamsr  r   r   s	   &&    r   _check_fill_diagonalLTestArrayManipulation.test_fill_diagonal_basic.<locals>._check_fill_diagonal  s^    )HHJHHJ<F$d^Fq((a''''- *r    FN)FTFTFT)r   r   r)   r   r#   )
r   r  r  r  r  r%   r   r  r  r   s
   f      @@@r   test_fill_diagonal_basic.TestArrayManipulation.test_fill_diagonal_basicS  s    $T"6*		3	J	"	. 7q9C&($S. ) : ?qAC&($S. ) B
 hhvz"**1a0S%(S"67S"((+>"?@r    c                N  a a \         p\        R R7      ! V4      o^pS P                  4        \        P                  ! . 4      \        P
                  ! ^4      3 FM  pS P                  \        4      ;_uu_ 4       pS! W24       RRR4       R\        XP                  4      9   d   KM  Q h	  S P                  \        4      ;_uu_ 4       p\        P                  ! R	4      pS! W24       S P                  R\        VP                  4      4       RRR4       VV 3R lp\        P                  ! R
\        P                  R7      p\        P                  pV! Wb4       R\        P                  .pV! Wb4       \        P                  ! . RO\        P                   R7      pV! Wb4       \        P                  ! R
\        P"                  R7      p. ROpV! Wb4       RpV! Wb4       \        P                  ! R.4      pV! Wb4       R#   + '       g   i     EL; i  + '       g   i     EL; i)Tr   Nz'The first argument must be at least 2-Dz/All dimensions of input must be of equal lengthc                    < SP                  \        4      ;_uu_ 4       pS! W4       R R R 4       SP                  R\        XP                  4      4       R #   + '       g   i     L7; i)Nz'Unable to safely conform val to a.dtyper   )r%   r   r   r  r   s   && r   _assert_raisesPTestArrayManipulation.test_fill_diagonal_exception_cases.<locals>._assert_raises  sG    "":..&c /FFL\L\H]^ /.r   r  ffffff
@gp=T)r^   r^   r   r^   r^   )r`   r_   g    _B}Ô%I)gffffff?g@r   )r   r   r   r)   r   r  r   r	   r   r   r   r  r   r  r  r  int64float32)r   r   r   r>   r   r  r%   r  s   f      @r   "test_fill_diagonal_exception_cases8TestArrayManipulation.test_fill_diagonal_exception_cases  s   $T"6* 	! "rwwqz)A"";//6a 0<FDTDT@UUUU * z**f#A!MNPSTZTdTdPef +	_
 hhvRXX.ffs BFFms hh|2884s hhvRZZ0 s s hhx s E 0//
 +**s   9	G?AH?HH$	c                P   \         p\        R R7      ! V4      p\        P                  ! ^ 4      R.\        P                  ! ^ 4      R.\        P                  ! ^ 4      R.\        P                  ! ^4      R.\        P                  ! ^4      R.\        P                  ! ^4      R.\        P
                  ! ^4      R.\        P
                  ! ^4      R.\        P
                  ! ^4      R	.\        P                  ! ^ 4      ^ .\        P                  ! ^4      ^.\        P                  ! ^4      ^.\        P                  ! ^4      R.\        P                  ! R
4      R.\        P                  ! R4      R.^R.R
R..pV F&  w  rEV! WE4      pV! WE4      pV P                  Wv4       K(  	  R# )Tr   Nr   r   r^   r_   r`   r_   r^   r  r  r   r   r  r  r_   r_   )r/   r   r)   r   r  ra   r   )r   r   r  r  input_arrayr.   r   r   s   &       r   test_broadcast_to'TestArrayManipulation.test_broadcast_to  sN   #T"6*
 XXa[$XXa[$XXa[$WWQZWWQZWWQZ#YYq\4 YYq\6"YYq\6"WWQZOWWQZOWWQZO WWQZWWV_f%WWV_f%KV-
0 #'Kk1H+C##C2 #'r    c                   \         p\        R R7      ! V4      p\        P                  ! ^{4      ^{R .pRpV FF  pV! WT4      pV! WT4      pV P	                  Wg4       V P                  VP                  R,          4       KH  	  R# )Tr   	WRITEABLENr   )r/   r   r)   r   r   assertFalser   )r   r   r  r  r.   r%   r   r   s   &       r   test_broadcast_to_0d_array0TestArrayManipulation.test_broadcast_to_0d_array  sz    #T"6* HHSM
 Cc)H#C##H2SYY{34 r    c                p   \         p\        R R7      ! V4      p\        P                  ! R4      R\        R.\        P                  ! R4      R\        R.\        P                  ! R4      R\        R.RR\        R.RR\        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\
        R.\        P                  ! R4      R\        R.RR\        R.^R\        R	..pV P                  4        V FU  w  rErgV P                  V4      ;_uu_ 4       pV! WE4       R
R
R
4       V P                  V\        XP                  4      4       KW  	  R
#   + '       g   i     L;; i)Tr   z/Cannot broadcast a non-scalar to a scalar arrayz=operands could not be broadcast together with remapped shapeszDinput operand has more dimensions than allowed by the axis remappingz4all elements of broadcast shape must be non-negativez7The second argument "shape" must be a tuple of integersr)  z-The first argument "array" must be array-likez*object cannot be interpreted as an integerNr   r   r   r  ){   r  r  r   r  r`   r`   r	  r   r   )r   r_   皙?g@)r_   r>   )r/   r   r)   r  r	   r   r   r   r  r   r   )	r   r   r  r  r%   target_shapeerrrc  r   s	   &        r   test_broadcast_to_raises.TestArrayManipulation.test_broadcast_to_raises  s   #T"6*
 XXd^R>@XXd^R>@XXd^R>@[>@R>@XXd^T:LNXXd^T:LNXXd^T:LNXXfvzLNXXftZSUXXftZSUXXd^RCEXXd^UJCEXXfw
CEXXfz;FHdK<>+9;C#
H 	!+/'Cs""3''6c( (MM#s6#3#345 ,0''s   )	H%%H5c                n    \         R  4       pVP                  4       pV! 4       pV P                  W#4       R# )c                  0    \         P                  ! R R4      # )r>   r  r,   r   r    r   _broadcast_to_1MTestArrayManipulation.test_broadcast_to_corner_cases.<locals>._broadcast_to_13  s    ??3//r    N)r   r   r   )r   r  r   r   s   &   r   test_broadcast_to_corner_cases4TestArrayManipulation.test_broadcast_to_corner_cases2  s:    		0 
	0 #**,.r    c                    \         p\        R R7      ! V4      p\        P                  ! ^\        P                  R7      pRpV! W44      p^
V^ &   V P                  VP                  4       ^
4       V P                  VP                  4       ^4       R# )Tr   r  Nr	  )r/   r   r)   r  r  r   sum)r   r   r  r
  r.   views   &     r   test_broadcast_to_change_view3TestArrayManipulation.test_broadcast_to_change_view;  so    #T"6*hhq1[(A*B/R(r    c                    \         p\        R R7      ! V4      p\        P                  ! ^4      RR..pV F)  w  rEpV! WEV4      pV! WEV4      pV P	                  W4       K+  	  R# )Tr   Nr	  r   )r:   r   r)   r  r   )	r   r   r  r  r
  r.   r9   r   r   s	   &        r   test_broadcast_to_indexing0TestArrayManipulation.test_broadcast_to_indexingF  sf    ,T"6*WWQZ&
 (,#Kk#6HC0C##C2 (,r    c                    \         R  4       p\        P                  ! ^4      pVP                  V4      pV! V4      pV P	                  W44       R# )c                 v    \         P                  ! V R4      pWP                  VP                  VP                  3# )r_   r  )r)   r-   rF   r.   ry   )r%   rets   & r   r   @TestArrayManipulation.test_broadcast_to_array_attrs.<locals>.fooT  s+    //#v.C#))S[[88r    N)r   r)   ra   r   r   )r   r   r%   r   r   s   &    r   test_broadcast_to_array_attrs3TestArrayManipulation.test_broadcast_to_array_attrsQ  sJ     
	9 
	9 iil;;s##h.r    c                J   \         p\        R R7      ! V4      pR.RR.R.R.R.RR.. R	O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..pV F6  pV! V!  pV! V!  pV P                  V\        4       V P	                  WV4       K8  	  R# )Tr   Nr   r  r   r  )r^   r   r   r   r`   ))r   r  r1  r0  )r   r`   r  r  r^   r`   rk  r   rj  r   r   r  rl  )r3   r   assertIsInstancer  r   )r   r   r  r  input_shaper   r   s   &      r   test_broadcast_shapes+TestArrayManipulation.test_broadcast_shapes_  s   'T"6* DHFIHV0KVVVVVVVJ6N6N6NLTN6N6NLL4LK9
<  K{+H%C!!#u-##H2	  r    c                X   \         p\        R R7      ! V4      pV P                  4        RR.RR.. ROR	R
.. RO^R..pV FT  pV P                  \        4      ;_uu_ 4       pV! V!   RRR4       V P                  R\        XP                  4      4       KV  	  R#   + '       g   i     L;; i)Tr   N=shape mismatch: objects cannot be broadcast to a single shaper  r  r  r  r  r  r  r`   r^   r   r_   r^   r^   )r   r2  rl  )r}  r   r3   r   r   r   r   r  r   r   )r   r   r  r  r4  r   s   &     r   test_broadcast_shapes_raises2TestArrayManipulation.test_broadcast_shapes_raises  s    'T"6*!
 4LTN	"-K
  K"":..&{# / MMYf../1	  ..s   BB)c                &   \         p\        R R7      ! V4      pV P                  4        V P                  \        4      ;_uu_ 4       pV! R^R4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)Tr   Nz#negative dimensions are not allowedr   r   r<  )r   r   r  r   s   &   r   (test_broadcast_shapes_negative_dimension>TestArrayManipulation.test_broadcast_shapes_negative_dimension  sk    'T"6*!z**f&1$ + 	;SAQAQ=RS +*s   B  B	c                8   \         p\        R R7      ! V4      pV P                  4        . ROpV FT  pV P                  \        4      ;_uu_ 4       pV! V!   RRR4       V P                  R\        XP                  4      4       KV  	  R#   + '       g   i     L;; i)Tr   Nz#must be either an int or tuple[int]))r   )r)  )g333333@)stringr   r>   )r`   rD  )r3   r   r   r   r	   r  r   r   )r   r   r  inpsinpr   s   &     r   "test_broadcast_shapes_invalid_type8TestArrayManipulation.test_broadcast_shapes_invalid_type  sw    'T"6*!
 C"";//6s 0 MM?VEUEUAVW	 //s   B		Bc                  a aa \         o\        R R7      ! S4      oVVV 3R lpR F!  p\        P                  ! V4      pV! V4       K#  	  ^R^.^^.^^..RR	3 F  pV! X4       K  	  S P	                  \
        4      ;_uu_ 4       pS! R4       RRR4       S P                  R\        XP                  4      4       R#   + '       g   i     L7; i)
Tr   c                 J   < S! V 4      pS! V 4      pSP                  W!4       R # r   rX  r   r   r   r  r   r   s   &  r   r   /TestArrayManipulation.test_shape.<locals>.check  #    ayH(C##C2r    Fr>   Nz+The argument to np.shape must be array-liker   r   r   r  )r   r   r   r  )	r   r   r)   emptyr   r	   r  r   r   r   r   tr%   r   r  r   s   f    @@r   
test_shape TestArrayManipulation.test_shape  s    T"6*	3 0A((1+C#J 0
 UQDAq7Aq6"2D)DA#J E {++v#J , 	C&**+	- ,+s   	B>>C	c                  a aa \         o\        R R7      ! S4      oVVV 3R lpR	 F!  p\        P                  ! V4      pV! V4       K#  	  ^RR\        P                  ! ^4      \        P
                  ! R4      3 F  pV! V4       K  	  S P                  \        4      ;_uu_ 4       pS! R4       RRR4       S P                  R\        XP                  4      4       R#   + '       g   i     L7; i)
Tr   c                 J   < S! V 4      pS! V 4      pSP                  W!4       R # r   rX  rK  s   &  r   r   .TestArrayManipulation.test_size.<locals>.check  rM  r    FgQ	@gX9v@r>   Nz*The argument to np.size must be array-likerN  )r   r   r)   rO  int8r  r   r	   r  r   r   rP  s   f    @@r   	test_sizeTestArrayManipulation.test_size  s    T"6*	3 0A((1+C#J 0
 UD"''!*bjj.?@A!H A {++v#J , 	B&**+	- ,+s   &	CC.	c                   a  \         p\        R R7      ! V4      pV 3R lpV! 4        F$  pV! V4      pV! V4      pS P                  WV4       K&  	  R# )Tr   c               3     <"   \         P                  ! R	^4      x  \         P                  ! ^^ R7      x  \         P                  ! . 4      x  SP                  P                  ^d4      p RV \         P                  ! V 4      R8  &   V x  V P                  ^^^4      x  V P                  ^2^RR7      x  V P                  ^^4      R,          x  V R,          x  R# 5i)
r   
fill_value        皙?r  r  r`   Nr_   r<  Nr   )r)   ra   fullr   randomrandnabsr#   r>   r   s    r   a_variationsBTestArrayManipulation.test_flatnonzero_basic.<locals>.a_variations  s     ))B""''!**((2,!!#&A!$AbffQi#oG))Aq!$$))B)--))B"4((b&Ls   CCN)r   r   r   r   r   r  rf  r>   r   r   s   f      r   test_flatnonzero_basic,TestArrayManipulation.test_flatnonzero_basic  sJ    "T"6*
	 AayH(C##H2  r    c                   a  \         p\        R R7      ! V4      pV 3R lpV! 4        F$  pV! V4      pV! V4      pS P                  WV4       K&  	  R# )Tr   c               3     <"   \         P                  ! R^4      ^8  x  \         P                  ! ^^ R7      x  \         P                  ! ^^R7      x  \         P                  ! . 4      x  \         P                  ! . R	O4      x  SP                  P                  ^d4      p V R8  x  V P                  ^^^4      R8  x  V P                  ^2^RR7      R8  x  V P                  ^^4      R,          R8  x  W ^,
          8H  x  W ) 8  x  R# 5i)
r   r\  r_  g      ?r  r  r`  Nr   )g      r^  r   )r)   ra   ra  r   rb  rc  r#   re  s    r   rf  ?TestArrayManipulation.test_argwhere_basic.<locals>.a_variations  s     ))B"Q&&''!**''!**((2,((+,,!!#&Ac'M))Aq!$s**))B)-33))B"4(3..1u*b&Ls   D
DN)r   r   r   rh  s   f      r   test_argwhere_basic)TestArrayManipulation.test_argwhere_basic  sJ    T"6*	 AayH(C##H2  r    c               #     "   Rx  Rx  ^ ^.^^.3x  Rx  \         P                  x  ^ x  ^x  Rx  Rx  R	x  R
x  Rx  Rx  Rx  R# 5i)r  FTNa_string )r  )r  g@)g      @gffffff@)r^  r   r^  g      r   r  y       @      ?)r)   r  r   r    r   array_like_variations+TestArrayManipulation.array_like_variations  sa     22##1v1vff
!!
s   AAc                    \         p\        R R7      ! V4      pV P                  4        F$  pV! V4      pV! V4      pV P                  WE4       K&  	  R# rK  )r   r   rs  r   r   r   r  r>   r   r   s   &     r   test_flatnonzero_array_like1TestArrayManipulation.test_flatnonzero_array_like-  sI    "T"6*++-AayH(C##H2 .r    c                    \         p\        R R7      ! V4      pV P                  4        F$  pV! V4      pV! V4      pV P                  WE4       K&  	  R# rK  )r   r   rs  r   rv  s   &     r   test_argwhere_array_like.TestArrayManipulation.test_argwhere_array_like6  sI    T"6*++-AayH(C##H2 .r    c                   \         p\        R R7      ! V4      pV Uu. uF  p\        P                  ! V4      NK  	  ppV! V!  pV.\	        V4      ,          pV U	u. uF  qP
                  NK  	  p
p	V P                  W4       R# u upi u up	i rK  )r7   r   r)   r  r  r.   r   )r   input_shapesr   r   r  sinarrays	outarraysr   r>   r   s   &&&        r   %broadcast_arrays_assert_correct_shape;TestArrayManipulation.broadcast_arrays_assert_correct_shape>  s}     (T"6*)56ABHHQK68$	"#c(m3 )*	1ww	*.	 7 +s   BB	c                    \         p\        R R7      ! V4      p. ROpV F@  pV.pV P                  WT4       WD.pV P                  Wd4       WDV.pV P                  Wt4       KB  	  R# )Tr   N)	r   r  rj  r~  rk  )r^   r   r  r2  r  )r7   r   r  )r   r   r  r  r.   r}  input_shapes2input_shapes3s   &       r   'test_broadcast_arrays_same_input_shapes=TestArrayManipulation.test_broadcast_arrays_same_input_shapesJ  sm     (T"6*
 E!7L66|K"NM66}L"51M66}L r    c                    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
.R
..pV F2  w  r#V P                  W#4       V P                  VRRR1,          V4       K4  	  R# )r`   Nr   r  r  r  r2  r  rk  r   rj  r   r  r   r  r}  r   s   &   r   9test_broadcast_arrays_two_compatible_by_ones_input_shapesOTestArrayManipulation.test_broadcast_arrays_two_compatible_by_ones_input_shapesh  s     D\4 fv&fv&fv&fv&fv&fv&fv&fv&fv&fv&fv&fv&
 -1(L66|T66|DbD7I>Z -1r    c                B   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.R
.RR
.R
.RR
.R
.RR	.R.RR.R.RR.R.RR.R.RR.R..pV F2  w  r#V P                  W#4       V P                  VRRR1,          V4       K4  	  R# )r^   Nr   r  r  r2  r   r  r  r   r   rj  rk  r   r  r  s   &   r   Dtest_broadcast_arrays_two_compatible_by_prepending_ones_input_shapesZTestArrayManipulation.test_broadcast_arrays_two_compatible_by_prepending_ones_input_shapes  s1    $ZF^V$F^V$F^V$&\6"d^V$F^V$F^V$&\6"&\6"$ZF^V$F^V$F^V$&\6"d^V$F^V$F^V$&\6"&\6")
, -1(L66|T66|DbD7I>Z -1r    c                    \         p\        R R7      ! V4      pR R.R.^^.R.R^.R..pV FI  w  rEV! V!  pV Uu. uF  qwP                  NK  	  ppV.\        V4      ,          p	V P	                  W4       KK  	  R# u upi )Tr   FNr   r   r  )r7   r   r.   r  r   )
r   r   r  r  r  r   r  r>   r   r   s
   &         r   "test_broadcast_arrays_scalar_input8TestArrayManipulation.test_broadcast_arrays_scalar_input  s    'T"6*E]D!VTNa[$

 )-$Hx(I$-.Iq77IC.&'#h-7H##H2	 )-.s   A;c                    \         p\        R R7      ! V4      pV! RR4      pRR.pV Uu. uF  qUP                  NK  	  ppV P                  WF4       R# u upi )Tr   N)r  i  )i  r  )r7   r   r.   r   r   r   r  r  r   r>   r   s   &      r   !test_broadcast_arrays_tuple_input7TestArrayManipulation.test_broadcast_arrays_tuple_input  sT    'T"6**f-	$< )*	1ww	*. +s   Ac                    \         p\        R R7      ! V4      pV! \        P                  ! ^4      \        P                  ! R\        P                  R7      4      pRR.pV Uu. uF  qUP
                  NK  	  ppV P                  WF4       R# u upi )Tr   r  Nr  )r7   r   r)   intpr  r.   r   r  s   &      r   %test_broadcast_arrays_non_array_input;TestArrayManipulation.test_broadcast_arrays_non_array_input  sl    'T"6*"''!*bhhvRWW&EF	F# )*	1ww	*. +s   "Bc                p   \         p\        R R7      ! V4      pV P                  4        V P                  \        4      ;_uu_ 4       p\
        P                  ! ^4      P                  R4      pR pV! WE4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)Tr   NzMismatch of argument typesr  )r7   r   r   r   r	   r)   ra   r#   r  r   r   )r   r   r  r   r%   r  s   &     r   /test_broadcast_arrays_invalid_mixed_input_typesETestArrayManipulation.test_broadcast_arrays_invalid_mixed_input_types  s    'T"6*!{++v))A,&&v.CA#M , 	2C8H8H4IJ	 ,+s   0B%%B5	c                r   \         p\        R R7      ! V4      pV P                  4        V P                  \        4      ;_uu_ 4       p\
        P                  ! ^\
        P                  R7      pRpV! WE4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)Tr   r  zhello worldNzArgument "1" must be array-like)r7   r   r   r   r	   r)   r  r  r  r   r   )r   r   r  r   r%   r~  s   &     r   #test_broadcast_arrays_invalid_input9TestArrayManipulation.test_broadcast_arrays_invalid_input  s    'T"6*!{++v((1BHH-CA#M , 	7V=M=M9NO	 ,+s   1B&&B6	c           
        \         p\        R R7      ! V4      pV P                  4        RR.RR.. ROR	R
..pV F  pWDRRR1,          3 Fy  pV P                  \        4      ;_uu_ 4       pV Uu. uF  p\
        P                  ! V4      NK  	  ppV! V!   RRR4       V P                  R\        XP                  4      4       K{  	  K  	  R# u upi   + '       g   i     LD; i)Tr   Nr8  r  r  r  r  r9  r:  r;  r   )
r7   r   r   r   r   r)   r  r  r   r   )	r   r   r  r  r}  r.   r   r~  r  s	   &        r   :test_broadcast_arrays_incompatible_shapes_raise_valueerrorPTestArrayManipulation.test_broadcast_arrays_incompatible_shapes_raise_valueerror  s    'T"6*! 4LTN	"	
 !L&TrT(:;&&z22f5:;UUH;8$ 3 ]!&"2"235 < !  < 32s   )C	.CC	C	C!c                
   R  pTp\        RR7      ! V4      pV! \        P                  ! . RO. RO. RO.4      ^4      pV! \        P                  ! . RO. RO. RO.4      ^4      p\        P                  P	                  WT4       R# )c                    V P                   w  r#\        P                  ! WW#34      p\        P                  ! V^ ^4      pVP	                  4       p\        P
                  ! VRV34      pVR^V,
           Wq^,
          R1R3&   V# r   Nr   r   )r.   r)   r-   swapaxesr<   r#   r   r   rcr>   r  ccds   &&      r   unfold_flattenITestArrayManipulation.test_readonly_after_flatten.<locals>.unfold_flatten  sp    77DAq9-AAq!$AB

2Aw'AWq1u:A!efaiLHr    Tr   Nr  r_   r_   r_   r^   r^   r^   r   r)   r   r   assert_array_equal)r   r  r   r  res_nbres_pys   &     r   test_readonly_after_flatten1TestArrayManipulation.test_readonly_after_flatten  si    	  T"6* rxxIy ABAF)Y	!BCQG


%%f5r    c                
   R  pTp\        RR7      ! V4      pV! \        P                  ! . RO. RO. RO.4      ^4      pV! \        P                  ! . RO. RO. RO.4      ^4      p\        P                  P	                  WT4       R# )c                    V P                   w  r#\        P                  ! WW#34      p\        P                  ! V^ ^4      pVP	                  4       p\        P
                  ! VRV34      pVR^V,
           Wq^,
          R1R3&   V# r  )r.   r)   r-   r  rC   r#   r  s   &&      r   unfold_ravelETestArrayManipulation.test_readonly_after_ravel.<locals>.unfold_ravel  sp    77DAq9-AAq!$AB

2Aw'AWq1u:A!efaiLHr    Tr   Nr  r  r  r  )r   r  r   r  r  r  s   &     r   test_readonly_after_ravel/TestArrayManipulation.test_readonly_after_ravel  si    	 T"6* rxxIy ABAF)Y	!BCQG


%%f5r    c                   V P                  4        \        P                  ! ^	4      P                  R
4      P	                  4       pVP	                  RR7      pRVP
                  n        RVP
                  n        R pTp\        RR7      ! V4      pV! V4      pV! V4      pRpV P                  VP
                  P                  '       * V4       RpV P                  VP
                  P                  V4       R	# )r  r  r  Fc                 &    V P                  4       pV# r   rB   )r>   r   s   & r   try_ravel_w_copyKTestArrayManipulation.test_mutability_after_ravel.<locals>.try_ravel_w_copy!  s    WWYFMr    Tr   zCNo copy was performed, so the resulting array must not be writeablez?A copy was performed, yet the resulting array is not modifiableNr  )	r   r)   ra   r#   rW   r   rh  r   
assertTrue)	r   a_ca_fr  r   r  ret_cret_frc  s	   &        r   test_mutability_after_ravel1TestArrayManipulation.test_mutability_after_ravel  s     	!iil""6*//1hhSh!#		#			 "T"6*c
c
6EKK11137O--s3r    r   N)F__name__
__module____qualname____firstlineno____doc__r   r	  r  r  r&  r+  rH  rM  rQ  rT  rZ  r^  rd  rq  r  enable_pyobj_flagsr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r$  r'  r-  r5  r=  r@  rG  rR  rX  ri  rn  staticmethodrs  rw  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  __static_attributes____classdictcell__)__classdict__s   @r   r   r      s    m"^X*tO.-68S-$^-
-
-
&+2".HAH (:# /$B
 &8  PD += 	/49 *< 8 (: 	/8*3XM-FAP,!\!3F5,.6`/	)	3/(3T1.TX(-0-03*3.  $33
/M<[4[B3//
K
P5,6(6(4 4r    r   __main__r   )F);	functoolsr   	itertoolsr   numpyr)   unittestnumbar   r   r   r   numba.core.errorsr	   
numba.corer
   r   numba.tests.supportr   r   r  r  r!   r'   r*   r/   r3   r7   r:   r?   rD   rG   rI   rM   rP   rU   rX   rZ   r\   ri   rl   rn   rq   rt   rv   r}   r   r   r   r   r   r   r   r   r   r   r   r  mainr   r    r   <module>r     s    "   / / ) $ 9 $' $
D1, ! ! % %'&&, ( ( / /   & &  #   ?L P P,#p4OX p4f+ zMMO r    