+
    :i                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ^ RIHtHtHt ^ RIHtHtHtHt ^ RIHt ^ RIt]! RRR7      tR	 tR
 tR tR tR tR tR tR t R 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 R]%]4      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, R-]"4      t0 ! R. R/]4      t1 ! R0 R1]"4      t2 ! R2 R3]4      t3 ! R4 R5]]"4      t4 ! R6 R7]]4      t5]Pl                  ! ]7! ]R84      R94       ! R: R;]]4      4       t8R< t9]:R=8X  d   ]Pv                  ! 4        R# R# )>    N)TypingError)njit)typesutilsconfig)MemoryLeakMixinTestCasetagskip_if_32bit)	PYVERSIONT)_nrtnogilc                 2    \         P                  ! WV34      # Nnpconcatenateabcs   &&&X/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_dyn_array.pynp_concatenate1r      s    >>1)$$    c                 6    \         P                  ! WV3VR 7      # axisr   r   r   r   r   s   &&&&r   np_concatenate2r       s    >>1)$//r   c                 2    \         P                  ! WV34      # r   r   stackr   s   &&&r   	np_stack1r$      s    88Q1Ir   c                 6    \         P                  ! WV3VR 7      # r   r"   r   s   &&&&r   	np_stack2r&      s    88Q1ID))r   c                 2    \         P                  ! WV34      # r   )r   hstackr   s   &&&r   	np_hstackr)           99aAYr   c                 2    \         P                  ! WV34      # r   )r   vstackr   s   &&&r   	np_vstackr-   #   r*   r   c                 2    \         P                  ! WV34      # r   )r   	row_stackr   s   &&&r   np_row_stackr0   &   s    <<q	""r   c                 2    \         P                  ! WV34      # r   )r   dstackr   s   &&&r   	np_dstackr3   )   r*   r   c                 2    \         P                  ! WV34      # r   )r   column_stackr   s   &&&r   np_column_stackr6   ,   s    ??A!9%%r   c                   *   a  ] tR t^0t o RR ltRtV tR# )BaseTestc                   \        V4      pV F  pV! V!  pV! V!  pV P                  VP                  VP                  4       V P                  VP                  VP                  4       V P	                  Wv4       V'       d"   \
        P                  P                  Wg4       K  \
        P                  P                  Wg4       K  	  R # r   )	nrtjitassertEqualsizedtypeassertStridesEqualr   testingassert_equalassert_allclose)selfpyfuncargslistexactcfuncargsexpectedrets   &&&&    r   check_outputsBaseTest.check_outputs2   s    vDt}H,CSXXx}}5SYY7##C2

''6

**89 r    N)T)__name__
__module____qualname____firstlineno__rJ   __static_attributes____classdictcell____classdict__s   @r   r8   r8   0   s     : :r   r8   c                   &   a  ] tR t^@t o R tRtV tR# )NrtRefCtTestc                R    V P                  VP                  P                  V4       R # r   )r;   baserefcount)rB   arrexpects   &&&r   assert_array_nrt_refct#NrtRefCtTest.assert_array_nrt_refctA   s    **F3r   rL   N)rM   rN   rO   rP   r\   rQ   rR   rS   s   @r   rV   rV   @   s     4 4r   rV   c                      a  ] tR t^Et 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 4       tR tR tR tR tRtV tR# )TestDynArrayc                   \         R  4       pV! 4       pV P                  V^4       \        P                  P	                  ^*V4       V P                  VP                  ^4       V P                  VP                  R4       V P                  VP                  \        P                  ! \        P                  4      4       V P                  VP                  R4       VP                  ^{4       \        P                  P	                  ^{V4       ?R# )c                  <    \         P                  ! R4      p ^*V R&   V # )*   rL   r   emptyrZ   s    r   foo'TestDynArray.test_empty_0d.<locals>.fooH   s    ((2,CCGJr   NrL   )r:   r\   r   r?   r@   r;   r<   shaper=   float64stridesfill)rB   rf   rZ   s   &  r   test_empty_0dTestDynArray.test_empty_0dG   s    		 
	
 e##C+


C(1%B'BHHRZZ$89b)


S)r   c                   \         R  4       p^pV! V4      pV P                  V^4       \        P                  P	                  \        P
                  ! V4      V4       V P                  VP                  V4       V P                  VP                  V34       V P                  VP                  \        P                  ! \        P                  4      4       V P                  VP                  \        P                  ! \        P                  4      P                  34       VP                  ^{4       \        P                  P	                  ^{V4       ?R# )c                 ^    \         P                  ! V 4      p\        V 4       F  pW!V&   K	  	  V# r   )r   rd   range)nrZ   is   &  r   rf   'TestDynArray.test_empty_1d.<locals>.fooZ   s+    ((1+C1XA  Jr   N)r:   r\   r   r?   r@   aranger;   r<   rh   r=   ri   rj   itemsizerk   )rB   rf   rq   rZ   s   &   r   test_empty_1dTestDynArray.test_empty_1dY   s    		 
	 !f##C+


		!c21%QD)BHHRZZ$89rxx

';'D'D&FG


S)r   c                   R  p\        V4      p^p^pV! W44      pV! W44      pV P                  V^4       \        P                  P	                  WV4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       ?R# )c                     \         P                  ! W3\         P                  4      p\        V 4       F!  p\        V4       F  pW4,           W#V3&   K  	  K#  	  V# r   r   rd   int32rp   )mrq   rZ   rr   js   &&   r   rC   *TestDynArray.test_empty_2d.<locals>.pyfunco   sH    ((A6288,C1XqA !C1I "  Jr   N	r:   r\   r   r?   r@   r;   r<   rh   rj   )rB   rC   rF   r|   rq   expected_arrgot_arrs   &      r   test_empty_2dTestDynArray.test_empty_2dn   s    	 va|+##GQ/


6**GLL9++W]];--w?r   c                   R  p\        V4      p^p^p^pV! W4V4      pV! W4V4      pV P                  V^4       \        P                  P	                  Wg4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       ?R# )c                     \         P                  ! WV3\         P                  4      p\        V 4       F:  p\        V4       F(  p\        V4       F  pWE,           V,           W4WV3&   K  	  K*  	  K<  	  V# r   rz   )r|   rq   prZ   rr   r}   ks   &&&    r   rC   *TestDynArray.test_empty_3d.<locals>.pyfunc   s\    ((A!9bhh/C1XqA"1X'(uqyqG & " 
 Jr   Nr   rB   rC   rF   r|   rq   r   r   r   s   &       r   test_empty_3dTestDynArray.test_empty_3d   s    	 vaAa.##GQ/


6**GLL9++W]];--w?r   c                   R  p\        V4      p^p^p^pV! W4V4      pV! W4V4      pV P                  V^4       \        P                  P	                  Wg4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       ?R# )c                     \         P                  ! W3\         P                  4      p\        V 4       F!  p\        V4       F  pWE,           W4V3&   K  	  K#  	  W2,          # r   rz   )r|   rq   r   rZ   rr   r}   s   &&&   r   rC   1TestDynArray.test_empty_2d_sliced.<locals>.pyfunc   sJ    ((A6288,C1XqA !C1I "  6Mr   Nr   r   s   &       r   test_empty_2d_sliced!TestDynArray.test_empty_2d_sliced   s    	 vaAa.##GQ/


6**GLL9++W]];--w?r   c                X  a \         P                  ! ^\         P                  R7      o\        P                  ! S4      pV3R lp\        V4      pV! 4       pV P                  V^,           \        P                  ! S4      4       \         P                  P                  SV4       \         P                  P                  S\         P                  ! ^\         P                  R7      4       \         P                  P                  V\         P                  ! ^\         P                  R7      4       ?\        P                  ! 4        V P                  V^,           \        P                  ! S4      4       ?\        P                  ! 4        V P                  V\        P                  ! S4      4       R# )   r=   c                     < S # r   rL   ys   r   return_external_arrayDTestDynArray.test_return_global_array.<locals>.return_external_array   s    Hr   N)r   onesfloat32sysgetrefcountr:   r;   r?   r@   gccollect)rB   	initrefctr   rF   outr   s   &    @r   test_return_global_array%TestDynArray.test_return_global_array   s   GGARZZ(OOA&		 ,-g 	Q(:;


3'


2771BJJ#?@


RWWQbjj%AB


Q(:;


COOA$67r   c                  a \         P                  ! ^\         P                  R7      oV3R lp\        V4      pV! 4       pV P	                  VP
                  4       SR,          p\         P                  P                  WC4       \         P                  P                  V\         P                  ! ^\         P                  R7      4       \         P                  P                  V\         P                  ! ^\         P                  R7      4       R# )r   r   c                     < S R ,          # )   NNrL   r   s   r   r   KTestDynArray.test_return_global_array_sliced.<locals>.return_external_array   s    R5Lr   r   N)r   r   r   r:   assertIsNonerX   r?   r@   )rB   r   rF   r   yyr   s   &    @r   test_return_global_array_sliced,TestDynArray.test_return_global_array_sliced   s    GGARZZ(	 ,-g#((#rU


(


BGGARZZ$@A


RWWQbjj%ABr   c                N   R  p\         P                  ! ^\         P                  R7      p\        V4      pV! V4      pV! V4      p\         P                  P                  WB4       \         P                  P                  WE4       V P                  WB4       V P                  WE4       R# )c                     V # r   rL   r   s   &r   rC   4TestDynArray.test_array_pass_through.<locals>.pyfunc   s    Hr   r   N)r   r   r   r:   r?   r@   assertIs)rB   rC   rZ   rF   rH   gots   &     r   test_array_pass_through$TestDynArray.test_array_pass_through   st    	 ggarzz*v:Sk


.


.h$h$r   c                   R  p\         P                  ! ^\         P                  R7      p\        P                  ! V4      p\        V4      pV! V4      pV P                  V^,           \        P                  ! V4      4       V! V4      pV P                  V^,           \        P                  ! V4      4       \         P                  P                  WbVP                  ^,          ,          4       \         P                  P                  We4       ?V P                  V^,           \        P                  ! V4      4       ?V P                  V\        P                  ! V4      4       R# )c                 ,    W P                   ^,          R # )r   N)r<   r   s   &r   rC   ;TestDynArray.test_array_pass_through_sliced.<locals>.pyfunc   s    VVq[\?"r   r   N)
r   r   r   r   r   r:   r;   r?   r@   r<   )rB   rC   rZ   r   rF   r   rH   s   &      r   test_array_pass_through_sliced+TestDynArray.test_array_pass_through_sliced   s    	# ggarzz*OOC(	vCjQ(<=#;Q(<=


chh!m*<=


.Q(<=COOC$89r   c                   R  p\        V4      p\        P                  P                  ^
4      p\        P                  P                  ^
4      p\        P                  P	                  V! W44      V! W44      4       V P                  V! W44      ^4       \        P                  P                  ^
4      P                  ^^4      p\        P                  P                  ^
4      P                  ^^4      p\        P                  P	                  V! W44      V! W44      4       V P                  V! W44      ^4       \        P                  P                  ^F4      P                  ^^^4      p\        P                  P                  ^F4      P                  ^^^4      p\        P                  P	                  V! W44      V! W44      4       V P                  V! W44      ^4       R# )c                 t    \         P                  ! V P                  4      p\         P                  ! WV4       V# r   )r   rd   rh   add)r   r   r   s   && r   rC   =TestDynArray.test_ufunc_with_allocated_output.<locals>.pyfunc  s'    ((177#CFF1Jr   N)r:   r   randomr?   r@   r\   reshape)rB   rC   rF   arr_aarr_bs   &    r    test_ufunc_with_allocated_output-TestDynArray.test_ufunc_with_allocated_output  sp   	
 v 		  $		  $


u 4 %e 3	5 	##E%$7; 		  $,,Q2		  $,,Q2


u 4 %e 3	5 	##E%$7; 		  $,,Q15		  $,,Q15


u 4 %e 3	5 	##E%$7;r   c                Z  a R p\        V4      o^
p\        P                  P                  ^^
V4      pVP	                  4       p\        P
                  P                  V! V4      S! V4      4       \        P
                  P                  WC4       . p. p. pV3R lp\        ^d4       F  p	\        P                  P                  ^^
V4      p\        P                  ! V4      p
\        P                  ! VW:3RP                  V	4      R7      pVP                  V4       VP                  V4       VP                  V
4       K  	  V F  pVP                  4        K  	  V F  pVP                  4        K  	  \        Wg4       F+  w  r\        P
                  P                  V! V4      V
4       K-  	  R# )zi
This test exercises the array allocation in multithreaded usecase.
This stress the freelist inside NRT.
c                    \         P                  ! V P                  4      p\        VP                  4       F  p^ W&   K	  	  \        V ^ ,          4       F  p\         P                  ! V P                  4      p\        VP                  4       F  pW,          W4&   K  	  \        VP                  4       F$  pW;;,          W4,          V,           ,          uu&   K&  	  K  	  V# r   r   rd   r<   rp   )inpr   rr   tmpr}   s   &    r   rC   /TestDynArray.test_allocation_mt.<locals>.pyfunc/  s    ((388$C 388_ % 3q6]hhsxx(sxxA VCF ) sxxAFcfqj(F ) # Jr   c                    < S! V 4      VR &   R# NNNNrL   )r   r   rF   s   &&r   wrapped0TestDynArray.test_allocation_mt.<locals>.wrappedP  s    3ZCFr   	worker{0}targetrG   nameN)r:   r   r   randintcopyr?   r@   rp   
empty_like	threadingThreadformatappendstartjoinzip)rB   rC   r<   rZ   
frozen_arrworkersinputsoutputsr   rr   r   threadr   rF   s   &            @r   test_allocation_mtTestDynArray.test_allocation_mt)  sT   	& vii2t,XXZ



