+
    ;iA                        ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt  ! R	 R
]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R4      t ! R R4      t ! R R]4      t ! R R]P$                  4      t ! R R]4      t]R8X  d   ]P@                  ! 4        R# R# )    N)assert_array_equal)GUFuncBuilder)	vectorizeguvectorize)PyUFunc_One)DUFunc)tagTestCase)configc                   >   a  ] tR t^t o R tR tR tR tR tRt	V t
R# )TestUfuncBuildingc                  a a ^ RI Hp \        V4      pVP                  R4      pS P                  VP                  4       VP                  R4      pS P                  VP                  4       VP                  4       oV V3R lp\        P                  ! ^RR7      pV! V4       VR,          pV! V4       VP                  R4      pV! V4       S P                  SP                  R4       S P                  R	SP                  4       R
# )r   addint32(int32, int32)zint64(int64, int64)c                    < S! W 4      pSP                  W ,           V4       SP                  VP                  V P                  4       R # NassertPreciseEqualassertEqualdtypeabselfufuncs   & e/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/npyufunc/test_ufuncbuilding.pycheck1TestUfuncBuilding.test_basic_ufunc.<locals>.check   6    aA##AE1-QWWagg.    int32r   NN   r   zAn additionNr%      )+numba.tests.npyufunc.ufuncbuilding_usecasesr   UFuncBuilderassertFalse
objectmodebuild_ufuncnparangereshaper   __name__assertIn__doc__r   r   ufbcresr   r   r   s   f     @r   test_basic_ufunc"TestUfuncBuilding.test_basic_ufunc   s    C3ww,-)ww,-)!	/
 IIb(acFaIIfa 	/mU]]3r!   c                T  a a ^ RI Hp \        V4      pVP                  R4      pS P                  VP                  4       VP                  4       oV V3R lp\        P                  ! ^RR7      R,           pV! V4       VR,          pV! V4       VP                  R	4      pV! V4       R# )
r   r   zcomplex64(complex64, complex64)c                    < S! W 4      pSP                  W ,           V4       SP                  VP                  V P                  4       R # r   r   r   s   & r   r   2TestUfuncBuilding.test_ufunc_struct.<locals>.check2   r    r!   	complex64r#                 ?r$   Nr&   )	r(   r   r)   r*   r+   r,   r-   r.   r/   r3   s   f     @r   test_ufunc_struct#TestUfuncBuilding.test_ufunc_struct+   s    C3ww89)!	/
 IIb,r1acFaIIfar!   c                   ^ RI Hp \        VRR/R7      pVP                  R4      pV P                  VP                  4       VP                  4       p\        P                  ! ^
RR7      pV! WU4      pV P                  WU,           V4       R# )	r   r   forceobjTtargetoptionsr   r"   r#   N)	r(   r   r)   
assertTruer+   r,   r-   r.   r   )r   r   r4   r5   r   r   r   s   &      r   test_ufunc_forceobj%TestUfuncBuilding.test_ufunc_forceobj?   sl    C3z4.@Aww,-(!IIb(!Kq)r!   c                    ^ RI Hp \        VRR/R7      pVP                  R4       VP	                  4       pV P                  V! R^4      ^4       R# )z1
Check nested call to an implicitly-typed ufunc.
)outernopythonTrA   (int64, int64)N)r(   rG   r)   r   r,   r   )r   rG   builderr   s   &   r   test_nested_call"TestUfuncBuilding.test_nested_callJ   sN     	Fu.8$-?A$%##%r1q)r!   c                    ^ RI Hp \        VRR/R7      pVP                  R4       VP	                  4       pV P                  V! R^4      ^4       R# )z1
Check nested call to an explicitly-typed ufunc.
)outer_explicitrH   TrA   rI   NrJ   )r(   rO   r)   r   r,   r   )r   rO   rK   r   s   &   r   test_nested_call_explicit+TestUfuncBuilding.test_nested_call_explicitU   sN     	O~.8$-?A$%##%r1q)r!    N)r0   
__module____qualname____firstlineno__r6   r=   rD   rL   rP   __static_attributes____classdictcell____classdict__s   @r   r   r      s#     44(	*	*	* 	*r!   r   c                   ,   a  ] tR t^at o R tR tRtV tR# )TestUfuncBuildingJitDisabledc                F    \         P                  V n        R \         n        R# FNr   DISABLE_JITold_disable_jitr   s   &r   setUp"TestUfuncBuildingJitDisabled.setUpc       %11"r!   c                0    V P                   \        n        R # r   r`   r   r_   ra   s   &r   tearDown%TestUfuncBuildingJitDisabled.tearDowng       !11r!   r`   Nr0   rS   rT   rU   rb   rg   rV   rW   rX   s   @r   r[   r[   a        #2 2r!   r[   c                   2   a  ] tR t^kt o R tR tR tRtV tR# )TestGUfuncBuildingc                   ^ RI Hp \        VR4      pVP                  R4      pV P	                  VP
                  4       VP                  4       p\        P                  ! ^
