+
    ;i                       ^ RI t ^ 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
HtHtHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIH t  ]!PD                  ^8H  t#]PH                  PK                  R4      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      t0 ! R R]4      t1 ! R R]4      t2 ! R R ]4      t3 ! R! R"]34      t4]4Pk                  4         ! R# R$]34      t6]6Pk                  4         ! R% R&]34      t7]7Pk                  4         ! R' R(]34      t8]8Pk                  4         ! R) R*]34      t9]9Pk                  4         ! R+ R,]34      t:]:Pk                  4         ! R- R.]34      t;];Pk                  4         ! R/ R0]34      t<]<Pk                  4         ! R1 R2]34      t=]=Pk                  4         ! R3 R4]34      t>]>Pk                  4         ! R5 R6]4      t? ! R7 R8]4      t@ ! R9 R:]4      tA ! R; R<]4      tB]CR=8X  d   ]P                  ! 4        R# R# )>    N)guvectorizenjittypeof	vectorize)types)
from_dtype)LoweringErrorTypingError)TestCaseMemoryLeakMixin)supported_ufuncs)numpy_support)
cpu_target)BaseContext)ufunc_dbwin32c                F   a  \         P                  ! S 4      V 3R l4       pR# )zAn 'expectedFailure' like decorator that only expects compilation errors
caused by unimplemented functions that fail in no-python modec                     <  S! V / VB  \        P
                  h  \          d+    \        P                  ! \        P                  ! 4       4      hi ; iN)r
   unittest_ExpectedFailuresysexc_info_UnexpectedSuccess)argskwargsfuncs   *,U/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_ufuncs.pywrapper_unimplemented.<locals>.wrapper   sK    	<$!&! )))  	<++CLLN;;	<s	    5AN)	functoolswraps)r   r   s   f r   _unimplementedr#      s      __T* *    c                 L   / pR P                  \        V P                  4       Uu. uF  pRP                  V4      NK  	  up4      pRP                  W0P                  4      p\        V\        4       V4       VR,          pRP                  V P                  4      Vn        V# u upi ),za{0}zdef fn({0}):
    np.{1}({0})fnz{0}_usecase)joinrangenargsformat__name__execglobals)ufuncldictiarg_strfunc_strr'   s   &     r   _make_ufunc_usecaser4   &   s    Ehh%2DE2DQa(2DEFG.55g~~NH79e$	tB&&u~~6BKI Fs   B!c                     / p\        R P                  V 4      \        4       V4       VR,          pRP                  \        V 4      4      Vn        V# )zdef fn(x):
    return {0}(x)r'   usecase_{0}r-   r+   r.   hashr,   ufunc_opr0   r'   s   &  r   _make_unary_ufunc_op_usecaser;   0   sE    E	(	/	/	979eL	tB&&tH~6BKIr$   c                     / p\        R P                  V 4      \        4       V4       VR,          pRP                  \        V 4      4      Vn        V# )zdef fn(x,y):
    return x{0}yr'   r6   r7   r9   s   &  r   _make_binary_ufunc_op_usecaser=   8   sE    E	)	0	0	:GIuM	tB&&tH~6BKIr$   c                   a  \        S \        4      '       dQ   / p\        RP                  S 4      \	        4       V4       VR,          pRP                  \        S 4      4      Vn        V# V 3R lpTpV# )zGenerates a function to be compiled that performs an inplace operation

ufunc_op can be a string like '+=' or a function like operator.iadd
zdef fn(x,y):
    x{0}yr'   r6   c                    < S! W4       R # r    )xyr:   s   &&r   
inplace_op2_make_inplace_ufunc_op_usecase.<locals>.inplace_opK   s
    QNr$   )
isinstancestrr-   r+   r.   r8   r,   )r:   r0   r'   rC   s   f   r   _make_inplace_ufunc_op_usecaserG   @   sf    
 (C  &--h7EJ4[#**4>:
 I	Ir$   c           	         \        W4       UUu. uF3  w  r#\        P                  ! \        V4      4      P	                  V4      NK5  	  upp# u uppi )z5Convert python values into numpy scalar objects.
    )zipnpdtyperF   type)tyargsr   tyvals   &&  r   _as_dtype_valuerP   Q   s=     8;67HI7HGBBHHSW""3'7HIIIs   9Ac                   r   a a ] tR t^Wt oV 3R lt]P                  ! RR7      RR l4       tRR ltRt	Vt
V ;t# )	BaseUFuncTestc                6
  < \         \        V `  4        \        P                  ! ^ 4      \
        P                  3\        P                  ! ^4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! ^ 4      \
        P                  3\        P                  ! ^4      \
        P                  3\        P                  ! ^ 4      \
        P                  3\        P                  ! ^4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! ^ 4      \
        P                  3\        P                  ! ^4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! R4      \
        P                  3\        P                  ! ^ ^.RR7      \
        P                  ! \
        P                  ^R4      3\        P                  ! ^ ^.RR7      \
        P                  ! \
        P                  ^R4      3\        P                  ! . RORR7      \
        P                  ! \
        P                  ^R4      3\        P                  ! . RORR7      \
        P                  ! \
        P                  ^R4      3\        P                  ! . ROR	R7      \
        P                  ! \
        P                  ^R4      3\        P                  ! . ROR
R7      \
        P                  ! \
        P                  ^R4      3\        P                  ! ^ ^.\        P                  R7      \
        P                  ! \
        P                  ^R4      3\        P                  ! ^ ^.\        P                  R7      \
        P                  ! \
        P                  ^R4      3\        P                  ! ^ ^.\        P                  R7      \
        P                  ! \
        P                  ^R4      3\        P                  ! ^ ^.\        P                   R7      \
        P                  ! \
        P                   ^R4      3.V n        R# )r         ?        u4rK   Cu8i4i8f4f8N      )r^   r      )r_   rU   rT   )superrR   setUprJ   uint32r   int32uint64int64float32float64arrayArrayint8int16uint8uint16inputs)self	__class__s   &r   rb   BaseUFuncTest.setUpY   s   mT(*YYq\5<<(YYq\5<<(XXb\5;;'XXa[%++&XXa[%++&YYq\5<<(YYq\5<<(XXb\5;;'XXa[%++&XXa[%++&ZZu}}-ZZ_emm,ZZ_emm,ZZu}}-ZZ_emm,ZZ_emm,XXqe4(%++ellAs*KLXXqe4(%++ellAs*KLXXhd+U[[a-MNXXhd+U[[a-MNXX&d3[[3/1XX&d3[[3/1 XXqe277+U[[Q-LMXXqe288,ekk%++q#.NOXXqe288,ekk%++q#.NOXXqe299-[[q#.0A"
r$   N)maxsizec                (    \        W#R R7      ! V4      # )T)_nrtno_rewrites)r   )rp   pyfuncr   nrts   &&&&r   _compileBaseUFuncTest._compile   s     D5f==r$   c                0   Tp\        V\        P                  4      '       d   VP                  pVP                  pM^pV\        P
                  9   d<   V'       d   \        P                  ! W%R4      pV# \        P                  ! WER4      p V# V\        P                  9   d<   V'       d   \        P                  ! W%R4      pV# \        P                  ! WER4      p V# V'       d   \        P                  ! W5R4      pV# \        P                  ! WER4      pV# )r`   rX   )rE   r   rj   ndimrK   signed_domainunsigned_domain)rp   
input_typeint_output_typefloat_output_typerN   r|   output_types   &&&&   r   _determine_output_type$BaseUFuncTest._determine_output_type   s    b%++&&77DBD$$$#kk/E  $kk"C8  5(((#kk/E  $kk"C8 	 !#kk*;3G  $kk"C8r$   ro   )F)NN)r,   
__module____qualname____firstlineno__rb   r!   	lru_cachery   r   __static_attributes____classdictcell____classcell__rq   __classdict__s   @@r   rR   rR   W   s4     $
L &> '>
 r$   rR   c                   6   a  ] tR t^t o R tRR ltR tRtV tR# )BasicUFuncTestc                    \        V4      # r   )r4   rp   r/   s   &&r   r4   "BasicUFuncTest._make_ufunc_usecase   s    "5))r$   Nc                   Vf   . pVf   . pV P                  \        4       V P                  V4      p\        V P                  4      V,           p	V	 EFR  p