sU3Z8



0	  sA))##Ar40C--$C%%W,/:+6+=+=a+@BF NN6"MM#NN3  FLLN  FKKM  F,HCJJ##F3K5 -r   c                  a R p\        V4      o^
p\        P                  ! V\        R7      p\        P
                  ! V4      p\        P                  ! R4      pV! WS4      p\        P                  P                  VS! WS4      4       ?V P                  V\        P
                  ! V4      4       . p. p. p	V3R lp
\        ^d4       F  p\        P                  ! V4      p\        P                  ! R4      p\        P                  ! V
WSV3RP                  V4      R7      pVP!                  V4       VP!                  V4       V	P!                  V4       K  	  V F  pVP#                  4        K  	  V F  pVP%                  4        K  	  \'        W4       F+  w  r\\        P                  P                  V! WS4      V4       K-  	  ??V P                  V\        P
                  ! V4      4       R# )z5
This test exercises the refct in multithreaded code
c                     \         P                  ! VP                  4      p\        VP                  4       F  pW,          ^,           W#&   K  	  \        V 4       F  pYrK  	  V#    r   )rq   r   r   rr   s   &&  r   rC   *TestDynArray.test_refct_mt.<locals>.pyfunco  sM    ((388$C388_! % 1XS Jr   r   i  c                    < S! W4      VR &   R# r   rL   )rq   inputr   rF   s   &&&r   r   +TestDynArray.test_refct_mt.<locals>.wrapped  s    1_CFr   r   r   N)r:   r   rt   floatr   r   r   	randranger?   r@   r;   rp   rd   r   r   r   r   r   r   r   )rB   rC   r<   r   expected_refctswapctrH   r   r   swapctsr   rr   r   r   rF   s   &             @r   test_refct_mtTestDynArray.test_refct_mtj  s   
	 v		$e,/!!$'&(


%*>?)?@	% sA((4.C%%d+F%%W,23+?+6+=+=a+@BF NN6"NN3NN6"  FLLN  FKKM  w0KFJJ##F6$93? 1 W)?@r   c                V   \         R  4       pV P                  4        V P                  \        4      ;_uu_ 4       pV! \        P
                  P                  ^,          ^,          4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)c                 2    \         P                  ! V 4       R # r   rc   )xs   &r   rf   1TestDynArray.test_invalid_size_array.<locals>.foo  s    HHQKr   NzAllocation failed)
r   disable_leak_checkassertRaisesMemoryErrorr   size_tmaxvalassertInstr	exception)rB   rf   raisess   &  r   test_invalid_size_array$TestDynArray.test_invalid_size_array  s}     
	 
	 	!{++v##q(A-. , 	)3v/?/?+@A ,+s   /BB(	c                ^   R  p\        V4      p\        P                  P                  ^d4      p\        P                  P                  ^d4      p^dp\        P                  ! V4      \        P                  ! V4      3pV! W4V4      V! W4V4      rV P                  V^ ,          P                  4       V P                  V^,          P                  4       \        P                  P                  Wx4       ??V P                  V\        P                  ! V4      \        P                  ! V4      34       R# )c                0    \        V4       F  pYrK  	  W3# )z5Swap array x and y for t number of times
            rp   r   r   trr   s   &&& r   rC   &TestDynArray.test_swap.<locals>.pyfunc  s      1X1  4Kr   N)
r:   r   r   r   r   r   rX   r?   r@   r;   )	rB   rC   rF   r   r   r  r   r[   r   s	   &        r   	test_swapTestDynArray.test_swap  s    	 vIIS!IIS!OOA&(::	Q1ouQ1~#a&++&#a&++&


,CS__Q%79K$LMr   c                8   R  p\        V4      p\        P                  P                  ^4      p\        P                  ! V4      pV! V4      w  rVV! V4      w  rxV P                  W54       V P                  W74       \        P                  P                  WW4       \        P                  P                  Wh4       ??V P                  V\        P                  ! V4      4       V P                  \        P                  ! V4      \        P                  ! V4      4       R# )c                     \         P                  ! V P                  4      p\        VP                  4       F  pW,          ^,           W&   K  	  W3# r   r   )r   r   rr   s   &  r   rC   7TestDynArray.test_return_tuple_of_array.<locals>.pyfunc  s:     A166]tax #4Kr   N)	r:   r   r   r   r   r   r?   r@   r;   )	rB   rC   rF   r   r   
expected_x
expected_ygot_xgot_ys	   &        r   test_return_tuple_of_array'TestDynArray.test_return_tuple_of_array  s    	 vIIQOOA&	!'
Qxa$a



2



2COOA$674cooe6LMr   c                   R  p\        V4      p\        P                  P                  ^4      pV! V4      w  rEV! V4      w  rg\        P                  P	                  WF4       \        P                  P	                  WW4       \
        R9   d   ^pM\
        R9   d   ^pM\        \
        4      hV P                  V\        P                  ! V4      4       V P                  V\        P                  ! V4      4       R# )c                     \         P                  ! V P                  4      p\        VP                  4       F  pW,          ^,           W&   K  	  W3pV# r   r   )r   r   rr   r   s   &   r   rC   ?TestDynArray.test_return_tuple_of_array_created.<locals>.pyfunc  s?     A166]tax #$CJr   N)      )r  
   )r     )r     )r     )
r:   r   r   r?   r@   r   NotImplementedErrorr;   r   r   )	rB   rC   rF   r   r  r  r  r  expected_refcounts	   &        r   "test_return_tuple_of_array_created/TestDynArray.test_return_tuple_of_array_created  s    	 vIIQ!'
Qx



2



2# !>> !%i00*COOE,BC*COOE,BCr   c                  a \         R 4       oV3R lp\        V4      p\        P                  ! ^
4      p\        P                  ! V4      p\
        R9   dZ   V P                  ^\        P                  ! V! V4      4      4       V P                  ^\        P                  ! V! V4      4      4       Ms\
        R9   dZ   V P                  V\        P                  ! V! V4      4      4       V P                  V\        P                  ! V! V4      4      4       M\        \
        4      hV P                  V\        P                  ! V4      4       R# )zG