RR7      P                  ^^4      pV! WU4      pV P                  WU,           V4       V P                  VP                  \        P                  ! R4      4       V P                  VP                  R4       V P                  RVP                  4       R# )	r   guadd(x, y),(x, y)->(x, y)z(void(int32[:,:], int32[:,:], int32[:,:])r"   r#   rq   zA generalized additionN)r(   rq   r   r   r*   r+   r,   r-   r.   r/   r   r   r   r0   r1   r2   r   rq   gufbr5   r   r   r   s   &      r   test_basic_gufunc$TestGUfuncBuilding.test_basic_gufuncm   s    EU$;<xxBC)  "IIb(00A6!Kq)"((7"34 	1.>r!   c                @   ^ RI Hp \        VR4      pVP                  R4      pV P	                  VP
                  4       VP                  4       p\        P                  ! ^
RR7      P                  ^^4      R,           pV! WU4      pV P                  WU,           V4       R# )r   rp   rr   4void(complex64[:,:], complex64[:,:], complex64[:,:])r;   r#   r<   N)r(   rq   r   r   r*   r+   r,   r-   r.   r/   r   rs   s   &      r   test_gufunc_struct%TestGUfuncBuilding.test_gufunc_struct~   s~    EU$;<xxNO)  "IIb,44Q:R?!Kq)r!   c                X   ^ RI Hp \        VR\        RR7      R7      pVP	                  R4      pV P                  VP                  4       VP                  4       p\        P                  ! ^
RR7      P                  ^^4      R	,           pV! WU4      pV P                  WU,           V4       R
# )r   rp   rr   Tr@   rA   rx   r;   r#   r<   N)r(   rq   r   dictr   rC   r+   r,   r-   r.   r/   r   rs   s   &      r   test_gufunc_struct_forceobj.TestGUfuncBuilding.test_gufunc_struct_forceobj   s    EU$;+/+>@xx  (  "IIb,44Q:R?!Kq)r!   rR   N)	r0   rS   rT   rU   ru   ry   r~   rV   rW   rX   s   @r   rn   rn   k   s     ?"
** *r!   rn   c                   ,   a  ] tR t^t o R tR tRtV tR# )TestGUfuncBuildingJitDisabledc                F    \         P                  V n        R \         n        R# r]   r^   ra   s   &r   rb   #TestGUfuncBuildingJitDisabled.setUp   rd   r!   c                0    V P                   \        n        R # r   rf   ra   s   &r   rg   &TestGUfuncBuildingJitDisabled.tearDown   ri   r!   rj   Nrk   rX   s   @r   r   r      rl   r!   r   c                   |   a  ] tR t^t o . ROtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tRtV tR# )TestVectorizeDecorNc                    ^ RI Hp \        R.4      ! V4      p\        P                  ! ^
RR7      pV! W34      pV P                  W3,           V4       R# )r   r   r   r"   r#   Nr(   r   r   r-   r.   r   r   r   r   r   r   s   &    r   test_vectorize!TestVectorizeDecor.test_vectorize   sC    C01237IIb(!Kq)r!   c                    ^ RI Hp \        R.RR7      ! V4      p\        P                  ! ^
RR7      pV! W34      pV P                  W3,           V4       R# )r   r   r   Tr|   r"   r#   Nr   r   s   &    r   test_vectorize_objmode)TestVectorizeDecor.test_vectorize_objmode   sE    C01DA#FIIb(!Kq)r!   c                    ^ RI Hp \        R.4      ! V4      p\        P                  ! ^
RR7      pV! W34      pV P                  V\        P                  ! VP                  \        P                  R7      4       R# )r   )equalszbool_(int32, int32)r"   r#   N)	r(   r   r   r-   r.   r   onesshapebool_)r   r   r   r   rs   &    r   test_vectorize_bool_return-TestVectorizeDecor.test_vectorize_bool_return   sT    F0126:IIb(!J277177"((#CDr!   c                D   ^ RI Hp RpV P                   F>  p\        V.VR7      ! V4      pVR8X  d   RMTpV P	                  VP
                  V4       K@  	  \        V.4      ! V4      pV P                  VP
                  R4       V P                  \        4      ;_uu_ 4        \        V.RR7      ! V4       RRR4       V P                  \        4      ;_uu_ 4        \        V.^R7      ! V4       RRR4       R#   + '       g   i     LL; i  + '       g   i     R# ; i)r   r   r   )identityreorderableNnone)	r(   r   _supported_identitiesr   r   r   assertIsassertRaises