V
^ ,          pV
^,          p\        V\        4      pV'       d   TpMV3VP                  ,          pW9   d   KM  V'       d)   \        P                  ! V^ ,          ^ 8  4      '       d   K}  V^ ,          P                  P                  V9  d   K  V P                  WV4      pV3VP                  ,          pV3VP                  ,          pVV,           pV P                  VV4      p\        V^ ,          \        P                  4      '       d   V Uu. uF@  p\        P                   ! V^ ,          P"                  VP                  P$                  R7      NKB  	  ppV Uu. uF@  p\        P                   ! V^ ,          P"                  VP                  P$                  R7      NKB  	  ppMvV Uu. uF/  p\        P                   ! ^VP                  P$                  R7      NK1  	  ppV Uu. uF/  p\        P                   ! ^VP                  P$                  R7      NK1  	  ppRp\&        P(                  ! RR7      ;_uu_ 4       p\&        P*                  ! R4       V! . VOVO5!   RpV FS  p\-        VP.                  \0        4      '       g   K%  \3        VP4                  4      P7                  V4      '       g   KQ  RpKU  	  R R R 4       V! . VOVO5!   \9        VV4       Fe  w  ppRP;                  . R
O4      P=                  VP                  WVVVP                  V4      p \        P>                  PA                  VV^VR7       Kg  	  EKU  	  R # u upi u upi u upi u upi   + '       g   i     L; i  \B         d    T'       d   \E        R	T
TT4        K  h i ; i)NrW   FT)recordalwayszinvalid value encountered
)decimalerr_msgz!Output mismatch for invalid input)zufunc '{0}' failedzinputs ({1}):z{2}zgot({3})z{4}zexpected ({5}):z{6})#reset_module_warningsr,   r4   listro   rE   tupleninrJ   anyrK   kindr   noutry   ndarrayzerosshapenamewarningscatch_warningssimplefilter
issubclasscategoryRuntimeWarningrF   message
startswithrI   r(   r+   testingassert_array_almost_equalAssertionErrorprint)rp   r/   skip_inputsadditional_inputsr   r   kindspositive_onlyrw   ro   input_tupleinput_operandr   is_tupler   r   input_typesoutput_typesargtyscfuncout_tyresultsexpectedinvalid_flagwarnlistwarnmsgthiswarn
expected_iresult_imsgs   &&&&&&&&                      r   basic_ufunc_testBasicUFuncTest.basic_ufunc_test   s}    K$ """8,))%0dkk"%66!K'NM$QJ!-7H$%'%))3(Q!!4!4 Q""%/55->@K &-%))3K'>EJJ6L </FMM&&1E$q'2::.. #/ #/ HHT!W]]#)<<#4#46".   #/". HHT!W]]&,,2C2CD".   #/". HHQfll&7&78".   #/". HHQfll&7&78".  
 !L((55%%h/((x(5 (H"8#4#4nEE #H$4$4 5 @ @ I I'+	 !) 6 "4"'"(+Hg(>$
Hii !# $ %+F5>>+5+6+5+;+;Z%I	 JJ88"H ! # 9 % )?{ "8

 656 & #A)8ZA sK   2AN*>AN/5N45N9AN>)'N>N><#O>OO7$O75O7c                   V P                  V4       \        P                  R8  d   R# \        P                  ! R4      \        P
                  ! ^ 4      3\        P                  ! R4      \        P
                  ! ^4      3\        P                  ! ^ 4      \        P
                  ! ^ 4      3\        P                  ! ^ 4      \        P
                  ! ^4      3\        P                  ! ^4      \        P
                  ! ^ 4      3\        P                  ! ^4      \        P
                  ! ^4      3\        P
                  ! ^ 4      \        P                  ! R4      3\        P
                  ! ^ 4      \        P                  ! ^ 4      3\        P
                  ! ^ 4      \        P                  ! ^4      3\        P
                  ! ^4      \        P                  ! R4      3\        P
                  ! ^4      \        P                  ! ^ 4      3\        P
                  ! ^4      \        P                  ! ^4      3\        P                  ! . RO\        P                  R7      \        P                  ! . RO\        P
                  R7      3\        P                  ! . RO\        P
                  R7      \        P                  ! . RO\        P                  R7      33pV P                  V4      pV EF  w  rE\        V4      \        V4      3p\        P                  ! \        P                  ^R4      pWg3,           pV P                  W84      p	\        V\        P                  4      '       d2   \        P                  ! VP                   \        P                  R7      p
M&\        P                  ! ^\        P                  R7      p
\        P"                  ! V
4      pV! WEV4       V	! WEV
4       \        P$                  P'                  W4       EK  	  R# )r`   NrW   rX   )r`      r^   )r^   r^   r   r   r`   r`   )r   r`   r   r`   r   r`   )r   r   numpy_versionrJ   rf   re   ri   r4   r   r   rj   bool_ry   rE   r   r   r   
zeros_liker   assert_equal)rp   comparison_ufuncr   rw   abr   r   r   r   resultr   s   &&          r   signed_unsigned_cmp_test'BasicUFuncTest.signed_unsigned_cmp_test  st   ./&&0 XXb\299Q<(XXb\299Q<(XXa["))A,'XXa["))A,'XXa["))A,'XXa["))A,'YYq\288B<(YYq\288A;'YYq\288A;'YYq\288B<(YYq\288A;'YYq\288A;'XX*"((;XX(		:< XX(		:XX*"((;=%
, ))*:;%DA!!9fQi0K++ekk1c:K >1FMM&1E!RZZ((!'':!2884}}V,H1"!JJ##H5 &r$   r@   )NNNNifcF)	r,   r   r   r   r4   r   r   r   r   r   s   @r   r   r      s     *aF06 06r$   r   c                   z  a  ] tR tRt o R`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]P.                  3R ltR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,R* t-R+ t.R, t/R- t0R. t1R/ t2R0 t3R1 t4R2 t5R3 t6R4 t7R5 t8R6 t9R7 t:R8 t;R9 t<R: t=R; t>R< t?R= t@R> tAR? tBR@ tCRA tDRB tERC tFRD tGRE tHRF tIRG tJRH tKRI tLRJ tMRK tNRL tORM tPRN tQRO tRRP tSRQ tTRR tU]VRS 4       tW]VRT 4       tXRU tYRV tZRW t[RX t\RY t]RZ t^R[ t_R\ t`R] taR^ tbR_tcV tdR# )a
TestUFuncsi:  Nc                    \         P                  \         P                  \         P                  ! \         P                  ^R4      \         P                  ! \         P                  ^R4      .pV P	                  WR7       R# r`   rX   )r   N)r   rg   rh   rj   r   )rp   r   r   s   && r   basic_int_ufunc_testTestUFuncs.basic_int_ufunc_test;  sR    MMMMKKq#.KKq#.	
 	d<r$   c                D    V P                  \        P                  4       R # r   )r   rJ   addrp   s   &r   test_add_ufuncTestUFuncs.test_add_ufuncG  s    bff%r$   c                D    V P                  \        P                  4       R # r   )r   rJ   subtractr   s   &r   test_subtract_ufuncTestUFuncs.test_subtract_ufuncJ      bkk*r$   c                D    V P                  \        P                  4       R # r   )r   rJ   multiplyr   s   &r   test_multiply_ufuncTestUFuncs.test_multiply_ufuncM  r   r$   c                l    R p\         P                  pV P                  \        P                  VR7       R # )Nr   )r   rh   r   rJ   dividerp   int_out_types   & r   test_divide_ufuncTestUFuncs.test_divide_ufuncP  s.     }}bii.: 	 	<r$   c                H    V P                  \        P                  R R7       R# fr   N)r   rJ   	logaddexpr   s   &r   test_logaddexp_ufuncTestUFuncs.test_logaddexp_ufuncY      bll#6r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   
logaddexp2r   s   &r   test_logaddexp2_ufunc TestUFuncs.test_logaddexp2_ufunc\  s    bmm37r$   c                d    V P                  \        P                  \        P                  R 7       R# )r   N)r   rJ   true_divider   rh   r   s   &r   test_true_divide_ufunc!TestUFuncs.test_true_divide_ufunc_  s"    bnn.3mm 	 	=r$   c                D    V P                  \        P                  4       R # r   )r   rJ   floor_divider   s   &r   test_floor_divide_ufunc"TestUFuncs.test_floor_divide_ufuncc  s    boo.r$   c                    \         P                  ! \         P                  ^R4      \         P                  .pV P                  \        P
                  \         P                  VR7       R# )r`   rX   )r   r   N)r   rj   rc   r   rJ   negativerf   )rp   r   s   & r   test_negative_ufuncTestUFuncs.test_negative_ufuncf  sE     {{5<<C8%,,Gbkk5;;*5 	 	7r$   c                D    V P                  \        P                  4       R # r   )r   rJ   positiver   s   &r   test_positive_ufuncTestUFuncs.test_positive_ufuncm  r   r$   c                H    V P                  \        P                  R R7       R# )T)r   N)r   rJ   powerr   s   &r   test_power_ufuncTestUFuncs.test_power_ufuncp  s    bhhd;r$   c                H    V P                  \        P                  R R7       R# )fcr   N)r   rJ   float_powerr   s   &r   test_float_power_ufunc!TestUFuncs.test_float_power_ufuncs  s    bnnD9r$   c                H    V P                  \        P                  R R7       R# iur   N)r   rJ   gcdr   s   &r   test_gcd_ufuncTestUFuncs.test_gcd_ufuncv      bffD1r$   c                H    V P                  \        P                  R R7       R# r  )r   rJ   lcmr   s   &r   test_lcm_ufuncTestUFuncs.test_lcm_ufuncy  r  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   	remainderr   s   &r   test_remainder_ufuncTestUFuncs.test_remainder_ufunc|      bll+r$   c                   \         P                  ! \         P                  ! \         P                  4      P                  4      \         P                  ! ^4      3\        P                  3.pV P                  \         P                  RVR7       R# )   ifcur   r   N)rJ   re   iinfomaxr   r   mod)rp   r   s   & r   test_mod_ufuncTestUFuncs.test_mod_ufunc  s`    ii+//0"))B-@%,,O
 	bffF0A 	 	Cr$   c                D    V P                  \        P                  4       R # r   )r   rJ   fmodr   s   &r   test_fmod_ufuncTestUFuncs.test_fmod_ufunc      bgg&r$   c                   \         P                  ! \         P                  ! \         P                  4      P                  4      \        P                  3\         P
                  ! \         P                  ! \         P
                  4      P                  4      \        P
                  3\         P                  ! \         P                  ! \         P                  4      P                  4      \        P                  3\         P                  ! \         P                  ! \         P                  4      P                  4      \        P                  3.pV P                  VVR 7       R# )r   N)rJ   rc   r*  r+  r   re   rg   finfominrh   r   )rp   r/   r   s   && r   test_abs_ufuncTestUFuncs.test_abs_ufunc  s    YYrxx		*../>YYrxx		*../>ZZ,0015==AZZ,0015==A	
 	e0A 	 	Cr$   c                F    V P                  \        P                  R 7       R# ))r/   N)r8  rJ   absoluter   s   &r   test_absolute_ufuncTestUFuncs.test_absolute_ufunc  s    "++.r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   fabsr   s   &r   test_fabs_ufuncTestUFuncs.test_fabs_ufunc      bggS1r$   c                H    V P                  \        P                  R R7       R# cfr   N)r   rJ   rintr   s   &r   test_rint_ufuncTestUFuncs.test_rint_ufunc      bggT2r$   c                D    V P                  \        P                  4       R # r   )r   rJ   signr   s   &r   test_sign_ufuncTestUFuncs.test_sign_ufunc  r3  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   conjr   s   &r   test_conj_ufuncTestUFuncs.test_conj_ufunc  r3  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   expr   s   &r   test_exp_ufuncTestUFuncs.test_exp_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   exp2r   s   &r   test_exp2_ufuncTestUFuncs.test_exp2_ufunc  rI  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   logr   s   &r   test_log_ufuncTestUFuncs.test_log_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   log2r   s   &r   test_log2_ufuncTestUFuncs.test_log2_ufunc  rI  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   log10r   s   &r   test_log10_ufuncTestUFuncs.test_log10_ufunc      bhhd3r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   expm1r   s   &r   test_expm1_ufuncTestUFuncs.test_expm1_ufunc  rf  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   log1pr   s   &r   test_log1p_ufuncTestUFuncs.test_log1p_ufunc  rf  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   sqrtr   s   &r   test_sqrt_ufuncTestUFuncs.test_sqrt_ufunc  rI  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   squarer   s   &r   test_square_ufuncTestUFuncs.test_square_ufunc  s    bii(r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   cbrtr   s   &r   test_cbrt_ufuncTestUFuncs.test_cbrt_ufunc  rB  r$   c                   \         P                  ! \         P                  ^R4      \         P                  \         P                  ! \         P                  ^R4      \         P                  \         P                  ! \         P                  ^R4      \         P                  \         P                  ! \         P
                  ^R4      \         P
                  .pV P                  \        P                  VR7       R# r   )	r   rj   rc   rd   re   rf   r   rJ   
reciprocalrp   to_skips   & r   test_reciprocal_ufunc TestUFuncs.test_reciprocal_ufunc  s     ;;u||Q4ell;;u{{As3U[[;;u||Q4ell;;u{{As3U[[B 	bmmAr$   c                D    V P                  \        P                  4       R # r   )r   rJ   	conjugater   s   &r   test_conjugate_ufuncTestUFuncs.test_conjugate_ufunc  r%  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   sinr   s   &r   test_sin_ufuncTestUFuncs.test_sin_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   cosr   s   &r   test_cos_ufuncTestUFuncs.test_cos_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   tanr   s   &r   test_tan_ufuncTestUFuncs.test_tan_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   arcsinr   s   &r   test_arcsin_ufuncTestUFuncs.test_arcsin_ufunc      biit4r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   arccosr   s   &r   test_arccos_ufuncTestUFuncs.test_arccos_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   arctanr   s   &r   test_arctan_ufuncTestUFuncs.test_arctan_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   arctan2r   s   &r   test_arctan2_ufuncTestUFuncs.test_arctan2_ufunc      bjj5r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   hypotr   s   &r   test_hypot_ufuncTestUFuncs.test_hypot_ufunc      bhhc2r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   sinhr   s   &r   test_sinh_ufuncTestUFuncs.test_sinh_ufunc  rI  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   coshr   s   &r   test_cosh_ufuncTestUFuncs.test_cosh_ufunc  rI  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   tanhr   s   &r   test_tanh_ufuncTestUFuncs.test_tanh_ufunc  rI  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   arcsinhr   s   &r   test_arcsinh_ufuncTestUFuncs.test_arcsinh_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# rD  )r   rJ   arccoshr   s   &r   test_arccosh_ufuncTestUFuncs.test_arccosh_ufunc  r  r$   c                   \         P                  ! \         P                  ^R4      \         P                  \         P                  ! \         P                  ^R4      \         P                  \         P                  ! \         P                  ^R4      \         P                  \         P                  ! \         P
                  ^R4      \         P
                  .pV P                  \        P                  VRR7       R# )r`   rX   rE  )r   r   N)	r   rj   rc   rd   re   rf   r   rJ   arctanhr}  s   & r   test_arctanh_ufuncTestUFuncs.test_arctanh_ufunc  s     ;;u||Q4ell;;u{{As3U[[;;u||Q4ell;;u{{As3U[[B
 	bjjgTJr$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   deg2radr   s   &r   test_deg2rad_ufuncTestUFuncs.test_deg2rad_ufunc      bjj4r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   rad2degr   s   &r   test_rad2deg_ufuncTestUFuncs.test_rad2deg_ufunc
  r  r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   degreesr   s   &r   test_degrees_ufuncTestUFuncs.test_degrees_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   radiansr   s   &r   test_radians_ufuncTestUFuncs.test_radians_ufunc  r  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   bitwise_andr   s   &r   test_bitwise_and_ufunc!TestUFuncs.test_bitwise_and_ufunc      !!"..1r$   c                D    V P                  \        P                  4       R # r   )r   rJ   
bitwise_orr   s   &r   test_bitwise_or_ufunc TestUFuncs.test_bitwise_or_ufunc  s    !!"--0r$   c                D    V P                  \        P                  4       R # r   )r   rJ   bitwise_xorr   s   &r   test_bitwise_xor_ufunc!TestUFuncs.test_bitwise_xor_ufunc  r  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   invertr   s   &r   test_invert_ufuncTestUFuncs.test_invert_ufunc  s    !!")),r$   c                D    V P                  \        P                  4       R # r   )r   rJ   bitwise_notr   s   &r   test_bitwise_not_ufunc!TestUFuncs.test_bitwise_not_ufunc"  r  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   greaterr   s   &r   test_greater_ufuncTestUFuncs.test_greater_ufunc1  s    %%bjj1r$   c                D    V P                  \        P                  4       R # r   )r   rJ   greater_equalr   s   &r   test_greater_equal_ufunc#TestUFuncs.test_greater_equal_ufunc4  s    %%b&6&67r$   c                D    V P                  \        P                  4       R # r   )r   rJ   lessr   s   &r   test_less_ufuncTestUFuncs.test_less_ufunc7  s    %%bgg.r$   c                D    V P                  \        P                  4       R # r   )r   rJ   
less_equalr   s   &r   test_less_equal_ufunc TestUFuncs.test_less_equal_ufunc:  s    %%bmm4r$   c                D    V P                  \        P                  4       R # r   )r   rJ   	not_equalr   s   &r   test_not_equal_ufuncTestUFuncs.test_not_equal_ufunc=  s    %%bll3r$   c                D    V P                  \        P                  4       R # r   )r   rJ   equalr   s   &r   test_equal_ufuncTestUFuncs.test_equal_ufunc@  s    %%bhh/r$   c                D    V P                  \        P                  4       R # r   )r   rJ   logical_andr   s   &r   test_logical_and_ufunc!TestUFuncs.test_logical_and_ufuncC      bnn-r$   c                D    V P                  \        P                  4       R # r   )r   rJ   
logical_orr   s   &r   test_logical_or_ufunc TestUFuncs.test_logical_or_ufuncF  s    bmm,r$   c                D    V P                  \        P                  4       R # r   )r   rJ   logical_xorr   s   &r   test_logical_xor_ufunc!TestUFuncs.test_logical_xor_ufuncI  r  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   logical_notr   s   &r   test_logical_not_ufunc!TestUFuncs.test_logical_not_ufuncL  r  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   maximumr   s   &r   test_maximum_ufuncTestUFuncs.test_maximum_ufuncO      bjj)r$   c                D    V P                  \        P                  4       R # r   )r   rJ   minimumr   s   &r   test_minimum_ufuncTestUFuncs.test_minimum_ufuncR  r  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   fmaxr   s   &r   test_fmax_ufuncTestUFuncs.test_fmax_ufuncU  r3  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   fminr   s   &r   test_fmin_ufuncTestUFuncs.test_fmin_ufuncX  r3  r$   c                    \         P                  ! R R.\         P                  R7      \        P                  ! \        P                  ^R4      3.# )TFrW   rX   )rJ   ri   r   r   rj   r   s   &r   bool_additional_inputs!TestUFuncs.bool_additional_inputs^  s;    XXtUm2884[[a-/
 	
r$   c                f    V P                  \        P                  R V P                  4       R7       R# ifcbr)  N)r   rJ   isfiniter!  r   s   &r   test_isfinite_ufuncTestUFuncs.test_isfinite_ufuncd  s*    KKv"99; 	 	
r$   c                f    V P                  \        P                  R V P                  4       R7       R# r$  )r   rJ   isinfr!  r   s   &r   test_isinf_ufuncTestUFuncs.test_isinf_ufuncj  *    HHF"99; 	 	
r$   c                f    V P                  \        P                  R V P                  4       R7       R# r$  )r   rJ   isnanr!  r   s   &r   test_isnan_ufuncTestUFuncs.test_isnan_ufuncp  r-  r$   c                D    V P                  \        P                  4       R # r   )r   rJ   signbitr   s   &r   test_signbit_ufuncTestUFuncs.test_signbit_ufuncv  r  r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   copysignr   s   &r   test_copysign_ufuncTestUFuncs.test_copysign_ufuncy  s    bkk5r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   	nextafterr   s   &r   test_nextafter_ufuncTestUFuncs.test_nextafter_ufunc|  r   r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   modfr   s   &r   test_modf_ufuncTestUFuncs.test_modf_ufunc  s    bggS1r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   frexpr   s   &r   test_frexp_ufuncTestUFuncs.test_frexp_ufunc  s    bhhc2r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   floorr   s   &r   test_floor_ufuncTestUFuncs.test_floor_ufunc  r  r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   ceilr   s   &r   test_ceil_ufuncTestUFuncs.test_ceil_ufunc  rB  r$   c                H    V P                  \        P                  R R7       R# r   )r   rJ   truncr   s   &r   test_trunc_ufuncTestUFuncs.test_trunc_ufunc  r  r$   c                "   \         P                  ! \         P                  \         P                  ) .\         P                  R 7      \        P
                  ! \        P                  ^R4      3.pV P                  \         P                  RVR7       R# )rW   rX   r   r)  N)rJ   ri   infrh   r   rj   r   spacing)rp   
additionals   & r   test_spacing_ufuncTestUFuncs.test_spacing_ufunc  sc     xx"&& 1D{{5==!S9; =
bjj0: 	 	<r$   c                l
   VP                   p\        V4      p^\        P                  3R\        P                  3R\        P
                  3\        P                  ! ^ ^.RR7      \        P                  ! \        P                  ^R4      3\        P                  ! R^.RR7      \        P                  ! \        P                  ^R4      3\        P                  ! RR.RR7      \        P                  ! \        P
                  ^R4      3.pTp\        P                  ! \        P                  ^R4      \        P                  ! \        P
                  ^R4      .pTp\        P                  ! W4V4       EF  pVw  rp
V^ ,          pV^,          pV	^ ,          pV	^,          pVR8X  dY   V\        P                  ! \        P                  ^R4      8X  g,   V\        P                  ! \        P                  ^R4      8X  d   K  VR8X  dp   V\        P                  ! \        P                  ^R4      8X  dE   V\        P                  8X  d0   \        P                  ! \        P                  ^R4      '       d   EK  VR8X  dp   V\        P                  ! \        P                  ^R4      8X  dE   V\        P                  8X  d0   \        P                  ! \        P                  ^R4      '       d   EKx  \        V\        P                  4      '       g!   \        V\        P                  4      '       d$   \        V
\        P                  4      '       g   EK  WV
3pV P                  Wo4      p\        V\        P                  4      '       dn   \        P                  ! VP                   V
P"                  P$                  R7      p\        P                  ! VP                   V
P"                  P$                  R7      pM\        V\        P                  4      '       dn   \        P                  ! VP                   V
P"                  P$                  R7      p\        P                  ! VP                   V
P"                  P$                  R7      pMX\        P                  ! ^V
P"                  P$                  R7      p\        P                  ! ^V
P"                  P$                  R7      pV! WV4       V! WV4       \'        V
R	V
4      pV\        P(                  \        P*                  39   d   R
MRpV P-                  VVVR7       EK  	  R# )r`   rT   rY   rW   rX   r[   r]   r   r   rK   singledouble)precNr^   r_   )r,   r4   r   re   rf   rh   rJ   ri   rj   	itertoolsproductrc   rE   ry   r   r   sizerK   r   getattrrg   	complex64assertPreciseEqual)rp   r/   
ufunc_nameinputs1inputs2r   rw   valsinput1input2r   input1_operandinput1_typeinput2_operandinput2_typer   r   r   r   scalar_typer[  s   &&                   r   binary_ufunc_mixed_types_test(TestUFuncs.binary_ufunc_mixed_types_test  s   ^^
#E*%-- XXq!fD)5;;u||Q+LMXXr1gT*EKKQ,LMXXtSk.[[3/12 EKKC8EMM1c:< %%gED*.'FK#AYN )K#AYN )K X%5;;u||Q#DD5;;u||Q#DD j(#u{{5<<C'HH#u||3EKKC88j(#u{{5<<C'HH#u||3EKKC88K55{EKK88";<<k:DMM&/E."**55."5"5(3(9(9(>(>@88N$7$7*5*;*;*@*@BNBJJ77."5"5(3(9(9(>(>@88N$7$7*5*;*;*@*@B !;+<+<+A+AB88A[->->-C-CD.&9>8<!+wDK"u}}eoo&FF !  ##Hf4#@q Fr$   c                
   \        \        P                  4      p\        P                  ! ^RR7      \        P                  ! ^RR7      P	                  ^^4      \        P                  ! ^RR7      P	                  ^^4      \        P                  ! ^RR7      P	                  ^^4      \        P                  ! ^RR7      P	                  ^^4      \        P                  ! ^	RR7      P	                  ^^4      .p\        P
                  ! ^	RR7      P	                  ^^4      \        P
                  ! ^	RR7      P	                  ^^4      \        P
                  ! ^	RR7      P	                  ^^4      \        P
                  ! ^RR7      P	                  ^^^4      \        P
                  ! ^RR7      P	                  ^^^4      \        P
                  ! ^RR7      P	                  ^^^4      .p\        W#4       F  w  rE\        P                  ! \        P                  VP                  R4      p\        P                  ! \        P                  VP                  R4      pWg3pV P                  W4      p	\        P
                  ! VP                  VP                  R7      p
\        P                  ! WJ4       V	! WE4       V P                  WZ4       K  	  \        \        P                   4      p\        P                  ! ^RR7      \        P                  ! ^	RR7      P	                  ^^4      \        P                  ! ^RR7      P	                  ^^^4      \        P                  ! ^RR7      P	                  ^^4      \        P                  ! ^RR7      P	                  ^^4      \        P                  ! ^RR7      P	                  ^^^4      \        P                  ! ^	RR7      P	                  ^^^4      \        P                  ! ^	RR7      P	                  ^^^4      \        P                  ! ^	RR7      P	                  ^^^4      .	pTp\"        P$                  ! W4       EF  w  rM\        P                  ! \        P                  VP                  R4      p\        P                  ! \        P                  VP                  R4      p\        P                  ! \        P                  \'        VP                  VP                  4      R4      pWV3pV P                  W4      p	\        P                   ! WM4      p
\        P
                  ! V
P                  RR7      pV	! WMV4       V P                  WZ4       EK  	  R# )   rY   rW   r[   rX   N)r4   rJ   r  arangereshaper   rI   r   rj   re   r|   rf   ry   r   rK   ra  r   r\  r]  r+  )rp   rw   input_operandsoutput_operandsrA   r   r   r   r   r   r   input1_operandsinput2_operandsrB   ri  rk  s   &               r   test_broadcastingTestUFuncs.test_broadcasting  s    %R[[1 IIat$IIat$,,Qq1IIat$,,Qq1IIat$,,Qq1IIat$,,Qq1IIe4(00157 HHU$'//!4HHU$'//!4HHU$'//!4HHYd+33Aa:HHYd+33Aa:HHYd+33Aa:< ^=IAU\\1663?J++ekk6;;DK,DMM&/ExxFLLAHKK$!##F5 >  %RVV, IIat$IIe4(0015IIit,44Qq;IIat$,,Qq1IIat$,,Qq1IIat$,,Qq3IIe4(001Q7IIe4(001Q7IIe4(001Q7	9 *%%oGDA++ellAFFC@K++ellAFFC@K++ellC4GMKk:DMM&/Evva|HXXhnnD9F!##F5 Hr$   c                    \         P                  ! \         P                  ^R4      pW3p\        W34      R 4       pV P	                  VP
                  V,          P                  P                  V4       R# )r`   rX   c                 .    \         P                  ! W4      # r   rJ   r   a0a1s   &&r   myadd2TestUFuncs.test_implicit_output_npm.<locals>.myadd6  s    66">!r$   N)r   rj   re   r   assertEqual	overloads	signaturereturn_type)rp   arr_tysigr  s   &   r   test_implicit_output_npm#TestUFuncs.test_implicit_output_npm0  sc     U\\1c2	v		" 
 	" 	-77CCVLr$   c                `   R  p\         P                  ! ^RR7      \         P                  ! ^	RR7      P                  ^^4      \         P                  ! ^RR7      P                  ^^^4      \         P                  ! ^RR7      P                  ^^4      \         P                  ! ^RR7      P                  ^^4      \         P                  ! ^RR7      P                  ^^^4      \         P                  ! ^	RR7      P                  ^^^4      \         P                  ! ^	RR7      P                  ^^^4      \         P                  ! ^	RR7      P                  ^^^4      .	pTp\        P                  ! W#4       F  w  rE\
        P                  ! \
        P                  VP                  R4      p\
        P                  ! \
        P                  VP                  R4      pWg3pV P                  WRR7      p	\         P                  ! WE4      p
V	! WE4      p\         P                  P                  W4       K  	  R# )c                 .    \         P                  ! W4      # r   r{  r|  s   &&r   rw   ATestUFuncs.test_broadcast_implicit_output_npm_nrt.<locals>.pyfunc=      66">!r$   rY   rW   rX   Trx   N)rJ   rq  rr  r\  r]  r   rj   re   r|   ry   r   r   assert_array_equal)rp   rw   ru  rv  rA   rB   ri  rk  r   r   r   r   s   &           r   &test_broadcast_implicit_output_npm_nrt1TestUFuncs.test_broadcast_implicit_output_npm_nrt<  s   	" IIat$IIe4(0015IIit,44Qq;IIat$,,Qq1IIat$,,Qq1IIat$,,Qq3IIe4(001Q7IIe4(001Q7IIe4(001Q7	9 *%%oGDA++ellAFFC@K++ellAFFC@K-DMM&DM9Evva|H1[FJJ))(; Hr$   c                   R  p\         P                  ! ^ ^^4      P                  ^^4      p\         P                  ! VRR7      pVP                  ^^4      P                  ^ ,          p\        V4      pVP                  P                  '       d   VP                  R8X  g   Q h\        V4      pVP                  P                  '       d   VP                  R8X  g   Q h\        V4      pVP                  R8X  g   Q hVP                  P                  '       d   Q hVP                  P                  '       d   Q h\        \        P                  ! W#V.^4      4      pWV3.,          pWV3.,          pWV3.,          pV F  w  r\        V	4      \        V
4      3pV P                  WRR7      pV! W4      pV! W4      pV P                  VP                  P                  VP                  P                  4       V P                  VP                  P                  VP                  P                  4       \         P                  P!                  W4       K  	  R# )c                 .    \         P                  ! W4      # r   r{  r|  s   &&r   rw   =TestUFuncs.test_implicit_output_layout_binary.<locals>.pyfuncZ  r  r$   ForderrX   ATr  N)rJ   linspacerr  ri   Tr   flagsc_contiguouslayoutf_contiguousr   r\  permutationsry   r  r   r  )rp   rw   XYZXtyYtyZty	testcasesarg0arg1r   r   r   r   s   &              r   "test_implicit_output_layout_binary-TestUFuncs.test_implicit_output_layout_binaryY  s   	" KK1b!))!Q/HHQc"IIaOa Qiww###

c(999Qiww###

c(999QizzS   77'''''77'''''//q	1=>	!fX	!fX	!fX	#JD4L&,/DMM&DM9Ed)H4&FX^^88#\\668X^^88#\\668JJ))(; $r$   c                   R  p\         P                  ! ^ ^^4      P                  ^^4      p\         P                  ! VRR7      pVP                  ^^4      P                  ^ ,          p\        V4      pVP                  P                  '       d   VP                  R8X  g   Q h\        V4      pVP                  P                  '       d   VP                  R8X  g   Q h\        V4      pVP                  R8X  g   Q hVP                  P                  '       d   Q hVP                  P                  '       d   Q hW#V3 F  p\        V4      3p	V P                  WRR7      p
V! V4      pV
! V4      pV P                  VP                  P                  VP                  P                  4       V P                  VP                  P                  VP                  P                  4       \         P                  P                  W4       K  	  R# )c                 .    \         P                  ! V 4      # r   rJ   rp  )r}  s   &r   rw   <TestUFuncs.test_implicit_output_layout_unary.<locals>.pyfunc  s    772;r$   r  r  rX   r  Tr  N)rJ   r  rr  ri   r  r   r  r  r  r  ry   r  r   r  )rp   rw   r  r  r  r  r  r  r  r   r   r   r   s   &            r   !test_implicit_output_layout_unary,TestUFuncs.test_implicit_output_layout_unary~  s   	 KK1b!))!Q/HHQc"IIaOa Qiww###

c(999Qiww###

c(999QizzS   77'''''77'''''1ID4L?DMM&DM9Ed|H4[FX^^88#\\668X^^88#\\668JJ))(; r$   r@   r   )er,   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r#  r-  r1  rJ   absr8  r<  r@  rG  rL  rP  rT  rX  r\  r`  rd  ri  rm  rq  ru  ry  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r	  r  r  r  r  r  r!  r'  r+  r0  r4  r8  r<  r#   r@  rD  rH  rL  rP  rV  rm  rw  r  r  r  r  r   r   r   s   @r   r   r   :  s    =&++<78=/7+<:22,C' $&66 C/23''23234443)2B,2225556333366K 5555212-228/540.-..**''



*67 2 2 3 3323<LA\A6F
M<:#<J< <r$   r   c                   8  a  ] tR tRt o R tR0R ltR1R ltR tR tR t	R2R	 lt
R2R
 ltR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R  t!R! t"R" t#R# t$R$ t%R% t&R& t'R' t(R( t)R) t*R* t+R+ t,R, t-R- t.R. t/R/t0V t1R# )3TestArrayOperatorsi  c                    V P                  VP                  P                  VP                  P                  4       \        P                  P                  W4       R # r   )r  rK   r   rJ   r   r   )rp   r   gots   &&&r   _check_results!TestArrayOperators._check_results  s6    ,,ciinn=


,,X;r$   Nc                X   Vf   . pVf   . p\        V4      p\        V P                  4      pVP                  V4       Tp	V Fd  p
V
w  rW9   g!   \	        V\
        P                  4      '       g   K/  V P                  W3VR7      pV	! V4      pV! V4      pV P                  W4       Kf  	  R # )Nr  )	r;   r   ro   extendrE   r   rj   ry   r  )rp   operatorrx   r   r   r   r   operator_funcro   rw   r   r   r   r   r   r  s   &&&&&&&         r   unary_op_test TestArrayOperators.unary_op_test  s     K$ "4X>dkk"'(!K(3%M*#J<<MM&-SMAEm,H&C. "r$   c                   Vf   . pVf   . p\        V4      p\        V P                  4      p	V	P                  V4       Tp
\        P
                  P                  ^4      pV	 EF"  pVw  r\        P                  ! \        VRV4      4      pTpW9   d   K3  V'       d    \        P                  ! ^VR7      ^ ,          p\        V\        P                  4      '       d/   TpTpV'       d"   \        P                  ! VX8  4      '       d   K  M>VP                  ^ ^d^
4      P!                  V4      p\#        V4      pV'       d
   VX8  d   K  VV3pV P%                  V
VVR7      pV
! VV4      pV! VV4      pV P'                  VV4       EK%  	  R # )NrK   rW   r  )r=   r   ro   r  rJ   randomRandomStater   as_dtyper_  r   rE   r   rj   r   uniformastyper   ry   r  )rp   r  rx   r   r   r   r   positive_rhsr  ro   rw   random_stater   input_operand1r   input_dtypeinput_type1zeroinput_operand0input_type0r   r   r   r  s   &&&&&&&&                r   binary_op_test!TestArrayOperators.binary_op_test  se    K$ "5h?dkk"'( yy,,Q/!K)4&N'00
GZ8:K$K(xx5a8 *ekk22!/(BFF>D+@$A$A"."6"6q#r"B!J!J"!$^4NT$9-DMM&$CM8Enn=H7C#.; "r$   c                    R \         P                  3R\         P                  3\        P                  ! R R.4      \         P                  ! \         P                  ^R4      3.# )TFrX   )r   booleanrJ   ri   rj   r   s   &r   bitwise_additional_inputs,TestArrayOperators.bitwise_additional_inputs  sL     5==!EMM"XXtUm$ekk%--C&HI
 	
r$   c           	     ,   VP                  R . 4      pV\        P                  \        P                  \        P                  ! \        P                  ^R4      \        P                  ! \        P                  ^R4      .,          pV P
                  ! V/ VB # )r   rX   )
setdefaultr   rg   rh   rj   r  )rp   r   kwsr   s   &*, r   binary_int_op_test%TestArrayOperators.binary_int_op_test  sn    nn]B7MM5==KKq#.KKq#.
 	

 ""D0C00r$   c                v    VP                  R . 4      pW0P                  4       ,          pV P                  ! V/ VB # r5  )r  r  r  )rp   r   r  r   s   &*, r   binary_bitwise_op_test)TestArrayOperators.binary_bitwise_op_test  s<    NN+>C;;==&&444r$   c                   \        V4      pTpV'       d   V P                  p	M\        P                  P                  p	V U
u. uF  p
\        P
                  ! W*R 7      NK  	  pp
V U
u. uF  p
\        P
                  ! W:R 7      NK  	  pp
V UU
u. uF  q F
  q! V4      NK  	  K  	  ppp
W,           p\        P                  ! W4       Fm  w  pp\        V4      p\        V4      pVV3pV P                  VV4      pVP                  4       pV! VV4       VP                  4       pV! VV4       V	! VV4       Ko  	  R# u up
i u up
i u up
pi )rW   N)rG   ra  rJ   r   assert_allcloseri   r\  r]  r   ry   copy)rp   r  
lhs_values
rhs_values
lhs_dtypes
rhs_dtypespreciser  rw   	assertionrK   
lhs_inputs
rhs_arraysvrhs_scalars
rhs_inputslhsrhslhs_typerhs_typer   r   r   r  s   &&&&&&&                 r   inplace_op_test"TestArrayOperators.inplace_op_test  s2   6x@//I

22I
 $./#-% hhz7#- 	 / $./#-% hhz7#- 	 /)3LAuQxxL-
!))*AHCc{Hc{Hh'DMM&$/ExxzH8S!((*C#sOc8$ B//Ls    D:' D?Ec           	         V P                  WV\        P                  \        P                  3\        P                  \        P                  \        P                  3VR 7      # )r  )r  rJ   rg   rh   rf   )rp   r  r  r  r  s   &&&&&r   inplace_float_op_test(TestArrayOperators.inplace_float_op_test   sI     ##H*%'ZZ$<%'ZZRXX$F,3 $ 5 	5r$   c                    V P                  WV\        P                  \        P                  \        P                  3\        P                  \        P
                  34       R # r   )r  rJ   rl   rd   rf   rc   rp   r  r  r  s   &&&&r   inplace_int_op_test&TestArrayOperators.inplace_int_op_test)  s:    X: hh"((; hh		2	4r$   c                    V P                  WV4       V P                  WV\        P                  3\        P                  \        P                  34       R # r   )r  r  rJ   r   r  s   &&&&r   inplace_bitwise_op_test*TestArrayOperators.inplace_bitwise_op_test.  s=      zBX: hh[288RXX*>	@r$   c                (    V P                  R 4       R# +Nr  r   s   &r   test_unary_positive_array_op/TestArrayOperators.test_unary_positive_array_op6      3r$   c                (    V P                  R 4       R# -Nr  r   s   &r   test_unary_negative_array_op/TestArrayOperators.test_unary_negative_array_op9  r  r$   c                   V P                  R \        P                  \        P                  \        P                  ! \        P                  ^R4      \        P                  ! \        P                  ^R4      .V P                  4       R7       R# )~rX   )r   r   N)r  r   rg   rh   rj   r  r   s   &r   test_unary_invert_array_op-TestArrayOperators.test_unary_invert_array_op<  sa    3(-u}}(-EMM1c(J(-EMM1c(J(L .2-K-K-M	 	 	Or$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z+=Nr^         ?rp  r         @)r  r  iaddr   s   &r   test_inplace_add#TestArrayOperators.test_inplace_addF  *    ""4|D""8==,Mr$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z-=Nr	  r  )r  r  isubr   s   &r   test_inplace_sub#TestArrayOperators.test_inplace_subJ  r  r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z*=Nr	  r  )r  r  imulr   s   &r   test_inplace_mul#TestArrayOperators.test_inplace_mulN  r  r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z//=Nr	  r  g      ?r  )r  r  	ifloordivr   s   &r   test_inplace_floordiv(TestArrayOperators.test_inplace_floordivR  s/    ""5,H""8#5#5|#2	4r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z/=Nr	  r  r  )r  r  itruedivr   s   &r   test_inplace_div#TestArrayOperators.test_inplace_divW  s/    ""4|D""8#4#4l#2	4r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z%=Nr	  r     r  )r  r  imodr   s   &r   test_inplace_remainder)TestArrayOperators.test_inplace_remainder\  r  r$   c                    V P                  R . RO. RORR7       V P                  \        P                  . RO. RORR7       R# )z**=Fr  Nr	  r$  )r  r  ipowr   s   &r   test_inplace_pow#TestArrayOperators.test_inplace_pow`  s>    ""5,+0 	# 	2""8==,+0 	# 	2r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z&=Nr   r`   r%  rp  3   r      r'  *      )r  r  iandr   s   &r   test_inplace_and#TestArrayOperators.test_inplace_andf  2    $$T+;%9	;$$X]]4D%9	;r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z|=Nr.  r0  )r  r  iorr   s   &r   test_inplace_or"TestArrayOperators.test_inplace_orl  s2    $$T+;%9	;$$X\\3C%9	;r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z^=Nr.  r0  )r  r  ixorr   s   &r   test_inplace_xor#TestArrayOperators.test_inplace_xorr  r7  r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z<<=Nr      iir   r`         )r  r  ilshiftr   s   &r   test_inplace_lshift&TestArrayOperators.test_inplace_lshiftx  1      (8-H  !1!13C!.	0r$   c                ~    V P                  R . RO. RO4       V P                  \        P                  . RO. RO4       R# )z>>=NrA  rC  )r  r  irshiftr   s   &r   test_inplace_rshift&TestArrayOperators.test_inplace_rshift}  rI  r$   c                   R p\         P                  ! ^
4      pV! V4      pT P                  V^ ,          V^ ,          8g  ;'       d    V^,          V^,          8g  4       \         P                  ! ^
4      p\        V4      ! V4      pT P                  V^ ,          V^ ,          8g  ;'       d    V^,          V^,          8g  4       \         P                  P                  W$4       \         P                  P                  W54       R# )z
Verify that the unary positive operator copies values, and doesn't
just alias to the input array (mirrors normal Numpy/Python
interaction behavior).
c                      V 5p^V ^ &   ^V^&   V# )rp  r@   )r~  a2s   & r   r   <TestArrayOperators.test_unary_positive_array_op_2.<locals>.f  s     BBqEBqEIr$   N)rJ   r   
assertTruer   r   r  )rp   r   r~  rP  a3a4s   &     r   test_unary_positive_array_op_21TestArrayOperators.test_unary_positive_array_op_2  s    	 XXb\rU1A992a5BqE>:XXb\!WR[1A992a5BqE>:


%%b-


%%b-r$   c                (    V P                  R 4       R# r  r  r   s   &r   test_add_array_op$TestArrayOperators.test_add_array_op      C r$   c                (    V P                  R 4       R# r   rX  r   s   &r   test_subtract_array_op)TestArrayOperators.test_subtract_array_op  r[  r$   c                (    V P                  R 4       R# )*NrX  r   s   &r   test_multiply_array_op)TestArrayOperators.test_multiply_array_op  r[  r$   c                P    R p\         P                  pV P                  RVR7       R # )N/r   )r   rh   r  r   s   & r   test_divide_array_op'TestArrayOperators.test_divide_array_op  s#    }}C>r$   c                   \         P                  ! ^4      \        P                  3\         P                  ! R4      \        P                  3\         P                  ! ^ 4      \        P                  3\         P                  ! ^4      \        P                  3\         P
                  ! R4      \        P
                  3\         P
                  ! ^ 4      \        P
                  3\         P                  ! R4      \        P                  3\         P                  ! R4      \        P                  3\         P                  ! R4      \        P                  3\         P                  ! R4      \        P                  3\         P                  ! ^^.RR7      \        P                  ! \        P                  ^R4      3\         P                  ! ^^.RR7      \        P                  ! \        P                  ^R4      3\         P                  ! . RORR7      \        P                  ! \        P                  ^R4      3\         P                  ! . RORR7      \        P                  ! \        P
                  ^R4      3\         P                  ! RR.R	R7      \        P                  ! \        P                  ^R4      3\         P                  ! RR.R
R7      \        P                  ! \        P                  ^R4      3.V n
        V P                  R4       R# )r`   r
  g      @rV   rW   rX   rY   rZ   r[   r\   r]   z//Nr  r_   g      )r^   r`   rB  )r^   r`      )rJ   rc   r   rd   re   rf   rg   rh   ri   rj   ro   r  r   s   &r   test_floor_divide_array_op-TestArrayOperators.test_floor_divide_array_op  s    YYq\5<<(XXb\5;;'XXa[%++&YYq\5<<(XXb\5;;'XXa[%++&ZZu}}-ZZ_emm,ZZu}}-ZZ_emm,XXqe4(%++ellAs*KLXXqe4(%++ellAs*KLXXhd+U[[a-MNXXhd+U[[a-MNXXtSk.[[3/1XXtSk.[[3/1)
. 	D!r$   c                (    V P                  R 4       R# )%NrX  r   s   &r   test_remainder_array_op*TestArrayOperators.test_remainder_array_op  r[  r$   c                ,    V P                  R RR7       R# )z**Tr  NrX  r   s   &r   test_power_array_op&TestArrayOperators.test_power_array_op  s    Dt4r$   c                ,    V P                  R RR7       R# )z<<Trq  Nr  r   s   &r   test_left_shift_array_op+TestArrayOperators.test_left_shift_array_op      48r$   c                ,    V P                  R RR7       R# )z>>Trq  Nru  r   s   &r   test_right_shift_array_op,TestArrayOperators.test_right_shift_array_op  rx  r$   c                (    V P                  R 4       R# )&Nr  r   s   &r   test_bitwise_and_array_op,TestArrayOperators.test_bitwise_and_array_op      ##C(r$   c                (    V P                  R 4       R# )|Nr~  r   s   &r   test_bitwise_or_array_op+TestArrayOperators.test_bitwise_or_array_op  r  r$   c                (    V P                  R 4       R# )^Nr~  r   s   &r   test_bitwise_xor_array_op,TestArrayOperators.test_bitwise_xor_array_op  r  r$   c                (    V P                  R 4       R# )z==NrX  r   s   &r   test_equal_array_op&TestArrayOperators.test_equal_array_op      D!r$   c                (    V P                  R 4       R# )>NrX  r   s   &r   test_greater_array_op(TestArrayOperators.test_greater_array_op  r[  r$   c                (    V P                  R 4       R# )z>=NrX  r   s   &r   test_greater_equal_array_op.TestArrayOperators.test_greater_equal_array_op  r  r$   c                (    V P                  R 4       R# )<NrX  r   s   &r   test_less_array_op%TestArrayOperators.test_less_array_op  r[  r$   c                (    V P                  R 4       R# )z<=NrX  r   s   &r   test_less_equal_array_op+TestArrayOperators.test_less_equal_array_op  r  r$   c                (    V P                  R 4       R# )z!=NrX  r   s   &r   test_not_equal_array_op*TestArrayOperators.test_not_equal_array_op  r  r$   r   )TNNNN)TNNNNF)T)2r,   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r'  r+  r5  r:  r>  rG  rL  rU  rY  r]  ra  re  rj  rn  rr  rv  rz  r  r  r  r  r  r  r  r  r  r   r   r   s   @r   r  r    s     </.,/\
15
%>54
@  ONNN4
4
N2;;;0
0
.2!!!?
"8!599)))"!"!"" "r$   r  c                   <   a  ] tR tRt o RtR tR tR tR tRt	V t
R# )	TestScalarUFuncsi  a	  check the machinery of ufuncs works when the result is an scalar.
These are not exhaustive because:
- the machinery to support this case is the same for all the functions of a
  given arity.
- the result of the inner function itself is already tested in TestUFuncs
c                   \        W#4       EFC  w  rE\        V4      ! V4      pV! V!  pV! \        WE4      !  pR P                  WT4      p	\	        \
        P                  \
        P                  3\
        P                  \
        P                  3\
        P                  \
        P                  3\
        P                  \
        P                  3.4      p
WJ9   d   \        V4      pM\        P                  ! VP                  \        P                  4      '       d   \        V4      pM\        P                  ! VP                  \        P                  4      '       d   \        V4      pM@\        P                  ! VP                  \        P                   4      '       d   \#        V4      pWFP$                  V,          P&                  P(                  3,           p\+        V Uu. uF  q\
        P,                  8H  NK  	  up4      '       d   RpM6\+        V Uu. uF  q\
        P.                  8H  NK  	  up4      '       d   RpMRpV P1                  WxWR7       EKF  	  R# u upi u upi )zfor args {0} typed {1}rY  rZ  exact)r   r[  N)rI   r   rP   r+   setr   rd   re   rf   floatrJ   
issubdtyperK   inexactintegerintr   boolr  r  r  r   rg   rh   ra  )rp   rw   	arg_types
arg_valuesrM   r   r   r  r   r   specialalltypestr[  s   &&&&          r   	run_ufuncTestScalarUFuncs.run_ufunc  s   	6LFL(E,Cv<=H*11$?C ell+u{{+ell+u{{+	 G   ? ==<<$XH]]8>>2::>>"8}H]]8>>288<<#H~H!8!B!B!N!N PPH 91&9::(;(Q5==((;<<##Cs#Fa 7R :;s   I
I
c                    R  p. ROp\         P                  3\         P                  3\         P                  3\         P                  3\         P
                  3\         P                  3.pV P                  WV4       R# )c                 .    \         P                  ! V 4      # r   r  rA   s   &r   _func7TestScalarUFuncs.test_scalar_unary_ufunc.<locals>._func)  s    771:r$   N)r%  r  r`   r  )皙?)皙?)r   rd   rc   rf   re   rg   rh   r  rp   r  re  tyss   &   r   test_scalar_unary_ufunc(TestScalarUFuncs.test_scalar_unary_ufunc(  sZ    	 6~~%--!13 	u4(r$   c                   R  p. ROp\         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  .pV P                  V\        W34      \        W"4      4       R# )c                 .    \         P                  ! W4      # r   r{  rA   rB   s   &&r   r  @TestScalarUFuncs.test_scalar_binary_uniform_ufunc.<locals>._func3      66!;r$   Nr%  r%  r`   r%  r  r  )	r   rd   rc   rf   re   rg   rh   r  rI   r  s   &   r    test_scalar_binary_uniform_ufunc1TestScalarUFuncs.test_scalar_binary_uniform_ufunc2  sT    	 ${{ELL{{ELL%--Huc#mS_=r$   c                B   R  p. ROp\         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  .pV P                  V\        P                  ! W34      \        P                  ! W"4      4       R# )c                 .    \         P                  ! W4      # r   r{  r  s   &&r   r  >TestScalarUFuncs.test_scalar_binary_mixed_ufunc.<locals>._func<  r  r$   Nr  )
r   rd   rc   rf   re   rg   rh   r  r\  r]  r  s   &   r   test_scalar_binary_mixed_ufunc/TestScalarUFuncs.test_scalar_binary_mixed_ufunc;  sg    	 ${{ELL{{ELL}}emm- 	ui//9 ((4	6r$   r@   N)r,   r   r   r   __doc__r  r  r  r  r   r   r   s   @r   r  r    s%     1Gf)>	6 	6r$   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestUfuncIssuesiG  c                    \        R .4      R 4       p\        P                  ! ^
RR7      p\        P                  ! ^
RR7      pV P                  V! W#4      W#,           W#,           ,           4       R# )z(float64,float64)c                 d    \         P                  ! W4      \         P                  ! W4      ,           # r   r{  )x1x2s   &&r   foo+TestUfuncIssues.test_issue_651.<locals>.fooK  s    66">BFF2N22r$   r]   rW   N)r   rJ   rq  ra  )rp   r  r   r   s   &   r   test_issue_651TestUfuncIssues.test_issue_651I  s\    	'(	)	3 
*	3 IIb%IIb%A	AEae+<=r$   c                8  a aa R pVo\        S4      oVVV 3R lp\        P                  ! . RO4      \        P                  ! . RO4      .pV FH  pV! V^4       V! V\        P                  ! ^4      4       V! V\        P
                  ! . RO4      4       KJ  	  R# )z6
<float32 ** int> should return float32, not float64.
c                 .    \         P                  ! W4      # r   )rJ   r  r  s   &&r   r  ,TestUfuncIssues.test_issue_2006.<locals>.fooW  s    88A>!r$   c                    < S! W4      p\         P                  P                  VS! W4      4       SP                  VP                  V P                  4       R # r   )rJ   r   r   r  rK   )rA   rB   r  r   rw   rp   s   && r   check.TestUfuncIssues.test_issue_2006.<locals>.check\  s>    +CJJ00fQlC SYY0r$   N)r`   r%  rp  )              ?r%  y      @      )r%  r%  rp  )r   rJ   rg   r`  re   rf   )rp   r  r  xsrA   r   rw   s   f    @@r   test_issue_2006TestUfuncIssues.test_issue_2006S  sq    	"V	1 jj#R\\/%BCA!QK!RYYq\"!RXXi() r$   r@   N)r,   r   r   r   r  r  r   r   r   s   @r   r  r  G  s     >* *r$   r  c                      a  ] tR tRt o RtRtR^R^R^R^R^R^R^/tRR ltR tR t	R t
]R 4       t]R	 4       t]R
 4       tRtV tR# )_LoopTypesTesterik  aj  Test code generation for the different loop types defined by ufunc.

This test relies on class variables to configure the test. Subclasses
of this class can just override some of these variables to check other
ufuncs in a different compilation context. The variables supported are:

_funcs: the ufuncs to test
_skip_types: letter types that force skipping the loop when testing
             if present in the NumPy ufunc signature.
_supported_types: only test loops where all the types in the loop
                  signature are in this collection. If unset, all.

Note that both, _skip_types and _supported_types must be met for a loop
to be tested.

The NumPy ufunc signature has a form like 'ff->f' (for a binary ufunc
loop taking 2 floats and resulting in a float). In a NumPy ufunc object
you can get a list of supported signatures by accessing the attribute
'types'.
OegGc                   VR9   d   \         P                  ! . ROVR7      # VR9   d   \         P                  ! . ROVR7      # VR9   d   \         P                  ! . ROVR7      # V^ ,          R8X  d-   \        V4      ^8X  d   Rp\         P                  ! . ROVR7      # V^ ,          R8X  d-   \        V4      ^8X  d   Rp\         P                  ! . ROVR7      # VR	9   d&   \         P                  ! R
RR\        R4      .VR7      # VR9   dG   \        P
                  R8w  d   RpMRp\         P                  ! VRR\        R4      ,          R.VR7      # \        RV: R24      h)z<return a suitable array argument for testing the letter typebhilqrW   BHILQ?mzm8[D]MzM8[D]fdr
  rU   nanFDr   r  y                ztype z not understood)r`   rD  r   rh  )r`   r%  rD  r   )TFFT)r%  NaTr   )Natr`   r   r   g      y             y              y      ?      ?)rJ   ri   lenr  r   platformRuntimeError)rp   a_letter_typeindexnegzeros   &&& r   _arg_for_type_LoopTypesTester._arg_for_type  s5    G#88M??G#88L>>c!886mLL1$=!Q& '88-]CC1$=!Q& '88-]CCd"88S$U5\:"/1 1d"||w& ($88Wj"uU|2CRH"/1 1 =JKKr$   c                p  aaa VR VP                    W2P                  ) R  ,           o\        V R. 4      oS'       dC   \        ;QJ d    V3R lS 4       F  '       g   K   RM	  RM! V3R lS 4       4      '       d   R # \        V R. 4      o\        ;QJ d    V3R lS 4       F  '       g   K   RM	  RM! V3R lS 4       4      '       d   R # \        V R. 4      pV'       dC   \        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       g   R # V P	                  WS4       R # )	N_supported_typesc              3   ,   <"   T F	  qS9  x  K  	  R # 5ir   r@   ).0lsupported_typess   & r   	<genexpr>/_LoopTypesTester._check_loop.<locals>.<genexpr>  s     Cl_,l   TF_skip_typesc              3   ,   <"   T F	  qS9   x  K  	  R # 5ir   r@   )r  r  
skip_typess   & r   r  r    s     51Jr  _required_typesc              3   .   <"   T F
  pVS9   x  K  	  R # 5ir   r@   )r  r  letter_typess   & r   r  r    s      &?/=! '(<&7/=s   )r   r   r_  r   _check_ufunc_with_dtypes)rp   r'   r/   looprequired_typesr  r  r  s   &&&& @@@r   _check_loop_LoopTypesTester._check_loop  s    JUYY'$

{|*<<
 "$(:B?ClCClCCCT="5
3553335555 !'8"=## &?/=&?### &?/=&? #? #?%%b>r$   c           
        . pV F$  pVR9   d
   VR,           pVP                  V4       K&  	  V Uu. uF  p\        P                  ! V4      NK  	  pp\        V Uu. uF$  p\        P
                  ! \        V4      ^R4      NK&  	  up4      p\        V4      ! V4      p\        V4       U	Uu. uF&  w  rV P                  WYR7      P                  ^4      NK(  	  p
p	pV
 F  pV P                  P                  V4       K   	  V
 Uu. uF  qP                  4       NK  	  ppV! V
!   V! V!   \        WmV
4       F  w  rpV P                  WV4      w  ppVP                  P                   pV P"                  P%                  VP&                  V3^4      pVR9   d   RMRpVR9   d   RMTpR	P)                  . RO4      pVP+                  VP&                  V
VVV4      pV P-                  VVVVVR
7       K  	  R# u upi u upi u upp	i u upi )r  z8[D]rX   r  fFrY  r  dDrZ  r   )r[  r   ulpsN)r  r  )z ufunc '{0}' arrays differ ({1}):z	args: {2}zexpected {3}zgot {4})appendrJ   rK   r   r   rj   r   r   	enumerater  repeatr  shuffler  rI   _fixup_resultschar_ulpsgetr,   r(   r+   ra  )rp   r'   r/   dtypesdtypes_with_unitsr  arg_dtyarg_nbtyr   r  c_argsarrr   py_argsrK   py_argc_argtypecharr  r[  r   s   &&&&                 r   r  )_LoopTypesTester._check_ufunc_with_dtypes  s    AJJ$$Q' 
 )::(91288A;(9:gNg%++jmQ<gNOXr" #,F"35"3he $$Q$4;;A>"3 	 5CKK$ %+,V668V,v
G %(&$A E5 //uEMFE{{''H::>>5>>8"<a@D'4/8WD'4/8TD)) E FC**U^^VT65IC##FE#)- $ / %B! ;N5 -s   G1*G6+,G;Hc                    W#3# r   r@   )rp   rK   r  r   s   &&&&r   r  _LoopTypesTester._fixup_results  s
    }r$   c                N    VP                    F  pV P                  W4       K  	  R # r   )r   _inject_test)clsr/   r  s   && r   _check_ufunc_loops#_LoopTypesTester._check_ufunc_loops  s    KKDU)  r$   c           
        aa VV3R  lp\        V RP                  SP                  SP                  RR4      4      V4       R# )c                 D   < \        S4      pV P                  VSS4       R # r   )r4   r	  )rp   r'   r  r/   s   & r   test_template4_LoopTypesTester._inject_test.<locals>.test_template  s    $U+BR-r$   ztest_{0}_{1}z->_N)setattrr+   r,   replace)r'  r/   r  r,  s   &ff r   r&  _LoopTypesTester._inject_test  s9    	. 	^**5>>+/<<c+BD	r$   c                N    V P                    F  pV P                  V4       K  	  R # r   )_ufuncsr(  )r'  r/   s   & r   autogenerate_LoopTypesTester.autogenerate  s    [[E""5) !r$   r@   N)r  r  )r  D)r  r  )rc  r6  )r  r  )rx  d)r   r7  r   )r,   r   r   r   r  r   r  r  r	  r  r  classmethodr(  r&  r4  r   r   r   s   @r   r  r  k  s     ( K aaaQAA !E%LN?.&/P * *   * *r$   r  c                      ] tR tRt]R,          t]P                  ]P                  4       ]P                  ]P                  4       ]P                  ]P                  4       ]P                  ]P                  4       ]P                  ]P                  4       ]P                  ]P                  4       RtR]P                   ,           tRtR# )TestLoopTypesInti	  NNNz?bBhHiIlLqQfdFDmMOr@   N)r,   r   r   r   r   r3  removerJ   r  r|  
left_shiftright_shiftr   r  r  r  r   r   r@   r$   r   r;  r;  	  s    q!GNN288NN2==!NN2==!NN2>>"NN2;;NN2;;#O.:::Kr$   r;  c                   ~    ] tR tRt]P
                  ]P                  .tRtR]	P                  ,           R,           t
RtR# ) TestLoopTypesSubtractAndNegativei  z?bBhHiIlLqQfdFDmMOr  r@   N)r,   r   r   r   rJ   r   r  r3  r  r  r   r   r@   r$   r   rB  rB    s/    {{BKK(G'O*666<Kr$   rB  c                   z   a a ] tR tRt o]P
                  .tRtR]P                  ,           t	RV 3R llt
RtVtV ;t# )TestLoopTypesReciprocali#  bBhHiIlLqQfdFDrC  c                Z   < \         V P                  V `  VVR 7      pVR9   d   ^*W3^ 8H  &   V# r  
bBhHiIlLqQra   rq   r  rp   r  r  resrq   s   &&& r   r  %TestLoopTypesReciprocal._arg_for_type(  s=    DNND7>C 8 EL( CqM
r$   r@   r8  )r,   r   r   r   rJ   r|  r3  r  r  r   r  r   r   r   r   s   @@r   rE  rE  #  s0     }}oG&O*666K r$   rE  c                   z   a a ] tR tRt o]P
                  .tRtR]P                  ,           t	RV 3R llt
RtVtV ;t# )TestLoopTypesPoweri6  rF  rC  c                h   < \         V P                  V `  VVR 7      pVR9   d   V^8X  d   ^W3^ 8  &   V# rH  rJ  rK  s   &&& r   r   TestLoopTypesPower._arg_for_type;  sC    DNND7>C 8 EL(UaZ CaL
r$   r@   r8  )r,   r   r   r   rJ   r  r3  r  r  r   r  r   r   r   r   s   @@r   rO  rO  6  s0     xxjG&O*666K r$   rO  c                   z   a a ] tR tRt o]P
                  .tRtR]P                  ,           t	RV 3R llt
RtVtV ;t# )TestLoopTypesIntLeftShiftiI  rI  r=  c                   < \         V P                  V `  VVR 7      pV^8X  d=   VP                  P                  ^,          p\
        P                  ! V^ V^,
          4      pV# r  )ra   rq   r  rK   itemsizerJ   cliprp   r  r  rL  	bit_countrq   s   &&&  r   r  'TestLoopTypesIntLeftShift._arg_for_typeN  s[    DNND7>C 8 E A:		**Q.I''#q)a-0C
r$   r@   r8  )r,   r   r   r   rJ   r?  r3  r  r  r   r  r   r   r   r   s   @@r   rS  rS  I  s0     }}oG"O.:::K r$   rS  c                   z   a a ] tR tRt o]P
                  .tRtR]P                  ,           t	RV 3R llt
RtVtV ;t# )TestLoopTypesIntRightShifti`  rI  r=  c                   < \         V P                  V `  VVR 7      pV^8X  d=   VP                  P                  ^,          p\
        P                  ! V^ V^,
          4      pV^ 8X  d   \
        P                  ! V4      pV# rU  )ra   rq   r  rK   rV  rJ   rW  r  rX  s   &&&  r   r  (TestLoopTypesIntRightShift._arg_for_typee  sq    DNND7>C 8 E A:		**Q.I''#q)a-0C A:&&+C
r$   r@   r8  )r,   r   r   r   rJ   r@  r3  r  r  r   r  r   r   r   r   s   @@r   r\  r\  `  s1     ~~G"O.:::K r$   r\  c                      a  ] tR tRt o ]P
                  ]P                  ]P                  .tRt	R]
P                  ,           tR tRtV tR# )TestLoopTypesFloorDividei  rF  rC  c                    VP                   R 8X  dQ   \        P                  ! V4      \        P                  ! V4      ,          pWBR8H  VR8H  ,          ,          pW$,          W4&   W#3# )r   rU   )r   rJ   r*  r/  )rp   rK   r  r   preds   &&&& r   r  'TestLoopTypesFloorDivide._fixup_results  sQ    :: HHUObhhv&66Ds]u|44D ,EK}r$   r@   N)r,   r   r   r   rJ   r  r"  divmodr3  r  r  r   r  r   r   r   s   @r   r`  r`    s=     bii8G&O*666K r$   r`  c                   p   ] tR tRt]R,          t]'       d   ]P                  ]P                  4       ]P                  ]P                  4       ]P                  ]P                  4       ]P                  ]P                  4       ]P                  ]P                  4       RtR]P                   ,           tRtR# )TestLoopTypesFloati  r<  r  FDmMOr@   N)r,   r   r   r   r   r3  	iswindowsr>  rJ   r3  r  r"  rd  r,  r  r  r   r   r@   r$   r   rf  rf    su    q!Grzz"NN2??#NN2<< NN299NN266O,888Kr$   rf  c                   R    ] tR tRt]R,          tRtR]P                  ,           tRt	R# )TestLoopTypesComplexi  r<  r  rC  r@   N)
r,   r   r   r   r   r3  r  r  r   r   r@   r$   r   rj  rj    s$    q!G O*666Kr$   rj  c                      a  ] tR tRt o ]R,          t]P                  ]P                  4       Rt	R t
R tR tR tR tR	 tR
 tRtV tR# )TestLoopTypesDatetimei  r<  mMc                x   \         P                  p\        V4      pV P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       V P	                  \
        4      ;_uu_ 4        V P                  W!. RO4       RRR4       R#   + '       g   i     R# ; i)m8[s]N)ro  m8[m]ro  )rp  ro  ro  )ro  rp  m8[ms])rp  ro  rq  )rp  ro  rp  )rJ   r   r4   r  assertRaisesr	   rp   r/   r'   s   &  r   test_addTestLoopTypesDatetime.test_add  s     '%%b1LM%%b1LM%%b1MN%%b1MN}--))"*EG .---   	B((B9	c                x   \         P                  p\        V4      pV P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       V P	                  \
        4      ;_uu_ 4        V P                  W!. RO4       RRR4       R#   + '       g   i     R# ; i)M8[s]N)rx  M8[m]ro  )ry  rx  ro  )rx  ry  rq  )ry  rx  rq  )ry  rx  rp  )rJ   r   r4   r  rr  r	   rs  s   &  r   test_subtract#TestLoopTypesDatetime.test_subtract  s     '%%b1LM%%b1LM%%b1MN%%b1MN}--))"*EG .---rv  c                (   \         P                  p\        V4      pV P                  W!. RO4       V P                  W!. RO4       V P	                  \
        4      ;_uu_ 4        V P                  W!. RO4       RRR4       R#   + '       g   i     R# ; i)ro  N)ro  qm8[us])r}  ro  r~  ro  r}  rp  )rJ   r   r4   r  rr  r	   rs  s   &  r   test_multiply#TestLoopTypesDatetime.test_multiply  sh     '%%b1IJ%%b1IJ}--))"5LM .---   !B  B	c                x   \         P                  p\        V4      pV P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       V P	                  \
        4      ;_uu_ 4        V P                  W!. RO4       RRR4       R#   + '       g   i     R# ; i)rp  N)rp  ro  r7  )ro  rp  r7  rp  r}  ro  rp  r7  ro  r  )rJ   r   r4   r  rr  r	   rs  s   &  r   test_true_divide&TestLoopTypesDatetime.test_true_divide  s     '%%b1HI%%b1HI%%b1HI%%b1HI}--))"5LM .---rv  c                (   \         P                  p\        V4      pV P                  W!. RO4       V P                  W!. RO4       V P	                  \
        4      ;_uu_ 4        V P                  W!. RO4       RRR4       R#   + '       g   i     R# ; i)rp  Nr  r  r  )rJ   r  r4   r  rr  r	   rs  s   &  r   test_floor_divide'TestLoopTypesDatetime.test_floor_divide  sh     '%%b1HI%%b1HI}--))"5LM .---r  c                    \        V4      pV P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       V P                  W!. RO4       R# )rp  N)rp  ro  r  )ro  rp  r  )ry  rx  r  )rx  ry  r  )r4   r  rs  s   && r   _check_comparison'TestLoopTypesDatetime._check_comparison  sP     '%%b1HI%%b1HI%%b1HI%%b1HIr$   c                    \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  3 F  pV P                  V4       K  	  R # r   )rJ   r  r  r  r  r  r  r  r   s   & r   test_comparisons&TestLoopTypesDatetime.test_comparisons  sD    hhbggr}}jj""2"24E""5)4r$   r@   N)r,   r   r   r   r   r3  r>  rJ   rd  r  rt  rz  r  r  r  r  r  r   r   r   s   @r   rl  rl    sT     q!GNN299 O
GGNNNJ* *r$   rl  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestUFuncBadArgsi  c                    R  pV P                  \        4      ;_uu_ 4        \        \        P                  ! \        P                  4      .4      ! V4       RRR4       R#   + '       g   i     R# ; i)c                2    \         P                  ! V 4      pV# )zerror: np.add requires two argsr{  )rA   r   s   & r   r   0TestUFuncBadArgs.test_missing_args.<locals>.func  s    VVAYFMr$   Nrr  r
   r   r   rh   rp   r   s   & r   test_missing_args"TestUFuncBadArgs.test_missing_args  sF    	
 {++%--./06 ,+++   5A  A1	c                    R  p\         P                  ! \         P                  ^R4      pV! W"V4      pV P                  \        4      ;_uu_ 4        \        V4      ! V4       RRR4       R#   + '       g   i     R# ; i)c                4    \         P                  ! W W4      pV# )zerror: too many argsr{  )rA   outout2r   s   &&& r   r   1TestUFuncBadArgs.test_too_many_args.<locals>.func  s    VVA#,FMr$   rX   N)r   rj   rh   rr  r
   r   )rp   r   
array_typer  s   &   r   test_too_many_args#TestUFuncBadArgs.test_too_many_args  sV    	
 [[37
<{++IdO ,+++s   A,,A=	c                    R  pV P                  \        4      ;_uu_ 4        \        \        P                  ! \        P                  4      .4      ! V4       RRR4       R#   + '       g   i     R# ; i)c                8    ^ p\         P                  ! W V4       R# )z0error: scalar as a return value is not supportedNr{  r  s   & r   r   ATestUFuncBadArgs.test_no_scalar_result_by_reference.<locals>.func(  s    AFF1Or$   Nr  r  s   & r   "test_no_scalar_result_by_reference3TestUFuncBadArgs.test_no_scalar_result_by_reference'  sF    	
 {++%--./06 ,+++r  r@   N)	r,   r   r   r   r  r  r  r   r   r   s   @r   r  r    s     7
7 7r$   r  c                   &   a  ] tR tRt o R tRtV tR# ) TestUFuncCompilationThreadSafetyi1  c                "  aa . o\         R 4       oVV3R lp\        ^4       Uu. uF  p\        P                  ! VR7      NK  	  ppV F  pVP	                  4        K  	  V F  pVP                  4        K  	  V P                  S4       R# u upi )zc
Test that (lazy) compiling from several threads at once doesn't
produce errors (see issue #2403).
c                     V ^,           # r  r@   r  s   &r   r  7TestUFuncCompilationThreadSafety.test_lock.<locals>.foo:  s    q5Lr$   c                  P  <  \         P                  ! R\         P                  R7      p \         P                  ! R\         P                  R7      R,           p\         P                  P	                  S! V 4      V4       R#   \
         d   pSP                  T4        Rp?R# Rp?ii ; i)
   rW   g      ?N)r  )rJ   onesrh   r   r  	Exceptionr  )r   r   eerrorsr  s      r   r   ;TestUFuncCompilationThreadSafety.test_lock.<locals>.wrapper>  sl    !GGE4775

;b@

--c!fh? !a  !s   A9A> >B%	B  B%)targetN)r   r)   	threadingThreadstartr(   assertFalse)rp   r   r1   threadsr  r  r  s   &    @@r   	test_lock*TestUFuncCompilationThreadSafety.test_lock3  s    
 		 
		! >C2YGY9##73YGAGGI AFFH   Hs    Br@   N)r,   r   r   r   r  r   r   r   s   @r   r  r  1  s     ! !r$   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestUfuncOnContextiN  c                   \         P                  pVP                  \        P                  4      pV P                  V\        4       \        P                  ! \        P                  4      pV P                  W#4       \        4       pV P                  \        4      ;_uu_ 4       p\        P                  ! V4       R R R 4       V P                  XP                  P                  V34       R #   + '       g   i     L9; ir   )r   target_contextget_ufunc_inforJ   r   assertIsInstancedictr   r  objectrr  KeyError	exceptionr   )rp   	targetctxadd_infor   badkeyraisess   &     r   test_cpu_get_ufunc_info*TestUfuncOnContext.test_cpu_get_ufunc_infoO  s     --	++BFF3h-**2662,x((F##F+ )))..	: )(s   "C**C:	c                4   \        \        P                  R 4      pV P                  \        4      ;_uu_ 4       pVP                  \        P                  4       RRR4       V P                  \        XP                  4      R4       R#   + '       g   i     L7; i)cpuNz<<numba\..*\.BaseContext object at .*> does not support ufunc)r   r   typing_contextrr  NotImplementedErrorr  rJ   r   assertRegexrF   r  )rp   r  r  s   &  r   test_base_get_ufunc_info+TestUfuncOnContext.test_base_get_ufunc_info_  sg    
 9 95A	233v$$RVV, 4  !K	
 43s    BB	r@   N)r,   r   r   r   r  r  r   r   r   s   @r   r  r  N  s     ; 
 
r$   r  c                   &   a  ] tR tRt o R tRtV tR# )TestUfuncWriteInputij  c                t   \        R .R4      R 4       p\        P                  P                  ^
^4      p\        P                  ! V\        P
                  R7      pV! W#4       \        P                  P                  \        P                  ! . RO\        P                  R7      VP                  ^ R7      4       R# )zvoid(float64[:], uint8[:])z(n)->(n)c                 f    \        V P                  4       F  pV^,          ^ 8X  g   K  ^W&   K  	  R# )rD  N)r)   r^  )rA   r  r1   s   && r   r   6TestUfuncWriteInput.test_write_input_arg.<locals>.funcl  s(     166]q5A:CF #r$   rW   )axisN)TFFFT)r   rJ   r  randr   rk   r   r  ri   r   r   )rp   r   rA   r  s   &   r   test_write_input_arg(TestUfuncWriteInput.test_write_input_argk  s    	23Z	@	 
A	 IINN2q!mmARWW-Q


%%HH6bhhGGGGO	r$   r@   N)r,   r   r   r   r  r   r   r   s   @r   r  r  j  s      r$   r  __main__)Er!   r\  r   r   r  r  numpyrJ   r   numbar   r   r   r   
numba.corer   numba.np.numpy_supportr   numba.core.errorsr	   r
   numba.tests.supportr   r   numba.core.typing.npydeclr   numba.npr   numba.core.registryr   numba.core.baser   r   r   __itemsize__is32bitsr  r   rh  r#   r4   r;   r=   rG   rP   rR   r   r   r  r  r  r  r;  r4  rB  rE  rO  rS  r\  r`  rf  rj  rl  r  r  r  r  r,   mainr@   r$   r   <module>r     sF     
      6 6  - 8 9 6 " * ' "LL##G,		*"JFO FRW6] W6tb	< b	<JK" K"\
W6x W6t!*h !*H[*x [*|;' ;    ='7 = ! - - /.    $ $ &)      ! 0 (  & & (!1 >  ' ' )/    % % '	9) 	9    !7+ 7  ! ! #[*, [*|  " " $7x 7@!x !:
 
8( & zMMO r$   