+
    :i1                         ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHtHt ^ RIHt ^ R	IHtHt ^ R
ItR t ! R R]
4      t ! R R]P.                  ]	4      tR tR
# )    )typeof)types)GUFuncBuilder)parse_signature)	UfuncBaseUfuncLowererBase)ufunc_find_matching_loop)	serializeerrors)npydecl)	signatureAbstractTemplateNc                    a  ^ RI Hp  ! V 3R lRVP                  4      pV;P                  S P                  ,          un        V# )r   npyimplc                   V   <a a ] tR t^t oRt ZtV 3R ltV 3R ltV 3R ltRt	Vt
V ;t# )(make_gufunc_kernel.<locals>.GUFuncKernelz
npyimpl._Kernel subclass responsible for lowering a gufunc kernel
(element-wise function) inside a broadcast loop (which is
generated by npyimpl.numpy_gufunc_kernel()).
c                   < \         SV `  WV4       V P                  P                  VP                  4      pV P                  P                  V4      w  V n        V n        R # N)super__init__dufunc_get_ewise_dtypesargsfind_ewise_function	inner_sigcres)selfcontextbuilder	outer_sigewise_types	__class__s   &&&& S/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/np/ufunc/gufunc.pyr   1make_gufunc_kernel.<locals>.GUFuncKernel.__init__   sJ    GWy9++77	GK(,(G(G)%DNDI    c                   < \        V\        P                  4      '       d;   \        V\        P                  4      '       g   \        SV `  WP
                  V4      # \        SV `  WV4      # r   )