Dispatcher returns a new reference.
It need to workaround it for now.
c                     V # r   rL   )r   s   &r   inner7TestDynArray.test_issue_with_return_leak.<locals>.inner  s    Jr   c                    < S! V 4      # r   rL   )r   r#  s   &r   rC   8TestDynArray.test_issue_with_return_leak.<locals>.pyfunc  s    8Or   Nr  r  )r:   r   rt   r   r   r   r;   r  )rB   rC   rF   rZ   	old_refctr#  s   &    @r   test_issue_with_return_leak(TestDynArray.test_issue_with_return_leak  s    
 
	 
		 viimOOC(	#Qs <=Qc
 ;<>>Ys(DEYc
(CD%i00COOC$89r   rL   N)rM   rN   rO   rP   rl   rv   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r(  rQ   rR   rS   s   @r   r_   r_   E   sx     $*.2086C%:,"<H?6B;Az B BN4N.D6: :r   r_   c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )ConstructorBaseTesti  c                \   \        V4      pV! 4       pV! 4       pV P                  V^4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP
                  VP
                  4       V P                  VP                  VP                  4       V P                  WC4       \        P                  ! V4      pVP                  ^{4       VP                  ^{4       \        P                  P                  WC4       R# r   N)r:   r\   r;   r<   rh   r=   rj   check_result_valuer   r   rk   r?   r@   )rB   rC   rF   rH   rI   s   &&   r   check_0dConstructorBaseTest.check_0d!  s    v8g##C+8==1HNN3HNN3h&6&67.==%c


.r   c                0   \        V4      p^pV! V4      pV! V4      pV P                  V^4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP
                  VP
                  4       V P                  VP                  VP                  4       V P                  WT4       \        P                  ! V4      pVP                  ^{4       VP                  ^{4       \        P                  P                  WT4       V P                  \        4      ;_uu_ 4       pV! R4       RRR4       V P                  \        XP                   4      R4       R#   + '       g   i     L7; i)r  Nnegative dimensions not allowedr:   r\   r;   r<   rh   r=   rj   r.  r   r   rk   r?   r@   r   
ValueErrorr   r   )rB   rC   rF   rq   rH   rI   cms   &&     r   check_1dConstructorBaseTest.check_1d1  s   v!9Ah##C+8==1HNN3HNN3h&6&67.==%c


.z**b"I +R\\*,MN +*s   	FF	c                4   \        V4      p^^rCV! W44      pV! W44      pV P                  V^4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP
                  VP
                  4       V P                  VP                  VP                  4       V P                  We4       \        P                  ! V4      pVP                  ^{4       VP                  ^{4       \        P                  P                  We4       V P                  \        4      ;_uu_ 4       pV! ^R4       RRR4       V P                  \        XP                   4      R4       R#   + '       g   i     L7; i)r   Nr2  r3  r4  )rB   rC   rF   r|   rq   rH   rI   r6  s   &&      r   check_2dConstructorBaseTest.check_2dF  s   v!1!<Ak##C+8==1HNN3HNN3h&6&67.==%c


.z**b!RL +R\\*,MN +*s   
FF	c                    \        V4      pV P                  \        4      ;_uu_ 4       pV! 4        RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)zAChecks that pyfunc will error, not segfaulting due to array size.Nzarray is too big)r:   r   r5  r   r   r   )rB   rC   rF   es   &&  r   check_alloc_size$ConstructorBaseTest.check_alloc_size[  sL    vz**aG +	
 +*s   A  A0	rL   N)
rM   rN   rO   rP   r/  r7  r:  r>  rQ   rR   rS   s   @r   r+  r+    s      / O*O*
 
r   r+  c                      a a ] tR tRt oV 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VtV ;t# )TestNdZerosif  c                V   < \         \        V `  4        \        P                  V n        R # r   )superrA  setUpr   zerosrC   rB   	__class__s   &r   rD  TestNdZeros.setUph  s    k4&(hhr   c                D    \         P                  P                  W4       R # r   r   r?   r@   rB   rI   rH   s   &&&r   r.  TestNdZeros.check_result_valuel      


.r   c                N   a V P                   oV3R  lpV P                  V4       R# )c                     < S ! R4      # NrL   rL   rC   s   r   func!TestNdZeros.test_0d.<locals>.funcq  s    ":r   N)rC   r/  rB   rR  rC   s   & @r   test_0dTestNdZeros.test_0do  s    	dr   c                N   a V P                   oV3R  lpV P                  V4       R# )c                    < S! V 4      # r   rL   rq   rC   s   &r   rR  !TestNdZeros.test_1d.<locals>.funcw  s    !9r   NrC   r7  rT  s   & @r   test_1dTestNdZeros.test_1du  s    	dr   c                N   a V P                   oV3R  lpV P                  V4       R# )c                 2   < S! V \         P                  4      # r   r   r{   rY  s   &r   rR  'TestNdZeros.test_1d_dtype.<locals>.func}  s    !RXX&&r   Nr[  rT  s   & @r   test_1d_dtypeTestNdZeros.test_1d_dtype{  s    	'dr   c                ~   aa V P                   o\        P                  ! R 4      oVV3R lpV P                  V4       R# )r{   c                    < S! V S4      # r   rL   rq   _dtyperC   s   &r   rR  0TestNdZeros.test_1d_dtype_instance.<locals>.func      !V$$r   N)rC   r   r=   r7  rB   rR  rg  rC   s   & @@r   test_1d_dtype_instance"TestNdZeros.test_1d_dtype_instance  s+    '"	%dr   c                   aa V P                   oR oVV3R lpV P                  V4       V3R lpV P                  V4       R# )r{   c                    < S! V S4      # r   rL   rf  s   &r   rR  +TestNdZeros.test_1d_dtype_str.<locals>.func  ri  r   c                    < S! V R 4      # )
complex128rL   rY  s   &r   rR  ro    s    !\**r   Nr[  rj  s   & @@r   test_1d_dtype_strTestNdZeros.test_1d_dtype_str  s3    	%d	+dr   c                   aa V P                   oR oVV3R lpV P                  V4       V3R lpV P                  V4       R# )i4c                    < S! V S4      # r   rL   rf  s   &r   rR  @TestNdZeros.test_1d_dtype_str_alternative_spelling.<locals>.func  ri  r   c                    < S! V R 4      # )c8rL   rY  s   &r   rR  rw    s    !T?"r   Nr[  rj  s   & @@r   &test_1d_dtype_str_alternative_spelling2TestNdZeros.test_1d_dtype_str_alternative_spelling  s3    	%d	#dr   c                V   aa V P                   oR oVV3R lpV P                  V4       R# )zi4, (2,3)f8c                    < S! V S4      # r   rL   rf  s   &r   rR  <TestNdZeros.test_1d_dtype_str_structured_dtype.<locals>.func  ri  r   Nr[  rj  s   & @@r   "test_1d_dtype_str_structured_dtype.TestNdZeros.test_1d_dtype_str_structured_dtype  s"    	%dr   c                B  a V P                   o\        V3R  l4       pV P                  \        4      ;_uu_ 4       pV! ^R4       RRR4       \	        XP
                  4      pRV P                   P                   R2pV P                  WC4       R#   + '       g   i     LR; i)c                    < S! W4      # r   rL   rq   dtrC   s   &&r   rR  5TestNdZeros.test_1d_dtype_non_const_str.<locals>.func      != r   r{   NIf np.0 dtype is a string it must be a string constant.)rC   r   r   r   r   r   rM   r   rB   rR  r   excstrmsgrC   s   &    @r   test_1d_dtype_non_const_str'TestNdZeros.test_1d_dtype_non_const_str  s    		! 
	! {++vG , V%%&,,- ." "c" ,+s   
BB	c                  a V P                   o\        V3R  l4       pV P                  \        4      ;_uu_ 4       pV! ^4       RRR4       \	        XP
                  4      pV P                  RV4       R#   + '       g   i     L9; i)c                    < S! V R 4      # ABCDEFrL   rY  s   &r   rR  3TestNdZeros.test_1d_dtype_invalid_str.<locals>.func      !X&&r   N'Invalid NumPy dtype specified: 'ABCDEF')rC   r   r   r   r   r   r   rB   rR  r   r  rC   s   &   @r   test_1d_dtype_invalid_str%TestNdZeros.test_1d_dtype_invalid_str  si    		' 
	' {++vG , V%%&?H	 ,+s   	A44B	c                N   a V P                   oV3R  lpV P                  V4       R# )c                    < S! W34      # r   rL   r|   rq   rC   s   &&r   rR  !TestNdZeros.test_2d.<locals>.func  s    1&>!r   NrC   r:  rT  s   & @r   test_2dTestNdZeros.test_2d  s    	"dr   c                x  a V P                   oV3R  lpV P                  V4       V3R lpV P                  V4       \        P                  '       dU   \	        V3R l4      pV P                  \        4      ;_uu_ 4        V! \        P                  ! R4      ^4       RRR4       R# R#   + '       g   i     R# ; i)c                 h   < S! \         P                  ! V 4      \         P                  ! V4      34      # r   )r   int16r{   r  s   &&r   func1/TestNdZeros.test_2d_shape_dtypes.<locals>.func1  s#    288A;455r   c                 h   < S! \         P                  ! V 4      \         P                  ! V4      34      # r   )r   int64int8r  s   &&r   func2/TestNdZeros.test_2d_shape_dtypes.<locals>.func2  s#    288A;
344r   c                    < S! W34      # r   rL   r  s   &&r   <lambda>2TestNdZeros.test_2d_shape_dtypes.<locals>.<lambda>  s    vr   N        )	rC   r:  r   	IS_32BITSr:   r   r5  r   r  )rB   r  r  rF   rC   s   &   @r   test_2d_shape_dtypes TestNdZeros.test_2d_shape_dtypes  s    	6e	5e67E"":..bhh}-q1 /. ...s   >B((B9	c                N   a V P                   oV3R  lpV P                  V4       R# )c                 6   < S! W3\         P                  R 7      # r   )r   	complex64r  s   &&r   rR  -TestNdZeros.test_2d_dtype_kwarg.<locals>.func  s    1&55r   Nr  rT  s   & @r   test_2d_dtype_kwargTestNdZeros.test_2d_dtype_kwarg  s    	6dr   c                N   a V P                   oV3R  lpV P                  V4       R# )c                    < S! W3R R7      # )r  r   rL   r  s   &&r   rR  1TestNdZeros.test_2d_dtype_str_kwarg.<locals>.func  s    1&44r   Nr  rT  s   & @r   test_2d_dtype_str_kwarg#TestNdZeros.test_2d_dtype_str_kwarg  s    	5dr   c                N   a V P                   oV3R  lpV P                  V4       R# )c                    < S! W3R R7      # )ry  r   rL   r  s   &&r   rR  FTestNdZeros.test_2d_dtype_str_kwarg_alternative_spelling.<locals>.func  s    1&--r   Nr  rT  s   & @r   ,test_2d_dtype_str_kwarg_alternative_spelling8TestNdZeros.test_2d_dtype_str_kwarg_alternative_spelling  s    	.dr   c                4  a V P                   o\        P                  P                  pV3R  lpV P	                  V! ^V^,
          ,          \
        P                  4      4       V P	                  V! ^V^,
          ,          ^@3\
        P                  4      4       R# )c                    <a a VVV 3R  l# )c                     < S! SS 4      # r   rL   )r=   rC   rh   s   r   r  ?TestNdZeros.test_alloc_size.<locals>.gen_func.<locals>.<lambda>  s    F5%0r   rL   )rh   r=   rC   s   ffr   gen_func-TestNdZeros.test_alloc_size.<locals>.gen_func  s	    00r   N)rC   r   intpbitwidthr>  r   )rB   widthr  rC   s   &  @r   test_alloc_sizeTestNdZeros.test_alloc_size  si    

##	1 	hqEAI~rww?@hUQY';RWWEFr   rQ  )rM   rN   rO   rP   rD  r.  rU  r\  rb  rk  rr  rz  r  r  r  r  r  r  r  r  r  rQ   rR   __classcell__rG  rT   s   @@r   rA  rA  f  sb     /	
#I2 G Gr   rA  c                   \   a a ] tR tRt oV 3R lt]P                  V 3R l4       tRtVt	V ;t
# )
TestNdOnesi  c                V   < \         \        V `  4        \        P                  V n        R # r   )rC  r  rD  r   r   rC   rF  s   &r   rD  TestNdOnes.setUp  s    j$%'ggr   c                $   < \         SV `  4        R # r   )rC  r  rF  s   &r   r  -TestNdOnes.test_1d_dtype_str_structured_dtype  s    24r   rQ  )rM   rN   rO   rP   rD  unittestexpectedFailurer  rQ   rR   r  r  s   @@r   r  r    s)      5 5 5r   r  c                   t   a  ] tR tR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V tR# )
TestNdFulli  c                D    \         P                  P                  W4       R # r   rJ  rK  s   &&&r   r.  TestNdFull.check_result_value  rM  r   c                .    R  pV P                  V4       R# )c                  0    \         P                  ! RR 4      # )      @rL   r   fullrL   r   r   rR   TestNdFull.test_0d.<locals>.func  s    772s##r   N)r/  rB   rR  s   & r   rU  TestNdFull.test_0d  s    	$dr   c                .    R  pV P                  V4       R# )c                 0    \         P                  ! V R 4      # r  r  rq   s   &r   rR   TestNdFull.test_1d.<locals>.func  s    771c?"r   Nr7  r  s   & r   r\  TestNdFull.test_1d  s    	#dr   c                .    R  pV P                  V4       R# )c                 N    \         P                  ! V R \         P                  4      # r  )r   r  bool_r  s   &r   rR  &TestNdFull.test_1d_dtype.<locals>.func  s    771c288,,r   Nr  r  s   & r   rb  TestNdFull.test_1d_dtype  s    	-dr   c                b   a \         P                  ! R 4      oV3R lpV P                  V4       R# )boolc                 4   < \         P                  ! V R S4      # r  r  rq   r=   s   &r   rR  /TestNdFull.test_1d_dtype_instance.<locals>.func  s    771c5))r   N)r   r=   r7  rB   rR  r=   s   & @r   rk  !TestNdFull.test_1d_dtype_instance  s"     	*dr   c                .    R  pV P                  V4       R# )c                 2    \         P                  ! V R R4      # r  r  r  r  s   &r   rR  *TestNdFull.test_1d_dtype_str.<locals>.func  s    771c7++r   Nr  r  s   & r   rr  TestNdFull.test_1d_dtype_str  s    	,dr   c                .    R  pV P                  V4       R# )c                 2    \         P                  ! V R R4      # )r  ?r  r  s   &r   rR  ?TestNdFull.test_1d_dtype_str_alternative_spelling.<locals>.func#  s    771c3''r   Nr  r  s   & r   rz  1TestNdFull.test_1d_dtype_str_alternative_spelling!  s    	(dr   c                    \         R  4       pV P                  \        4      ;_uu_ 4       pV! RRR4       RRR4       \        XP                  4      pRpV P                  WC4       R#   + '       g   i     L:; i)c                 0    \         P                  ! WV4      # r   r  )rq   fvr  s   &&&r   rR  4TestNdFull.test_1d_dtype_non_const_str.<locals>.func)  s    771"%%r   r  r{   Nz:If np.full dtype is a string it must be a string constant.   r   r   r   r   r   r   rB   rR  r   r  r  s   &    r   r  &TestNdFull.test_1d_dtype_non_const_str'  sh    		& 
	& {++vsG$ , V%%&"c" ,+s   A''A7	c                    \         R  4       pV P                  \        4      ;_uu_ 4       pV! RR4       RRR4       \        XP                  4      pV P                  RV4       R#   + '       g   i     L9; i)c                 0    \         P                  ! WR 4      # r  r  )rq   r  s   &&r   rR  2TestNdFull.test_1d_dtype_invalid_str.<locals>.func7  s    771(++r   r  Nr  r  r  rB   rR  r   r  s   &   r   r  $TestNdFull.test_1d_dtype_invalid_str5  sa    		, 
	, {++vsO , V%%&?H	 ,+s   
A%%A5	c                .    R  pV P                  V4       R# )c                 2    \         P                  ! W3R 4      # r  r  r|   rq   s   &&r   rR   TestNdFull.test_2d.<locals>.funcB  s    77A63''r   Nr:  r  s   & r   r  TestNdFull.test_2dA  s    	(dr   c                .    R  pV P                  V4       R# )c                 R    \         P                  ! W3R\         P                  R7      # )r   r   y      ?      @)r   r  r  r  s   &&r   rR  ,TestNdFull.test_2d_dtype_kwarg.<locals>.funcG  s    77A682<<@@r   Nr  r  s   & r   r  TestNdFull.test_2d_dtype_kwargF  s    	Adr   c                ~    R  pV P                  V4       R pV P                  V4       R pV P                  V4       R# )c                 Z    \         P                  ! W3\         P                  ! ^4      4      # r   )r   r  r{   r  s   &&r   rR  0TestNdFull.test_2d_dtype_from_type.<locals>.funcM  s    77A6288A;//r   c                 Z    \         P                  ! W3\         P                  ! ^4      4      # r   )r   r  rq  r  s   &&r   rR  r  R  s    77A62==#344r   c                 R    \         P                  ! W3^\         P                  R7      # )r   r   )r   r  r  r  s   &&r   rR  r  W  s    77A61BGG44r   Nr  r  s   & r   test_2d_dtype_from_type"TestNdFull.test_2d_dtype_from_typeK  s5    	0d	5d	5dr   c                L   R  pV P                  V4       R pV P                  V4       \        P                  '       dR   \        R 4      pV P	                  \
        4      ;_uu_ 4        V! \        P                  ! R4      ^4       RRR4       R# R#   + '       g   i     R# ; i)c                     \         P                  ! \         P                  ! V 4      \         P                  ! V4      3R 4      # r  )r   r  r  r{   r  s   &&r   r  .TestNdFull.test_2d_shape_dtypes.<locals>.func1]  s(    77BHHQK!5s;;r   c                     \         P                  ! \         P                  ! V 4      \         P                  ! V4      3R 4      # r  )r   r  r  r  r  s   &&r   r  .TestNdFull.test_2d_shape_dtypes.<locals>.func2a  s(    77BHHQK4c::r   c                 2    \         P                  ! W3R 4      # r  r  r  s   &&r   r  1TestNdFull.test_2d_shape_dtypes.<locals>.<lambda>f  s    (<r   Nr  )r:  r   r  r:   r   r5  r   r  )rB   r  r  rF   s   &   r   r  TestNdFull.test_2d_shape_dtypes[  sv    	<e	;e<=E"":..bhh}-q1 /. ...s   (BB#	c                    \         P                  P                  pR  pV P                  V! ^V^,
          ,          ^4      4       V P                  V! ^V^,
          ,          ^@3^4      4       R# )c                    a a V V3R  l# )c                  2   < \         P                  ! S S4      # r   r  rh   values   r   r  >TestNdFull.test_alloc_size.<locals>.gen_func.<locals>.<lambda>m  s    BGGE51r   rL   r)  s   ffr   r  ,TestNdFull.test_alloc_size.<locals>.gen_funcl  s	    11r   N)r   r  r  r>  )rB   r  r  s   &  r   r  TestNdFull.test_alloc_sizej  sW    

##	2 	hqEAI~q9:hUQY';Q?@r   rL   N)rM   rN   rO   rP   r.  rU  r\  rb  rk  rr  rz  r  r  r  r  r  r  r  rQ   rR   rS   s   @r   r  r    sS     /



#
I

 2A Ar   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )ConstructorLikeBaseTestis  c                     VP                  ^*4       R#   \        \        3 d3    RTP                  P                  ,          pTP                  T4        R# i ; i)rb      xN)rk   	TypeErrorr5  r=   ru   )rB   rZ   
fill_values   && r   mutate_array$ConstructorLikeBaseTest.mutate_arrayu  sF    	!HHRL:& 	!		 2 22JHHZ 	!s    ?AAc                  a aa VVV 3R  lp\         P                  ! ^ ^^4      P                  V4      p\        S4      oR F  pVR8X  d   VRR P	                  R4      pMVP	                  V4      pV! V4       VP
                  ^ 8  d   V! VR,          4       RVP                  R&   S P                  \        4      ;_uu_ 4        ^V^ &   RRR4       V! V4       K  	  V! V^ ,          4       R#   + '       g   i     L-; i)c                   < S! V 4      pS! V 4      pSP                  VP                  VP                  4       SP                  VP                  VP                  4       SP                  W!4       SP	                  W!4       SP                  V4       SP                  V4       \        P                  P                  W!4       R # r   )	r;   r<   r=   r>   r.  r4  r   r?   r@   )rZ   rH   rI   rF   rC   rB   s   &  r   	check_arr5ConstructorLikeBaseTest.check_like.<locals>.check_arr~  s    c{H*CSXXx}}5SYY7##C2##C2c"h'JJ##C2r   N:NNr   F	WRITEABLErL   )   r   r  r   r   r  )r  r   r   rL   r3  )	r   linspaceastyper:   r   ndimflagsr   r5  )rB   rC   r=   r8  origrh   rZ   rF   s   ff&    @r   
check_like"ConstructorLikeBaseTest.check_like}  s    
	3 {{1a#**51v:E{23i''+ll5)cNxx!|#c(#%*CIIk""":..A /cN ;" 	$q' /.s   C//C?rL   N)rM   rN   rO   rP   r4  rC  rQ   rR   rS   s   @r   r/  r/  s  s     !! !r   r/  c                   t   a a ] tR tRt oV 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VtV ;t# )TestNdEmptyLikei  c                V   < \         \        V `  4        \        P                  V n        R # r   )rC  rF  rD  r   r   rC   rF  s   &r   rD  TestNdEmptyLike.setUp      ot*,mmr   c                    R # r   rL   rK  s   &&&r   r.  "TestNdEmptyLike.check_result_value  s    r   c                l   a V P                   oV3R  lpV P                  V\        P                  4       R# )c                    < S! V 4      # r   rL   rZ   rC   s   &r   rR  'TestNdEmptyLike.test_like.<locals>.func      #;r   NrC   rC  r   ri   rT  s   & @r   	test_likeTestNdEmptyLike.test_like  s#    	bjj)r   c                   a \         P                  ! R \         P                  3R\         P                  3.4      pV P                  oV3R lpV P                  W!4       R# )r   r   c                    < S! V 4      # r   rL   rN  s   &r   rR  2TestNdEmptyLike.test_like_structured.<locals>.func  rP  r   N)r   r=   r  r   rC   rC  )rB   r=   rR  rC   s   &  @r   test_like_structured$TestNdEmptyLike.test_like_structured  sA    3/C+<=>	$r   c                l   a V P                   oV3R  lpV P                  V\        P                  4       R# )c                 2   < S! V \         P                  4      # r   r`  rN  s   &r   rR  -TestNdEmptyLike.test_like_dtype.<locals>.func  s    #rxx((r   NrQ  rT  s   & @r   test_like_dtypeTestNdEmptyLike.test_like_dtype  s#    	)bjj)r   c                   aa \         P                  ! R 4      oV P                  oVV3R lpV P                  V\         P                  4       R# )r{   c                    < S! V S4      # r   rL   rZ   r=   rC   s   &r   rR  6TestNdEmptyLike.test_like_dtype_instance.<locals>.func      #u%%r   N)r   r=   rC   rC  ri   rB   rR  r=   rC   s   & @@r   test_like_dtype_instance(TestNdEmptyLike.test_like_dtype_instance  s1    !	&bjj)r   c                   aa \         P                  ! R \         P                  3R\         P                  3.4      oV P                  oVV3R lpV P                  V\         P                  4       R# )r   r   c                    < S! V S4      # r   rL   r`  s   &r   rR  8TestNdEmptyLike.test_like_dtype_structured.<locals>.func  rb  r   N)r   r=   r  r   rC   rC  ri   rc  s   & @@r   test_like_dtype_structured*TestNdEmptyLike.test_like_dtype_structured  sG    3/C+<=>	&bjj)r   c                l   a V P                   oV3R  lpV P                  V\        P                  4       R# )c                 4   < S! V \         P                  R 7      # r  r`  rN  s   &r   rR  3TestNdEmptyLike.test_like_dtype_kwarg.<locals>.func  s    #RXX..r   NrQ  rT  s   & @r   test_like_dtype_kwarg%TestNdEmptyLike.test_like_dtype_kwarg  s#    	/bjj)r   c                l   a V P                   oV3R  lpV P                  V\        P                  4       R# )c                    < S! V R R7      # )r{   r   rL   rN  s   &r   rR  7TestNdEmptyLike.test_like_dtype_str_kwarg.<locals>.func  s    #W--r   NrQ  rT  s   & @r   test_like_dtype_str_kwarg)TestNdEmptyLike.test_like_dtype_str_kwarg  s#    	.bjj)r   c                l   a V P                   oV3R  lpV P                  V\        P                  4       R# )c                    < S! V R R7      # )ru  r   rL   rN  s   &r   rR  LTestNdEmptyLike.test_like_dtype_str_kwarg_alternative_spelling.<locals>.func  s    #T**r   NrQ  rT  s   & @r   .test_like_dtype_str_kwarg_alternative_spelling>TestNdEmptyLike.test_like_dtype_str_kwarg_alternative_spelling  s#    	+bjj)r   c                  a V P                   o\        V3R  l4       pV P                  \        4      ;_uu_ 4       pV! \        P
                  ! ^4      R4       RRR4       \        XP                  4      pRV P                   P                   R2pV P                  WC4       V P                  RP                  SP                  4      V4       R#   + '       g   i     L}; i)c                    < S! W4      # r   rL   r  s   &&r   rR  ;TestNdEmptyLike.test_like_dtype_non_const_str.<locals>.func  r  r   r{   Nr  r  z'{}(array(float64, 1d, C), unicode_type))rC   r   r   r   r   r   r   r   rM   r   r   r  s   &    @r   test_like_dtype_non_const_str-TestNdEmptyLike.test_like_dtype_non_const_str  s    		! 
	! {++vW% , V%%&,,- ." "c"5<<V__M	 ,+s   CC	c                6  a V P                   o\        V3R  l4       pV P                  \        4      ;_uu_ 4       pV! \        P
                  ! ^4      4       RRR4       \        XP                  4      pV P                  RV4       R#   + '       g   i     L9; i)c                    < S! V R 4      # r  rL   rY  s   &r   rR  9TestNdEmptyLike.test_like_dtype_invalid_str.<locals>.func  r  r   Nr  )	rC   r   r   r   r   r   r   r   r   r  s   &   @r   test_like_dtype_invalid_str+TestNdEmptyLike.test_like_dtype_invalid_str  sr    		' 
	' {++v , V%%&?H	 ,+s   BB	rQ  )rM   rN   rO   rP   rD  r.  rR  rW  r\  rd  ri  rn  rs  rx  r}  r  rQ   rR   r  r  s   @@r   rF  rF    sH     $*%******$I Ir   rF  c                   P   a a ] tR tRt oV 3R ltR tV 3R ltV 3R ltRtVt	V ;t
# )TestNdZerosLikei  c                V   < \         \        V `  4        \        P                  V n        R # r   )rC  r  rD  r   
zeros_likerC   rF  s   &r   rD  TestNdZerosLike.setUp  rI  r   c                D    \         P                  P                  W4       R # r   rJ  rK  s   &&&r   r.  "TestNdZerosLike.check_result_value  rM  r   c                ,   < \         \        V `  4        R # r   )rC  r  rW  rF  s   &r   rW  $TestNdZerosLike.test_like_structured  s    ot9;r   c                ,   < \         \        V `  4        R # r   )rC  r  ri  rF  s   &r   ri  *TestNdZerosLike.test_like_dtype_structured	  s    ot?Ar   rQ  )rM   rN   rO   rP   rD  r.  rW  ri  rQ   rR   r  r  s   @@r   r  r    s      $/<B Br   r  c                      a a ] tR tRt oV 3R lt]P                  V 3R l4       t]P                  V 3R l4       tRt	Vt
V ;t# )TestNdOnesLikei  c                d   < \         \        V `  4        \        P                  V n        ^V n        R# r-  )rC  r  rD  r   	ones_likerC   expected_valuerF  s   &r   rD  TestNdOnesLike.setUp  s#    nd)+llr   c                ,   < \         \        V `  4        R # r   )rC  r  rW  rF  s   &r   rW  #TestNdOnesLike.test_like_structured  s    nd8:r   c                ,   < \         \        V `  4        R # r   )rC  r  ri  rF  s   &r   ri  )TestNdOnesLike.test_like_dtype_structured  s    nd>@r   )r  rC   )rM   rN   rO   rP   rD  r  r  rW  ri  rQ   rR   r  r  s   @@r   r  r    sF       ; ; A A Ar   r  c                   z   a  ] tR tRt o R tR t]P                  R 4       tR t	R t
R tR tR	 tR
 tR tRtV tR# )TestNdFullLikei  c                D    \         P                  P                  W4       R # r   rJ  rK  s   &&&r   r.  !TestNdFullLike.check_result_value!  rM  r   c                L    R  pV P                  V\        P                  4       R# )c                 0    \         P                  ! V R 4      #       @r   	full_likere   s   &r   rR  &TestNdFullLike.test_like.<locals>.func%      <<S))r   NrC  r   ri   r  s   & r   rR  TestNdFullLike.test_like$  s    	*bjj)r   c                    \         P                  ! R \         P                  3R\         P                  3.4      pR pV P	                  W!4       R# )r   r   c                 0    \         P                  ! V R 4      # r  r  re   s   &r   rR  1TestNdFullLike.test_like_structured.<locals>.func-  r  r   N)r   r=   r  r   rC  )rB   r=   rR  s   &  r   rW  #TestNdFullLike.test_like_structured*  s7    3/C+<=>	*$r   c                L    R  pV P                  V\        P                  4       R# )c                 N    \         P                  ! V R \         P                  4      # r  r   r  r  re   s   &r   rR  ,TestNdFullLike.test_like_dtype.<locals>.func2  s    <<S"((33r   Nr  r  s   & r   r\  TestNdFullLike.test_like_dtype1  s    	4bjj)r   c                   a \         P                  ! R 4      oV3R lpV P                  V\         P                  4       R# )r  c                 4   < \         P                  ! V R S4      # r  r  )rZ   r=   s   &r   rR  5TestNdFullLike.test_like_dtype_instance.<locals>.func8  s    <<S%00r   N)r   r=   rC  ri   r  s   & @r   rd  'TestNdFullLike.test_like_dtype_instance6  s(     	1bjj)r   c                L    R  pV P                  V\        P                  4       R# )c                 P    \         P                  ! V R \         P                  R7      # )r  r   r  re   s   &r   rR  2TestNdFullLike.test_like_dtype_kwarg.<locals>.func=  s    <<S99r   Nr  r  s   & r   rn  $TestNdFullLike.test_like_dtype_kwarg<  s    	:bjj)r   c                L    R  pV P                  V\        P                  4       R# )c                 2    \         P                  ! V R R4      # r  r  re   s   &r   rR  6TestNdFullLike.test_like_dtype_str_kwarg.<locals>.funcB  s    <<S'22r   Nr  r  s   & r   rs  (TestNdFullLike.test_like_dtype_str_kwargA  s    	3bjj)r   c                L    R  pV P                  V\        P                  4       R# )c                 4    \         P                  ! V R RR7      # )r  r  r   r  re   s   &r   rR  KTestNdFullLike.test_like_dtype_str_kwarg_alternative_spelling.<locals>.funcG  s    <<S44r   Nr  r  s   & r   rx  =TestNdFullLike.test_like_dtype_str_kwarg_alternative_spellingF  s    	5bjj)r   c                   \         R  4       pV P                  \        4      ;_uu_ 4       pV! \        P                  ! ^4      RR4       RRR4       \        XP                  4      pRpV P                  WC4       R#   + '       g   i     L:; i)c                 0    \         P                  ! WV4      # r   r  )rZ   r  r  s   &&&r   rR  @TestNdFullLike.test_like_dtype_non_const_str_kwarg.<locals>.funcM  s    <<,,r   r  r{   Nz?If np.full_like dtype is a string it must be a string constant.r   r   r   r   r   r   r   r   r  s   &    r   #test_like_dtype_non_const_str_kwarg2TestNdFullLike.test_like_dtype_non_const_str_kwargK  sp    		- 
	- {++vc7+ , V%%&"c" ,+s   A;;B	c                   \         R  4       pV P                  \        4      ;_uu_ 4       pV! \        P                  ! ^4      R4       RRR4       \        XP                  4      pV P                  RV4       R#   + '       g   i     L9; i)c                 0    \         P                  ! WR 4      # r  r  )rZ   r  s   &&r   rR  8TestNdFullLike.test_like_dtype_invalid_str.<locals>.func[  s    <<22r   g333333@Nr  r  r  s   &   r   r  *TestNdFullLike.test_like_dtype_invalid_strY  sj    		3 
	3 {++vS! , V%%&?H	 ,+s   A99B		rL   N)rM   rN   rO   rP   r.  rR  r  r  rW  r\  rd  rn  rs  rx  r  r  rQ   rR   rS   s   @r   r  r    sS     /* % %*
**
*
*
#
I 
Ir   r  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestNdIdentityif  c                ,    V P                  VR.4       R# )r  Nr  rJ   rB   rC   s   &&r   check_identityTestNdIdentity.check_identityh  s    6D6*r   c                .    R  pV P                  V4       R# )c                 .    \         P                  ! V 4      # r   r   identityr  s   &r   rR  *TestNdIdentity.test_identity.<locals>.funcl  s    ;;q>!r   N)r  r  s   & r   test_identityTestNdIdentity.test_identityk  s    	"D!r   c                   a \         P                  \         P                  \         P                  \         P                  ! R 4      R3 F  oV3R lpV P                  V4       K  	  R# )r  r  c                 2   < \         P                  ! V S4      # r   r  r  s   &r   rR  0TestNdIdentity.test_identity_dtype.<locals>.funcs  s    {{1e,,r   N)r   r  r  r  r=   r  r  s   & @r   test_identity_dtype"TestNdIdentity.test_identity_dtypep  sC    llBHHbhh8HE-%	r   c                    \         R  4       pV P                  \        4      ;_uu_ 4       pV! ^R4       RRR4       \        XP                  4      pRpV P                  WC4       R#   + '       g   i     L:; i)c                 .    \         P                  ! W4      # r   r  )rq   r  s   &&r   rR  @TestNdIdentity.test_like_dtype_non_const_str_kwarg.<locals>.funcy  s    ;;q%%r   r{   Nz>If np.identity dtype is a string it must be a string constant.r  r  s   &    r   r  2TestNdIdentity.test_like_dtype_non_const_str_kwargw  sf    		& 
	& {++vG , V%%&"c" ,+   
A&&A6	rL   N)
rM   rN   rO   rP   r  r  r  r  rQ   rR   rS   s   @r   r  r  f  s     +"
&# #r   r  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
# )	TestNdEyei  c                4    R  pV P                  VRR.4       R# )c                 .    \         P                  ! V 4      # r   r   eyer  s   &r   rR  "TestNdEye.test_eye_n.<locals>.func  s    66!9r   Nr   r  r  r  s   & r   
test_eye_nTestNdEye.test_eye_n  s    	4$.r   c                    R \         P                  \         P                  ! ^4      3 F  pV3R lpV P                  VRR.4       K  	  R # )Nc                 0    \         P                  ! WR 7      # r  r  r  s   &&r   rR  (TestNdEye.test_eye_n_dtype.<locals>.func  s    vva--r   r   r  )r   rq  r  rJ   )rB   r  rR  s   &  r   test_eye_n_dtypeTestNdEye.test_eye_n_dtype  s;    Q8B  .tdD\2 9r   c                4    R  pV P                  V. RO4       R# )c                 .    \         P                  ! W4      # r   r  rq   r|   s   &&r   rR  $TestNdEye.test_eye_n_m.<locals>.func  s    66!<r   N)r   r   r  r   )r   r  r  r  s   & r   test_eye_n_mTestNdEye.test_eye_n_m  s    	 4!9:r   c                .    V P                  V. RO4       R# )r   N))r   r   r   )r  r   r   )r  r   r3  )r   r  )r   r  )r   r  r  r  r  s   &&r   check_eye_n_m_kTestNdEye.check_eye_n_m_k  s    4 "- 	.r   c                .    R  pV P                  V4       R# )c                 0    \         P                  ! WV4      # r   r  rq   r|   r   s   &&&r   rR  &TestNdEye.test_eye_n_m_k.<locals>.func  s    66!?"r   Nr  r  s   & r   test_eye_n_m_kTestNdEye.test_eye_n_m_k  s    	#T"r   c                .    R  pV P                  V4       R# )c                 P    \         P                  ! WV\         P                  R 7      # )NMr   r=   )r   r  r  r   s   &&&r   rR  ,TestNdEye.test_eye_n_m_k_dtype.<locals>.func  s    66Aarxx88r   Nr  r  s   & r   test_eye_n_m_k_dtypeTestNdEye.test_eye_n_m_k_dtype  s    	9T"r   c                b   a \         P                  ! R 4      oV3R lpV P                  V4       R# )r  c                 6   < \         P                  ! WVSR 7      # r  r  )rq   r|   r   r=   s   &&&r   rR  5TestNdEye.test_eye_n_m_k_dtype_instance.<locals>.func  s    66Aau55r   N)r   r=   r  r  s   & @r   test_eye_n_m_k_dtype_instance'TestNdEye.test_eye_n_m_k_dtype_instance  s$    !	6T"r   rL   N)rM   rN   rO   rP   r  r  r  r  r  r  r  rQ   rR   rS   s   @r   r  r    s-     /
3;
.#
#
# #r   r  c                   P   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
tV tR# )
TestNdDiagi  c                   \         P                  ! . RO4      p\         P                  ! . RO.4      p\         P                  ! V4      pWV.V n        \         P                  ! ^4      P                  ^^4      p\         P                  ! ^4      P                  ^^4      pWE.V n        R pW`n        \        V4      V n	        RR lpWpn
        \        V4      V n        R# )r   c                 .    \         P                  ! V 4      # r   r   diag)qs   &r   rR  TestNdDiag.setUp.<locals>.func  s    771:r   c                 0    \         P                  ! WR 7      # )r   r  )r  r   s   &&r   
func_kwarg$TestNdDiag.setUp.<locals>.func_kwarg  s    771?"r   Nr=  r   )r   array	transposevectorsrt   r   	matriciespyr:   jitpy_kwjit_kw)rB   vhvvva3x4a4x3rR  r  s   &       r   rD  TestNdDiag.setUp  s    HHYXXyk"\\"r{yy}$$Q*yy}$$Q*	$<	#
Z(r   c                    V! V/ VB pV! V/ VB pV P                  VP                  VP                  4       V P                  VP                  VP                  4       \        P                  P                  WV4       R # r   )r;   r<   r=   r   r?   r@   )rB   rC   nrtfuncrG   kwargsrH   computeds   &&&*,  r   
check_diagTestNdDiag.check_diag  sb    4*6*D+F+68


3r   c                z    V P                    F*  pV P                  V P                  V P                  V4       K,  	  R # r   )r   r0  r"  r#  rB   ds   & r   test_diag_vect_create TestNdDiag.test_diag_vect_create  s(    AOODGGTXXq1 r   c           	         \        R^
4       F>  pV P                   F+  pV P                  V P                  V P                  W!R7       K-  	  K@  	  R# )r  r  Ni)rp   r   r0  r$  r%  rB   r   r4  s   &  r   test_diag_vect_create_kwarg&TestNdDiag.test_diag_vect_create_kwarg  s:    sBA\\

DKK@ "  r   c                z    V P                    F*  pV P                  V P                  V P                  V4       K,  	  R # r   )r!  r0  r"  r#  r3  s   & r   test_diag_extractTestNdDiag.test_diag_extract  s(    AOODGGTXXq1  r   c           	         \        R^4       F>  pV P                   F+  pV P                  V P                  V P                  W!R7       K-  	  K@  	  R# )r   r  N)rp   r!  r0  r$  r%  r8  s   &  r   test_diag_extract_kwarg"TestNdDiag.test_diag_extract_kwarg  s:    r1A^^

DKK@ $ r   c                   \         P                  ! R ...4      p\        V P                  4      pV P	                  \
        4      ;_uu_ 4        V! 4        RRR4       V P	                  \        4      ;_uu_ 4        V! V4       RRR4       V P	                  \        4      ;_uu_ 4        \        V P                  4      pV! V^R7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lj; i  + '       g   i     R# ; i)      ?Nr  )r   r  r:   r"  r   r2  r   r$  )rB   r4  rF   dfuncs   &   r   test_error_handlingTestNdDiag.test_error_handling  s    HHtfXtww y))G * {++!H ,{++4::&E!qM ,+ *) ,++++s$   C9	C$' C7C!	$C4	7D	c                    \        V P                  4      pR pV P                  \        V4      ;_uu_ 4       pV! R4       RRR4       R#   + '       g   i     R# ; i)z'.*The argument "v" must be array-like.*N)r:   r"  assertRaisesRegexr   )rB   rF   r  r   s   &   r   test_bad_shapeTestNdDiag.test_bad_shape  s?    tww7##K55$K 6555s   	A		A	)r#  r%  r!  r"  r$  r   N)rM   rN   rO   rP   rD  r0  r5  r9  r<  r@  rE  rI  rQ   rR   rS   s   @r   r  r    s4     )$42
A2
A r   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestLinspacei  c                4    R  pV P                  V. RO4       R# )c                 .    \         P                  ! W4      # r   r   r>  r  s   &&r   rC   ,TestLinspace.test_linspace_2.<locals>.pyfunc  s    ;;q$$r   N))r   r   )r   d   )            @)                    @      @)r   r   )      ?      ?              ?r  r  s   & r   test_linspace_2TestLinspace.test_linspace_2  s    	%64	5r   c                4    R  pV P                  V. RO4       R# )c                 0    \         P                  ! WV4      # r   rO  rq   r|   r   s   &&&r   rC   ,TestLinspace.test_linspace_3.<locals>.pyfunc  s    ;;qQ''r   N))r   r   	   )r   r   r  )rR  rS     )rT  rU     )r   r   r   )rV  rW  r  )r   g}Ô%ITr   r  r  s   & r   test_linspace_3TestLinspace.test_linspace_3  s    	(6>	?r   c                z    \         R  4       pRR^drCpV P                  V! W#V4      VP                  W#V4      4       R# )c                 0    \         P                  ! WV4      # r   rO  r\  s   &&&r   rf   0TestLinspace.test_linspace_accuracy.<locals>.foo  s    ;;qQ''r   g        rC  N)r:   assertPreciseEqualpy_func)rB   rf   rq   r|   r   s   &    r   test_linspace_accuracy#TestLinspace.test_linspace_accuracy  sD     
	( 
	( sCaA!ckk!.BCr   rL   N)	rM   rN   rO   rP   rX  ra  rh  rQ   rR   rS   s   @r   rL  rL    s     5?D Dr   rL  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	TestNpyEmptyKeywordi  c                   a V3R  lp. ROp\        V4      pV F_  pV! V4      pV! V4      pV P                  VP                  VP                  4       V P                  VP                  VP                  4       Ka  	  R# )c                 4   < \         P                  ! V SR 7      # r  rc   rh   r=   s   &r   rC   7TestNpyEmptyKeyword._test_with_dtype_kw.<locals>.pyfunc  s    88E//r   Nr   r  r^  r:   r;   r=   rh   rB   r=   rC   shapesrF   srH   r   s   &f      r   _test_with_dtype_kw'TestNpyEmptyKeyword._test_with_dtype_kw  sd    	0 vAayH(CX^^SYY7X^^SYY7	 r   c                    \         P                  \         P                  \         P                  \         P                  ! R 4      3 F  pV P                  V4       K  	  R# r  N)r   r{   r   r  r=   ru  rB   r=   s   & r   test_with_dtype_kws'TestNpyEmptyKeyword.test_with_dtype_kws%  s9    hh

BLL"((;:OPE$$U+ Qr   c                   a V3R  lp. ROp\        V4      pV F_  pV! V4      pV! V4      pV P                  VP                  VP                  4       V P                  VP                  VP                  4       Ka  	  R# )c                 4   < \         P                  ! V SR 7      # )rn  rc   rn  s   &r   rC   ATestNpyEmptyKeyword._test_with_shape_and_dtype_kw.<locals>.pyfunc*  s    88%u55r   Nrp  rq  rr  s   &f      r   _test_with_shape_and_dtype_kw1TestNpyEmptyKeyword._test_with_shape_and_dtype_kw)  sd    	6 vAayH(CX^^SYY7X^^SYY7	 r   c                    \         P                  \         P                  \         P                  \         P                  ! R 4      3 F  pV P                  V4       K  	  R# rx  )r   r{   r   r  r=   r  ry  s   & r   test_with_shape_and_dtype_kws1TestNpyEmptyKeyword.test_with_shape_and_dtype_kws6  s9    hh

BLL"((;:OPE..u5 Qr   c                    R  p\        V4      pV P                  \        4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)c                  ,    \         P                  ! 4       # r   rc   rL   r   r   rC   6TestNpyEmptyKeyword.test_empty_no_args.<locals>.pyfunc<  s    88:r   N)r:   r   r   )rB   rC   rF   s   &  r   test_empty_no_args&TestNpyEmptyKeyword.test_empty_no_args:  s9    	 v {++G ,+++s	   >A	rL   N)rM   rN   rO   rP   ru  rz  r  r  r  rQ   rR   rS   s   @r   rk  rk    s#     8,86
 
r   rk  c                   b   a  ] tR tR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V tR# )TestNpArrayiG  c                    R  p\        V4      pV! ^*4      pV P                  V\        P                  ! ^*\        P                  R7      4       V! R4      pV P                  V\        P                  ! R4      4       R# )c                 .    \         P                  ! V 4      # r   r   r  args   &r   rC   #TestNpArray.test_0d.<locals>.pyfuncJ      88C= r   r   rS  N)r:   rf  r   r  r  rB   rC   rF   r   s   &   r   rU  TestNpArray.test_0dI  s[    	! vBiRXXb%@ACjRXXc]3r   c                4    R  pV P                  VRR.4       R# )c                 N    \         P                  ! V \         P                  R 7      # r  )r   r  r  r  s   &r   rC   .TestNpArray.test_0d_with_dtype.<locals>.pyfuncT      88Crxx00r   N)rb   r  r  r  s   & r   test_0d_with_dtypeTestNpArray.test_0d_with_dtypeS  s    	1 	6E6?3r   c                B   R  p\        V4      pV! . RO4      pV P                  V\        P                  ! . RO4      4       V! R4      pV P                  V\        P                  ! . RO4      4       V! R4      pV P                  V\        P
                  ! R4      4       R# )c                 .    \         P                  ! V 4      # r   r  r  s   &r   rC   #TestNpArray.test_1d.<locals>.pyfuncZ  r  r   N)r   r  rb   )rC  y              @rb   rL   )r:   rf  r   r  r  ri   r  s   &   r   r\  TestNpArray.test_1dY  sy    	! vJRWWZ%89O$RXXo%>?BiRZZ^4r   c                D    R  pV P                  V^^*.3RR.3RR.4       R# )c                 N    \         P                  ! V \         P                  R 7      # r  )r   r  r   r  s   &r   rC   .TestNpArray.test_1d_with_dtype.<locals>.pyfunci  s    88Crzz22r   r  rC  N)r   r  rb   rL   r  r  s   & r   test_1d_with_dtypeTestNpArray.test_1d_with_dtypeh  s6    	3 	6WJ!3ZM+!	r   c                D    R  pV P                  V^^*.3RR.3RR.4       R# )c                 2    \         P                  ! V R R7      # )r   r   r  r  s   &r   rC   2TestNpArray.test_1d_with_str_dtype.<locals>.pyfunct  s    88Cy11r   r  rC  Nr  r  r  r  s   & r   test_1d_with_str_dtype"TestNpArray.test_1d_with_str_dtypes  s6    	2 	6WJ!3ZM+!	r   c                    \         R  4       pV P                  \        4      ;_uu_ 4       pV! RR4       RRR4       \        XP                  4      pRpV P                  WC4       R#   + '       g   i     L:; i)c                 0    \         P                  ! WR 7      # r  r  )r  r  s   &&r   rR  :TestNpArray.test_1d_with_non_const_str_dtype.<locals>.func  s    88C**r   r{   Nz;If np.array dtype is a string it must be a string constant.)r  r  r  r  s   &    r    test_1d_with_non_const_str_dtype,TestNpArray.test_1d_with_non_const_str_dtype~  sf    		+ 
	+ {++v! , V%%&"c" ,+r  c                   R  p\        V4      pV! RR.4      pV P                  V\        P                  ! ^^.^^..4      4       V! RR	.4      pV P                  V\        P                  ! ^R.^R..4      4       V! ^^.^^.34      pV P                  V\        P                  ! ^^.^^..4      4       V! ^^.RR.34      pV P                  V\        P                  ! ^^.RR..4      4       V! R
4      pV P                  V\        P                  ! R^.RR..4      4       V! R4      pV P                  V\        P                  ! R4      4       R# )c                 .    \         P                  ! V 4      # r   r  r  s   &r   rC   #TestNpArray.test_2d.<locals>.pyfunc  r  r   rS  r  r        ?Nr  r  r   r   rS  r  r  ))r  r   )r  r  )rL   rL   )r:   rf  r   r  ri   r  s   &   r   r  TestNpArray.test_2d  sI   	! vVV$%RWWq!fq!f-=%>?Xx()RZZ!SAs80D%EFaVaV$%RWWq!fq!f-=%>?aVc3Z()RZZ!Q#s0D%EF*+RZZ#qC:0F%GHHoRZZ%9:r   c                    R  p\        V4      pV! RR.4      pV P                  V\        P                  ! ^^.^^..4      4       R# )c                 N    \         P                  ! V \         P                  R 7      # r  )r   r  r{   r  s   &r   rC   .TestNpArray.test_2d_with_dtype.<locals>.pyfunc  r  r   Nr  r  )r:   rf  r   r{   r  s   &   r   test_2d_with_dtypeTestNpArray.test_2d_with_dtype  sG    	1 vXx()RXX1v1v.>%?@r   c                  a  R  p\        V4      p\        P                  V 3R l4       pV! R4      ;_uu_ 4        V! \        P                  ! R.4      4       RRR4       V! R4      ;_uu_ 4        V! \        P
                  ! ^4      \        P
                  ! ^4      .34       RRR4       V! R4      ;_uu_ 4        \        P                  ! RR	.4      p\        P                  ! ^VR7      ^ ,          pV! R
\        P
                  ! ^4      V334       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)c                 .    \         P                  ! V 4      # r   r  r  s   &r   rC   'TestNpArray.test_raises.<locals>.pyfunc  r  r   c              3      <"   SP                  \        4      ;_uu_ 4       pR x  R R R 4       SP                  V \        XP                  4      4       R #   + '       g   i     L7; i5ir   )r   r   r   r   r   )r  r   rB   s   & r   check_raises-TestNpArray.test_raises.<locals>.check_raises  sB     "";//6 0MM#s6#3#345 0/s   A(A/A(A%	 A(z;array(float64, 1d, C) not allowed in a homogeneous sequencerC  NzOtype Tuple(int64, reflected list(int64)<iv=None>) does not have a regular shapezrcannot convert Tuple(int64, Record(a[type=int32;offset=0],b[type=float32;offset=4];8;False)) to a homogeneous typer   )r   ru  )r   f4r  )r:   
contextlibcontextmanagerr   r  r  r=   rE  )rB   rC   rF   r  stvals   f     r   test_raisesTestNpArray.test_raises  s   	! v		"	"	6 
#	6
  2 4 4"((B4.!4  : < <288A;!./< K  ;45B((1B'*C6BHHQK-./ 4 4< <  s$   D/4D0;AED-	0E 	E	c                    \         R  4       pRpV P                  \        V4      ;_uu_ 4       pV! R4       RRR4       R#   + '       g   i     R# ; i)c                 .    \         P                  ! V 4      # r   r  )objs   &r   rR  (TestNpArray.test_bad_array.<locals>.func  s    88C= r   z,.*The argument "object" must be array-like.*Nr   rH  r   rB   rR  r  r   s   &   r   test_bad_arrayTestNpArray.test_bad_array  sF    		! 
	! =##K55J 6555s   	A  A	c                    \         R  4       pRpV P                  \        V4      ;_uu_ 4       pV! ^^4       RRR4       R#   + '       g   i     R# ; i)c                 .    \         P                  ! W4      # r   r  )r  r  s   &&r   rR  (TestNpArray.test_bad_dtype.<locals>.func  s    88C$$r   z>.*The argument "dtype" must be a data-type if it is provided.*Nr  r  s   &   r   test_bad_dtypeTestNpArray.test_bad_dtype  sI    		% 
	% O##K55AJ 6555s   
AA	rL   N)rM   rN   rO   rP   rU  r  r\  r  r  r  r  r  r  r  r  rQ   rR   rS   s   @r   r  r  G  sB     445		#;*A0: r   r  c                   `   a  ] tR tRt o RtR t]P                  R 4       tR t	R t
R tRtV tR	# )
TestNpConcatenatei  z
Tests for np.concatenate().
c                    \         P                  ! ^4      P                  R4      pV^
,           pV^
,           P                  RR7      pV^
,           RRR1,          pV^
,           RRRR13,          pWW4V3#    F)orderN.)r   r  r   r3  r   rt   r   r   rB   r   r   r   r4  r=  s   &     r   
_3d_arraysTestNpConcatenate._3d_arrays  j    IIbM!!),FVMMM$VTrTNVS2XQ1}r   c              #     "   V P                  \        4      ;_uu_ 4       pR x  R R R 4       V P                  RV,          \        XP                  4      4       R #   + '       g   i     L>; i5i)Nz*input sizes over dimension %d do not matchr   r5  r   r   r   )rB   r   r   s   && r   assert_invalid_sizes_over_dim/TestNpConcatenate.assert_invalid_sizes_over_dim  sJ     z**f +BTI&**+	- +*s   A.A6A.A+	&A.c           	       a aa	a
 \         o
\        S
4      oVV
V 3R  lo	V	3R lpS P                  4       w  r#rEpV! W#V4       V! W#V4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       S	! VR,          W4RRR1,          ^ R7       S	! W#R,          V^R7       S	! W#VR,          ^R7       V! W#P	                  \
        P                  4      V4       S P                  4        R F6  pS P                  ^ 4      ;_uu_ 4        S! VR,          W3V4       RRR4       K8  	  R	 F5  pS P                  ^4      ;_uu_ 4        S! W#R,          W74       RRR4       K7  	  R#   + '       g   i     K  ; i  + '       g   i     K`  ; i)
c                 v   < VRV,           3 F(  pS! WW$R7      pS! WW$R7      pS	P                  We4       K*  	  R# )r  r   Nrf  )
r   r   r   r   axrH   r   rF   rC   rB   s
   &&&&   r   check(TestNpConcatenate.test_3d.<locals>.check  s<    R$Y'!!3A!-''6 (r   c                 >   < \        ^4       F  pS! WW#4       K  	  R# )r  Nr  )r   r   r   r   r  s   &&& r   check_all_axes1TestNpConcatenate.test_3d.<locals>.check_all_axes  s    aaA$ !r   r   NNNr   r3  r   r  )r   r   r  )r   r   r  r3  )r   r   r  r3  )	r    r:   r  Tr?  r   ri   r   r  )rB   r  r   r   r   r4  r=  r   rF   r  rC   s   f       @@@r   test_3dTestNpConcatenate.test_3d  s    v	7	% )aA 	qQqQqssACC%qssACC%qssACC% 	qssACC% 	aeQ$B$a(a4!!$aAfIA& 	q((2::.2 	! #D33A66aeQ4( 76 # #D33A66a4!* 76 # 766 766s   >G:G-G*-G>c                  a aa \         o\        S4      oVVV 3R  lpS P                  4       w  r#rEpV! W#V4       V! W#V4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       V! VR,          W4RRR1,          4       S P	                  4        S P                  ^4      ;_uu_ 4        S! W#R,          V4       RRR4       R#   + '       g   i     R# ; i)c                 N   < S! WV4      pS! WV4      pSP                  WC4       R # r   r  )r   r   r   rH   r   rF   rC   rB   s   &&&  r   r  0TestNpConcatenate.test_3d_no_axis.<locals>.check#  s'    aAHa.C##C2r   r  Nr3  r  )r   r:   r  r  r   r  )	rB   r  r   r   r   r4  r=  rF   rC   s	   f      @@r   test_3d_no_axis!TestNpConcatenate.test_3d_no_axis  s     v	3
 )aA 	aAaAacc133acc133acc133 	acc133 	aeQ$B$  	! //22!tWa  3222s   &EE	c                "   \         p\        V4      p\        P                  ! ^4      pVP	                  R4      pVP                  \        P                  ! R\        P                  3.4      4      p\        P                  ! ^*4      pV P                  4       ;_uu_ 4       pV! W4V4       RRR4       V P                  R\        XP                  4      4       V P                  4       ;_uu_ 4       pV! W5V4       RRR4       V P                  R\        VP                  4      4       V P                  4       ;_uu_ 4       pV! WfV4       RRR4       V P                  R\        VP                  4      4       V P                  4       ;_uu_ 4       pV! V^V4       RRR4       V P                  R\        VP                  4      4       R#   + '       g   i     EL&; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lq; i)   r   Nz8all the input arrays must have same number of dimensionsz(input arrays must have compatible dtypesz.zero-dimensional arrays cannot be concatenated%expecting a non-empty tuple of arrays)r  r  )r   r:   r   rt   r   r?  r=   r  r  assertTypingErrorr   r   r   )rB   rC   rF   r   r   r   r4  r   s   &       r   test_typing_errors$TestNpConcatenate.test_typing_errorsC  sx    vIIbMIIfHHRXXRWW~./0HHRL ##%%!N &P&**+	- ##%%!N &@&**+	- ##%%!N &F&**+	- ##%%!QN &=s6CSCS?TU) &%% &% &% &%s0   
G,
G;
G+
G>G	G(	+G;	>H	rL   N)rM   rN   rO   rP   __doc__r  r  r  r  r  r  r  rQ   rR   rS   s   @r   r  r    sA      - -0+d"!HV Vr   r  r#   z"this Numpy doesn't have np.stack()c                      a  ] tR tRt o RtR t]P                  R 4       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V tR# )TestNpStackid  z
Tests for np.stack().
c                    \         P                  ! ^4      P                  R4      pV^
,           pV^
,           P                  RR7      pV^
,           RRR1,          pV^
,           RRRR13,          pWW4V3# r  r  r  s   &     r   r  TestNpStack._3d_arraysj  r  r   c              #     "   V P                  \        4      ;_uu_ 4       pR x  R R R 4       V P                  R\        XP                  4      4       R #   + '       g   i     L7; i5i)Nz)all input arrays must have the same shaper  )rB   r   s   & r   assert_invalid_sizes TestNpStack.assert_invalid_sizesr  sE     z**f +A&**+	- +*s   A'A/A'A$	A'c                    V! V!  pV! V!  pV P                  VP                  VP                  4       V P                  VP                  4       VP                  4       4       R # r   )r;   rh   rf  flatten)rB   rC   rF   rG   rH   r   s   &&&&  r   check_stackTestNpStack.check_stacky  sM    4=Tl
 	HNN3x/?/?/ABr   c                  a aaaa
 VVV 3R  lo
V
V3R lpS P                  4       w  rVrxp	V! WVV4       V! WVV4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       V! VP                  VP                  VP                  4       V! VP                  V	P                  VP                  4       V! WVP                  \        P                  4      V4       R# )c                 @   < SP                  SSWV3V,           4       R # r   )r
  )r   r   r   rG   rF   rC   rB   s   &&&&r   r  #TestNpStack.check_3d.<locals>.check  s    VUQ1I,<=r   c                 6   < S! 4        F  pS! WW#4       K  	  R # r   rL   )r   r   r   rG   r  generate_starargss   &&& r   r  ,TestNpStack.check_3d.<locals>.check_all_axes  s    )+aA$ ,r   N)r  r  r?  r   ri   )rB   rC   rF   r  r  r   r   r   r4  r=  r  s   ffff      @r   check_3dTestNpStack.check_3d  s    	>	% )aA 	qQqQqssACC%qssACC%qssACC%qssACC% 	q((2::.2r   c                   V P                  4        V P                  4        V P                  4       w  r4rVpV P                  4       ;_uu_ 4        \	        V! 4       4      pV! VR R WE.VO5!   R R R 4       R #   + '       g   i     R # ; i)Nr3  )assert_no_memory_leakr   r  r  next)	rB   rF   r  r   r   r   r4  r=  rG   s	   &&&      r   check_runtime_errors TestNpStack.check_runtime_errors  so    ""$! )aA&&(()+,D!CR&!&& )(((s   A66B	c                t    \         p\        V4      pR pV P                  WV4       V P                  W#4       R# )z
stack(3d arrays, axis)
c               3   T   "   \        ^4       F  p V 3x  RV ,           3x  K  	  R# 5i)r  Nr  r  r   s    r   r  .TestNpStack.test_3d.<locals>.generate_starargs  s&     agDyl" !s   &(N)r&   r:   r  r  rB   rC   rF   r  s   &   r   r  TestNpStack.test_3d  s6     v	#
 	f%67!!%;r   c                t    \         p\        V4      pR pV P                  WV4       V P                  W#4       R# )z
stack(3d arrays)
c               3      "   Rx  R # 5irP  rL   rL   r   r   r  6TestNpStack.test_3d_no_axis.<locals>.generate_starargs  
     G   	N)r$   r:   r  r  r  s   &   r   r  TestNpStack.test_3d_no_axis  s6     v	 	f%67!!%;r   c                    \         p\        V4      p\        P                  ! ^*4      p\        P                  ! R4      p\        P                  ! R4      pV P	                  WW4V34       R# )z
stack(0d arrays)
TN             )r$   r:   r   r  r
  rB   rC   rF   r   r   r   s   &     r   rU  TestNpStack.test_0d  sM     vHHRLHHSMHHTNq	2r   c                    R pV P                  WV4       \        P                  ! ^*4      p\        P                  ! R4      p\        P                  ! R4      pV P                  WWEV34       R# )z3
3d and 0d tests for hstack(), vstack(), dstack().
c               3      "   Rx  R # 5irP  rL   rL   r   r   r  4TestNpStack.check_xxstack.<locals>.generate_starargs  r!  r"  TNr%  )r  r   r  r
  )rB   rC   rF   r  r   r   r   s   &&&    r   check_xxstackTestNpStack.check_xxstack  sS    	 	f%67HHRLHHSMHHTNq	2r   c                   \         p\        V4      pV P                  W4       \        P                  ! ^4      p\        P                  ! ^4      ^
,           pV P                  WW4V34       \        P                  ! ^4      P                  R4      p\        P                  ! ^4      P                  R4      ^d,           pV P                  WW4V34       R# )r  Nr<  )r   r   )r)   r:   r+  r   rt   r
  r   rB   rC   rF   r   r   s   &    r   test_hstackTestNpStack.test_hstack  s    v6)IIaLIIaL2q	2IIaL  (IIaL  (3.q	2r   c                   \         \        .pV F  p\        V4      pV P                  W#4       \        P
                  ! ^4      pV^
,           pV P                  W#WEV34       \        P
                  ! ^4      P                  R4      p\        P
                  ! ^4      P                  R4      ^d,           pV P                  W#WEV34       K  	  R# )r  Nr  )r   r   )r-   r0   r:   r+  r   rt   r
  r   )rB   	functionsrC   rF   r   r   s   &     r   test_vstackTestNpStack.test_vstack  s     -	F6NEv-		!ABAVQ1I6		!$$V,A		!$$V,s2AVQ1I6  r   c                4   \         p\        V4      pV P                  W4       \        P                  ! ^4      pV^
,           pV P                  WW4V34       \        P                  ! ^4      P                  R4      pV^d,           pV P                  WW4V34       R# )r  Nr  )r3   r:   r+  r   rt   r
  r   r.  s   &    r   test_dstackTestNpStack.test_dstack  s}    v6)IIaLFq	2IIbM!!&)Gq	2r   c                `   \         p\        V4      p\        P                  ! ^4      pV^
,           p\        P                  ! ^4      P	                  R4      pV P                  WW4V34       V P                  4        V P                  4        \        P                  ! ^*4      pV P                  4       ;_uu_ 4        V! W3V34       RRR4       VP	                  R4      pV P                  4       ;_uu_ 4        V! W3V34       RRR4       R#   + '       g   i     LN; i  + '       g   i     R# ; i)r   Nr   r  )r   r   r   )
r6   r:   r   rt   r   r
  r  r   r  r  r&  s   &     r   test_column_stackTestNpStack.test_column_stack  s     vIIaLFIIbM!!&)q	2 	""$! HHRL##%%1) &IIi ##%%1) &% &% &%%s   8D	4D	D	D-	c                p   \         \        \        \        \        3 F  p\        V4      p\        P                  ! ^4      P                  R4      pV P                  4       ;_uu_ 4       pV! V^V4       RRR4       V P                  R\        XP                  4      4       K  	  R#   + '       g   i     L;; i)r  Nr  r9  )r$   r)   r-   r3   r6   r:   r   rt   r   r  r   r   r   )rB   rC   rF   r   r   s   &    r   test_bad_arraysTestNpStack.test_bad_arrays"  s     )Y	?SF6NE		"%%f-A ''))VaA *MMA3vGWGWCXY T
 *)s   'B%%B5rL   N)rM   rN   rO   rP   r   r  r  r  r  r
  r  r  r  r  rU  r+  r/  r3  r6  r:  r=  rQ   rR   rS   s   @r   r  r  d  sm      - -C34	'<<3337$3*Z Zr   r  c                  T  aaaaa R  o\        S4      o\        P                  P                  ^d4      o\        P                  P                  ^d4      oRoVVVV3R lp VVVV3R lp\        P                  ! V 4      p\        P                  ! V4      p\        V4       \        V4       R# )c                0    \        V4       F  pYrK  	  W3# )z1Swap array x and y for t number of times
        r  r  s   &&& r   rC   %benchmark_refct_speed.<locals>.pyfunc.  s     qAq tr   i'  c                     < S ! SSS4       R # r   rL   )rC   r  r   r   s   r   bench_pyfunc+benchmark_refct_speed.<locals>.bench_pyfunc;  s    q!Qr   c                     < S ! SSS4       R # r   rL   )rF   r  r   r   s   r   bench_cfunc*benchmark_refct_speed.<locals>.bench_cfunc>  s    aAr   N)r:   r   r   r   	benchmarkprint)	rC  rF  python_time
numba_timerF   rC   r  r   r   s	       @@@@@r   benchmark_refct_speedrL  -  s     6NE
		A
		AA   //,/K-J	+	*r   __main__)<r  r   numpyr   r   rer   r   numba.core.errorsr   numbar   
numba.corer   r   r   numba.tests.supportr   r	   r
   r   numba.core.utilsr   r  r:   r   r    r$   r&   r)   r-   r0   r3   r6   r8   rV   r_   r+  rA  r  r  objectr/  rF  r  r  r  r  r  r  rL  rk  r  r  
skipUnlesshasattrr  rL  rM   mainrL   r   r   <module>rY     s    
   	  	 )  + + M M &  
4t	$%0*  # &:x : 4? 4
W:< W:tD
, D
NNG%x NGb5 5nA$h nAb+f +\YI-x YIxBo B A_ A$DI,h DIN#X #B)# )#XF FPD8 D8-( -`O/8 OdHV HVV 
WR)+OPEZ/8 EZ QEZP4 zMMO r   