ValueError)r   r   sigr   r   expecteds   &     r   test_vectorize_identity*TestVectorizeDecor.test_vectorize_identity   s    C#22Hseh7<E'=8thHU^^X6 3
 3% %ennd+z**sef-c2 +z**sea(- +* +****s   "C;D;D	D	c                H   ^ RI Hp \        P                  ! ^ ^^
4      p\        P                  ! ^^^
4      p\	        V4      pV P                  V! W#4      W#,           4       \	        V4      p\        P                  ! ^
4      pV! W#V4       V P                  WbV,           4       R# )r   r   N)r(   r   r-   linspacer   r   empty)r   r   r   r   r   ufunc2cs   &      r   test_vectorize_no_args)TestVectorizeDecor.test_vectorize_no_args   sy    CKK!BKK!B#a
AE23HHRLqQq5)r!   c                    ^ RI Hp \        P                  ! ^ ^^
4      p\        P                  ! ^^^
4      p\	        \
        RR7      ! V4      pV P                  V! W#4      W#,          4       R# )r   )mulT)r   rH   N)r(   r   r-   r   r   r   r   )r   r   r   r   r   s   &    r   test_vectorize_only_kws*TestVectorizeDecor.test_vectorize_only_kws   sP    CKK!BKK!B;>sCa