isinstancer   Arrayr   castdtype)r   valfromtytotyr#   s   &&&&r$   r*   -make_gufunc_kernel.<locals>.GUFuncKernel.cast   sK    &%++..tU[[11w|Ct<<7<T22r&   c                   < V P                   P                  '       d   R p\        P                  ! V4      hV P                  P                  V P                   P                  34       \        SV `   ! V!  # )zCCalling a guvectorize function in object mode is not supported yet.)	r   
objectmoder   NumbaRuntimeErrorr   add_linking_libslibraryr   generate)r   r   msgr#   s   &* r$   r5   1make_gufunc_kernel.<locals>.GUFuncKernel.generate%   sZ    yy###(..s33LL))499+<+<*>?7#T**r&   )r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r*   r5   __static_attributes____classdictcell____classcell__)r#   __classdict___dufuncs   @@r$   GUFuncKernelr      s%     	
 		3	+ 	+r&   rB   )numba.npr   _Kernelr8   )rA   r   rB   s   f  r$   make_gufunc_kernelrE      s5     +w +: W---r&   c                   6   a a ] tR t^1t oRtV 3R ltRtVtV ;t# )GUFuncLowererzHCallable class responsible for lowering calls to a specific gufunc.
    c                R   < ^ RI Hp \        SV `  V\        VP
                  4       R# )r   r   N)rC   r   r   r   rE   numpy_gufunc_kernel)r   gufuncr   r#   s   && r$   r   GUFuncLowerer.__init__4   s!    $+ 44	6r&    )	r8   r9   r:   r;   r<   r   r=   r>   r?   )r#   r@   s   @@r$   rG   rG   1   s     6 6r&   rG   c                      a  ] tR t^;t o RtRR ltR tR t]R 4       t	R t
RR ltR	 tR
 tR tR tRR ltR t]R 4       tR tR tR tR tRtV tR# )GUFuncz
Dynamic generalized universal function (GUFunc)
intended to act like a normal Numpy gufunc, but capable
of call-time (just-in-time) compilation of fast loops
specialized to inputs.
Nc                   Vf   / pR V n         RV n        WPn        W0n        \	        WW4Wg4      V n        V P
                  P                  P                  V n        V P
                  P                  P                  V n        V P
                  P                  V n
        V P                  V P                  4       \        P                  ! W4       R # )NF)ufunc_frozen_is_dynamic	_identityr   gufunc_builderpy_funcr8   r<   nb_func_dispatcher_initialize	functoolsupdate_wrapper)r   rU   r   identitycache
is_dynamictargetoptionswritable_argss   &&&&&&&&r$   r   GUFunc.__init__C   s     M
%!
 ,O ++33<<**22::..66))*  /r&   c                    V P                  4        V P                  4        \        V 4      V n        V P	                  4        R # r   )build_ufunc_install_typerG   	_lower_me_install_cg)r   
dispatchers   &&r$   rX   GUFunc._initializeX   s2    &t,r&   c                    V P                   p\        VP                  VP                  V P                  VP
                  V P                  VP                  VP                  VP                  V P                  R 7	      pV# ))	rU   r   r[   r\   r]   r^   r_   typesigsfrozen)rT   dictrU   r   rS   r\   rR   r^   r_   _sigsrQ   )r   gbdcts   &  r$   _reduce_statesGUFunc._reduce_states^   sc      JJll^^((''****XX<<

 
r&   c
           
     ~    V ! WVWEWgR 7      p
V F  pV
P                  V4       K  	  V
P                  4        Wn        V
# ))rU   r   r[   r\   r]   r^   r_   )addrb   rQ   )clsrU   r   r[   r\   r]   r^   r_   ri   rj   r   sigs   &&&&&&&&&&  r$   _rebuildGUFunc._rebuildm   sF     7(!.M CHHSM r&   c                "    R V P                    R2# )z<numba._GUFunc 'z'>)r8   r   s   &r$   __repr__GUFunc.__repr__y   s    !$--33r&   c           	         Vf!   V P                   P                  P                  p\        RV P                  ,           \
        3\        W P                  R7      4      pVP                  W4       R# )a  Constructs and installs a typing class for a gufunc object in the
input typing context.  If no typing context is given, then
_install_type() installs into the typing context of the
dispatcher object (should be same default context used by
jit() and njit()).
NGUFuncTyping_)keygeneric)	rW   targetdescrtyping_contexttyper8   r   rk   _type_meinsert_user_function)r   	typingctx_ty_clss   && r$   rc   GUFunc._install_type|   sX     ((44CCI6(*mm<> 	&&t5r&   c                <    V P                   P                  V4       R # r   )rT   rr   )r   ftys   &&r$   rr   
GUFunc.add   s    $r&   c                D    V P                   P                  4       V n        V # r   )rT   rb   rP   rx   s   &r$   rb   GUFunc.build_ufunc   s    ((446
r&   c                    \        V P                  P                  4      p\        \	        \
        V^ ,          4      4      \        \	        \
        V^,          4      4      3# r   )r   rT   r   tuplemaplen)r   
parsed_sigs   & r$   expected_ndimsGUFunc.expected_ndims   sC    $T%8%8%B%BC
c#z!}-.c#z!}6M0NOOr&   c                &   V'       d   Q hV P                   pV P                  P                  pV P                  4       w  rVWV,           p\	        V4      '       g   Q \	        V4      4       h\        V4       F  w  r\        V	\        P                  4      '       g   K'  V	P                  Wx,          8  g   K@  V\	        V4      8  d   RMRp
V\	        V4      8  d   TMV\	        V4      ,
          pV P                   RV
 RV RV	P                   RV RWx,           R2p\        P                  ! V4      h	  \        P                  P                  W1V4      pVw  p  pV P!                  V4      w  rOVf   V P"                  '       d   R	V  R
V 2p\        P                  ! V4      hV P%                  V4       V P!                  V4      w  rOVR8X  d)   RV P                   R
V 2p\        P                  ! V4      hVf   Q h\        \        P&                  .VO5!  # )z
Implement AbstractTemplate.generic() for the typing class
built by gufunc._install_type().

Return the call-site signature after either validating the
element-wise signature or compiling for it.
InputOutputz: z	 operand z& does not have enough dimensions (has z, gufunc core with signature z
 requires )zcannot call z with types zFail to compile NN)rP   rT   r   r   r   	enumerater(   r   r)   ndimr8   r   TypingErrorr   Numpy_rules_ufunc_handle_inputsr   rQ   _compile_for_argtysnone)r   argtyskwsrP   rt   	inp_ndims	out_ndimsndimsidxargkindir6   _handle_inputs_resultr"   _s   &&&             r$   r   GUFunc._type_me   s    w

!!++#224	%6{{&CJ&{!&)HC#u{{++5:0E"%I"6wHY/CS3y>5I}}oRvYqc :..1hhZ 8!!$Z
|1>  ((-- * !( 9 9 H H3! 4Q1))+6; |||$TF,vh?((--$$[1--k:FCl"(|F8L((--?"?-f--r&   c                \    V P                   ! V!  pV P                  P                  V4       R # r   )_get_function_typerT   rr   )r   r   return_typefntys   &&& r$   r   GUFunc._compile_for_argtys   s(     &&/%r&   c                f    V P                  VP                  4      p\        V4      \        V4      8H  # r   )r   r   r   )r   r"   rt   dtypess   &&& r$   match_signatureGUFunc.match_signature   s*    ''1V}k 222r&   c                    V P                   # r   )rR   rx   s   &r$   r]   GUFunc.is_dynamic   s    r&   c                    \        R  V4      p. pV FQ  p\        V\        P                  4      '       d   VP	                  VP
                  4       K@  VP	                  V4       KS  	  V# )c                 \    \        V \        P                  4      '       d   V # \        V 4      # r   )r(   r   Typer   )r   s   &r$   <lambda>*GUFunc._get_ewise_dtypes.<locals>.<lambda>   s%    
3

(C(C "!C["!r&   )r   r(   r   r)   appendr+   )r   r   r   tysargtys   &&   r$   r   GUFunc._get_ewise_dtypes   sW     !"&(E%--

5;;'

5!	 
 
r&   c                    \        V P                  P                  4      p\        V4      \        V^ ,          4      \        V^,          4      ,           8H  # r   )r   rT   r   r   )r   r   r   s   &* r$   _num_args_matchGUFunc._num_args_match   s>    $T%8%8%B%BC
4yC
1.Z]1CCCCr&   c                b   \        V P                  P                  4      pV P                  V4      p. p\	        V^ ,          4       F]  w  rV\        V4      pV^ 8X  d   VP                  W5,          4       K0  VP                  \        P                  ! W5,          VR4      4       K_  	  \        V^ ,          4      p\	        V^,          4       FO  w  rVW5V,           ,          p	\        V4      ;'       g    ^p
VP                  \        P                  ! WR4      4       KQ  	  \        P                  ! V!  # )r   A)
r   rT   r   r   r   r   r   r   r)   r   )r   r   r   r"   lr   sig_dimr   offsetrettyret_ndims   &*         r$   r   GUFunc._get_function_type   s    $T%8%8%B%BC
,,T2 %jm4LCw<Dqy)*[%5tSAB 5 Z]#%jm4LCf-E7|((qHHHU[[#67 5
 zz1~r&   c                   V P                   '       g   V P                  '       gQ   V'       d7   \        V^ ,          4      '       d   V^ ,          P                  ! V R.VO5/ VB # V P                  ! V/ VB # RV9   d   WP                  R4      3,          pV P                  ! V!  RJ d   RV P                   R2p\        V4      hV P                  V4      pV P                  '       d   \        V P                  V4      '       gH   V P                  V4      R8w  g"   V P                  ! V!  pV P                  V4       V P                  4        V P                  ! V/ VB # )r   __call__outFz Too few arguments for function 'z'. Note that the pattern `out = gufunc(Arg1, Arg2, ..., ArgN)` is not allowed. Use `gufunc(Arg1, Arg2, ..., ArgN, out) instead.r   )rQ   r]   _is_array_wrapper__array_ufunc__rP   popr   r8   	TypeErrorr   r	   r   r   rr   rb   )r   r   kwargsr6   ewisert   s   &*,   r$   r   GUFunc.__call__   s>    <<<t
 )$q'22Aw..*'+/5  zz42622f_ZZ&((D&%/
 34==/ B  
 C.  &&t,


7

EJJ ++E2lB--t4zz4*6**r&   )	r<   r8   rW   rQ   rS   rR   rd   rT   rP   )NNFNrL   r   )r8   r9   r:   r;   r<   r   rX   ro   classmethodru   ry   rc   rr   rb   r   r   r   r   propertyr]   r   r   r   r   r=   r>   )r@   s   @r$   rN   rN   ;   s     0* 	 	46%P-.^&3    	D0(+ (+r&   rN   c                |    \        V \        4      '       * ;'       d!    \        V R4      ;'       d    \        V R4      # )a  Return True if obj wraps around numpy or another numpy-like library
and is likely going to apply the ufunc to the wrapped array; False
otherwise.

At the moment, this returns True for

- dask.array.Array
- dask.dataframe.DataFrame
- dask.dataframe.Series
- xarray.DataArray
- xarray.Dataset
- xarray.Variable
- pint.Quantity
- other potential wrappers around dask array or dask dataframe

We may need to add other libraries that pickle ufuncs from their
__array_ufunc__ method in the future.

Note that the below test is a lot more naive than
`dask.base.is_dask_collection`
(https://github.com/dask/dask/blob/5949e54bc04158d215814586a44d51e0eb4a964d/dask/base.py#L209-L249),  # noqa: E501
because it doesn't need to find out if we're actually dealing with
a dask collection, only that we're dealing with a wrapper.
Namely, it will return True for a pint.Quantity wrapping around a plain float, a
numpy.ndarray, or a dask.array.Array, and it's OK because in all cases
Quantity.__array_ufunc__ is going to forward the ufunc call inwards.
__dask_graph__r   )r(   r   hasattr)objs   &r$   r   r   %  s@    : sD!! 	, 	,C)*	, 	,C*+r&   )numbar   
numba.corer   numba.np.ufunc.ufuncbuilderr   numba.np.ufunc.sigparser   numba.np.ufunc.ufunc_baser   r   numba.np.numpy_supportr	   r
   r   numba.core.typingr   numba.core.typing.templatesr   r   rY   rE   rG   ReduceMixinrN   r   rL   r&   r$   <module>r      sR      5 3 A ; ( % C !H6$ 6g+Y""I g+T r&   