AE2r!   c                   a  V 3R lp^ RI Hp \        R.RR7      ! V4      pV! V4       \        RR7      ! V4      pV! V4       V! V4       R# )z?
Passing the output array as a keyword argument (issue #1867).
c                 T  < \         P                  ! ^
^RR7      p\         P                  ! V4      pV ! WVR7      pSP                  W24       SP	                  W!V,           4       SP                  \        4      ;_uu_ 4        V ! WVR7       RRR4       R#   + '       g   i     R# ; i)
   r"   r#   )out)zzzN)r-   r.   
zeros_liker   r   r   	TypeError)r   r   r   gotr   s   &   r   r   =TestVectorizeDecor.test_vectorize_output_kwarg.<locals>.check   sw    		"b0A--"C#&CMM####CQ/""9--a$ .---s   BB'	r   r   TrH   N)r(   r   r   )r   r   r   r   s   f   r   test_vectorize_output_kwarg.TestVectorizeDecor.test_vectorize_output_kwarg   sG    	% 	D01DA#Fe4(-eer!   c                    ^ RI Hp \        R.R4      ! V4      p\        P                  ! ^
RR7      P                  ^^4      pV! W34      pV P                  W3,           V4       R# )r   rp   $(int32[:,:], int32[:,:], int32[:,:])(x,y),(x,y)->(x,y)r"   r#   N)r(   rq   r   r-   r.   r/   r   )r   rq   r   r   r   s   &    r   test_guvectorize#TestVectorizeDecor.test_guvectorize   sX    ECD02279IIb(00A6!Kq)r!   c                    ^ RI Hp \        R.R4      ! V4      p\        P                  ! ^
RR7      P                  ^^4      p\        P                  ! V4      pV! W3V4       V P                  W3,           V4       R# )r   rp   r   z(x,y),(x,y),(x,y)r"   r#   N)r(   rq   r   r-   r.   r/   r   r   )r   rq   r   r   r   s   &    r   test_guvectorize_no_output-TestVectorizeDecor.test_guvectorize_no_output   sg    ECD/1168IIb(00A6mmAaCs+r!   c                    ^ RI Hp \        R.RRR7      ! V4      p\        P                  ! ^
RR7      P                  ^^4      pV! W34      pV P                  W3,           V4       R# )	r   )	guadd_objr   r   Tr|   r"   r#   N)r(   r   r   r-   r.   r/   r   )r   r   r   r   r   s   &    r   test_guvectorize_objectmode.TestVectorizeDecor.test_guvectorize_objectmode  s\    ICD04AAJLIIb(00A6!Kq)r!   c                    ^ RI Hp \        R.RRR7      ! V4      p\        P                  ! ^
RR7      P                  ^^4      pV! V^4      pV P                  V^,           V4       R# )	z1
Test passing of scalars to object mode gufuncs.
)guadd_scalar_objz(int32[:,:], int32, int32[:,:])z(x,y),()->(x,y)Tr|   r"   r#   N)r(   r   r   r-   r.   r/   r   )r   r   r   r   r   s   &    r   "test_guvectorize_scalar_objectmode5TestVectorizeDecor.test_guvectorize_scalar_objectmode  sb     	Q>?->>NPIIb(00A6!QKAq)r!   c                   ^ RI HpHp \        R.RRR7      ! V4      p\        P
                  ! ^
RR7      P                  ^^4      pV P                  V4      ;_uu_ 4        V! WD4       RRR4       R#   + '       g   i     R# ; i)	r   )guerrorMyExceptionr   r   Tr|   r"   r#   N)r(   r   r   r   r-   r.   r/   r   )r   r   r   r   r   s   &    r   $test_guvectorize_error_in_objectmode7TestVectorizeDecor.test_guvectorize_error_in_objectmode  sj    	CD04AAHJIIb(00A6{++!K ,+++s   	A22B	c                6   ^ RI HpHp R.R3pV P                   F;  p\	        VRV/ ! V4      pVR8X  d   RMTpV P                  VP                  V4       K=  	  \	        V!  ! V4      pV P                  VP                  R4       V P                  \        4      ;_uu_ 4        \	        VRR/ ! V4       RRR4       V P                  \        4      ;_uu_ 4        \	        VR^/ ! V4       RRR4       R#   + '       g   i     LI; i  + '       g   i     R# ; i)r   )r   rq   r   r   r   r   Nr   )
r(   r   rq   r   r   r   r   r   r   r   )r   r   rq   argsr   r   r   s   &      r   test_guvectorize_identity,TestVectorizeDecor.test_guvectorize_identity!  s    J78:NO22H99%@E'=8thHU^^X6 3
 T"5)ennd+z**//4 +z****3/ +* +****s   !C4D4D	D	c                p   ^ RI Hp R.pV P                  \        4      ;_uu_ 4       p\	        VR4      ! V4       RRR4       V P                  R\        XP                  4      4       V P                  \        4      ;_uu_ 4       p\	        VR4      ! V4       RRR4       V P                  \        VP                  4      R4       V P                  \        4      ;_uu_ 4       p\	        VR4      ! V4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)	r   rp   r   z)-:Nzbad token in signaturez(x,y),(x,y)->(x,z,v)zundefined output symbols: v,zz(x,y),(x,y),(x,y)->)
r(   rq   r   r   r   r1   str	exception	NameErrorr   )r   rq   sigsraisess   &   r   test_guvectorize_invalid_layout2TestVectorizeDecor.test_guvectorize_invalid_layout1  s    E67z**fe$U+ +.F4D4D0EFy))V45e< *V--.8	: z**f34U; +* +* *)
 +**s#   C>D!D$>D	D!	$D5	rR   )r      Nr   )r0   rS   rT   rU   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rV   rW   rX   s   @r   r   r      sW     7**E. 	*3,*,*	*0 < <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# )	
NEP13ArrayiC  z4https://numpy.org/neps/nep-0013-ufunc-overrides.htmlc                    Wn         R # r   arrayr   r   s   &&r   __init__NEP13Array.__init__E      
r!   c                    V P                   # r   r   ra   s   &r   	__array__NEP13Array.__array__H  s    zzr!   c                6    V P                   P                  4       # r   )r   tolistra   s   &r   r   NEP13Array.tolistK  s    zz  ""r!   c           
         VR 8w  d   \         # \        T! V Uu. uF  p\        P                  ! V4      NK  	  up/ VB 4      # u upi __call__)NotImplementedr   r-   asarrayr   r   methodr   kwargsxs   &&&*, r   __array_ufunc__NEP13Array.__array_ufunc__N  s?    Z!!%!>A"**Q-!>I&IJJ!>s   Ar   N)r0   rS   rT   rU   r2   r   r   r   r   rV   rW   rX   s   @r   r   r   C  s#     >#K Kr!   r   c                   b   a  ] tR tRt o RtR tR tR t]t]t	]t
]t]t]t]t]t]t]t]tRtV tR# )FakeDaskArrayiU  zThis class defines both the NEP13 protocol and the dask collection protocol
(https://docs.dask.org/en/stable/custom-collections.html). This is a stand-in for
dask array, dask dataframe, and for any wrapper around them (e.g. xarray or pint).
c                    Wn         R # r   r   r   s   &&r   r   FakeDaskArray.__init__[  r   r!   c                   VR 8w  d   \         # \        P                  ! \        P                  ! V4      4      pV Uu. uF'  p\	        V\
        4      '       d   VP                  MTNK)  	  pp\        V! V/ VB 4      # u upi r   )r   pickleloadsdumps
isinstancer   r   r   s   &&&*, r   r   FakeDaskArray.__array_ufunc__^  sm    Z!! V\\%01HLM1:a77Q>MUD3F344 Ns   -A<c                    \        R 4      h)z#called potentially expensive method)AssertionError)r   r   r   s   &*,r   _dask_methodFakeDaskArray._dask_methodg  s    BCCr!   r   N)r0   rS   rT   rU   r2   r   r   r  r   __dask_graph____dask_keys____dask_optimize____dask_postcompute____dask_postpersist____dask_scheduler____dask_tokenize__computepersist	visualizerV   rW   rX   s   @r   r   r   U  sX     
5D I!N M$''%$GGIr!   r   c                   &   a  ] tR tRt o R tRtV tR# )TestNEP13WithoutSignatureiw  c                   \        R R7      R 4       p\        P                  ! . RO\        P                  R7      p\        P                  ! . RO\        P                  R7      p\        P                  ! . RO\        P                  R7      pV! W#V4      pV P	                  V\        P
                  4       V P                  VP                  4       . RO4       V! \        V4      W44      pV P	                  V\        4       V P                  VP                  4       . RO4       V! V\        V4      V4      pV P	                  V\        4       V P                  VP                  4       . RO4       V! W#\        V4      4      pV P	                  V\        4       V P                  VP                  4       . RO4       \        P                  ! . R	O\        P                  R7      p\        P                  ! . R
O\        P                  R7      p\        P                  ! . RO\        P                  R7      pV! W#V4      pV P	                  V\        P
                  4       V P                  VP                  4       . RO4       V! \        V4      W44      pV P	                  V\        4       V P                  VP                  4       . RO4       V! V\        V4      V4      pV P	                  V\        4       V P                  VP                  4       . RO4       V! W#\        V4      4      pV P	                  V\        4       V P                  VP                  4       . RO4       R# )Tr   c                 >    ^dV ,          ^
V,          ,           V,           # )d   rR   )hundredstensr   s   &&&r   	new_ufunc5TestNEP13WithoutSignature.test_all.<locals>.new_ufunc|  s    x<"T')D00r!   r#   N)r   r%   r'   )         )      	   )   i  iq  )g?g@gffffff
@)g@g      @gffffff@)g@g!@g#@)gfffff6d@g̼q@gfffff^y@)
r   r-   r   int64assertIsInstancendarrayr   r   r   float64)	r   r  r   r   r   all_npnep13_1nep13_2nep13_3s	   &        r   test_all"TestNEP13WithoutSignature.test_ally  sU    
D	!	1 
"	1 HHYbhh/HHYbhh/HHYbhh/1#fbjj1/:JqM10gz2)?;Az!}a0gz2)?;A*Q-0gz2)?; HH_BJJ7HH_BJJ7HH_BJJ71#fbjj1*?@JqM10gz2)+@AAz!}a0gz2)+@AA*Q-0gz2)+@Ar!   rR   N)r0   rS   rT   rU   r'  rV   rW   rX   s   @r   r  r  w  s     /B /Br!   r  c                   *   a  ] tR tRt o RtR tRtV tR# )TestDaski  zTest that numba ufuncs are compatible with dask collections and wrappers around
dask (e.g. xarray or pint) and that they can be serialized, sent over the network,
deserialized on a different host and applied remotely.
c                   \        \        P                  ! ^\        P                  R7      4      p\        P                  ! ^\        P                  R7      ^,          p\	        R.4      R 4       p\	        4       R 4       p\        R.R4      R 4       pVVV3 F[  pV P                  V4      ;_uu_ 4        V! V4      p\        V\         4      '       g   Q h\        VP                  V4       RRR4       K]  	  R#   + '       g   i     Kr  ; i)	r  r#   zf8(f8)c                     V ^,          # r%   rR   r   s   &r   double_static_vectorize9TestDask.test_dask_array.<locals>.double_static_vectorize      q5Lr!   c                     V ^,          # r-  rR   r.  s   &r   double_dynamic_vectorize:TestDask.test_dask_array.<locals>.double_dynamic_vectorize  r1  r!   zf8,f8[:]z()->()c                     V ^,          VR&   R# )r%   :NNNNrR   )r   r   s   &&r   double_guvectorize4TestDask.test_dask_array.<locals>.double_guvectorize  s    UCFr!   N)
r   r-   r.   r"  r   r   subTestr   r   r   )r   r   expectr/  r3  r6  funcr   s   &       r   test_dask_arrayTestDask.test_dask_array  s    "))ARZZ891BJJ/!3	H:		 
	 
	 
	 
j\8	,	 
-	 $$
D
 d##G!!]3333"177F3 $#

 $##s   37C88D	rR   N)r0   rS   rT   rU   r2   r;  rV   rW   rX   s   @r   r*  r*    s     
4 4r!   r*  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestVectorizeDecorJitDisabledi  c                F    \         P                  V n        R \         n        R# r]   r^   ra   s   &r   rb   #TestVectorizeDecorJitDisabled.setUp  rd   r!   c                0    V P                   \        n        R # r   rf   ra   s   &r   rg   &TestVectorizeDecorJitDisabled.tearDown  ri   r!   rj   Nrk   rX   s   @r   r>  r>    rl   r!   r>  __main__)!r   unittestnumpyr-   numpy.testingr   numba.np.ufunc.ufuncbuilderr   numbar   r   numba.np.ufuncr   numba.np.ufunc.dufuncr   r)   numba.tests.supportr	   r
   
numba.corer   r   r[   rn   r   r   r   r   r  r*  r>  r0   mainrR   r!   r   <module>rN     s       , 5 ( & 8 - O* O*d2#4 2+* +*\2$6 2\< \<@K K$ D1B 1Bh4x   4B2$6 2 zMMO r!   