+
    VBiz*                         ^RI HtHtHt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  ! R R	]4      tR
 t ! R R4      t ! R R4      tR tR tR tR# )   )Nodes	ExprNodes	FusedNodeNaming)error)
PyrexTypes)CythonUtilityCode)TempitaUtilityCodeUtilityCode)TreeVisitor)Symtabc                   :   a  ] tR t^t o RtRtR tR tR tRt	V t
R# )_FindCFuncDefNodezZ
Finds the CFuncDefNode in the tree

The assumption is that there's only one CFuncDefNode
Nc                P    V P                   '       d   R # V P                  V4       R # N)
found_nodevisitchildrenselfnodes   &&;/usr/lib/python3.14/site-packages/Cython/Compiler/UFuncs.py
visit_Node_FindCFuncDefNode.visit_Node   s    ???t$    c                    Wn         R # r   r   r   s   &&r   visit_CFuncDefNode$_FindCFuncDefNode.visit_CFuncDefNode   s    r   c                <    V P                  V4       V P                  # r   )visitr   )r   trees   &&r   __call___FindCFuncDefNode.__call__!   s    

4r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   r"   __static_attributes____classdictcell____classdict__s   @r   r   r      s%      J% r   r   c                 "    \        4       ! V 4      # r   )r   )r!   s   &r   get_cfunc_from_treer.   &   s    t$$r   c                   *   a  ] tR t^*t o RtR tRtV tR# )_ArgumentInfoa  
Everything related to defining an input/output argument for a ufunc

type  - PyrexType
type_constant  - str such as "NPY_INT8" representing numpy dtype constants
injected_typename - str representing a name that can be used to look up the type
                    in Cython code
c                *    Wn         W n        W0n        R # r   )typetype_constantinjected_typename)r   r2   r3   r4   s   &&&&r   __init___ArgumentInfo.__init__4   s    	*!2r   )r4   r2   r3   N)r$   r%   r&   r'   r(   r5   r)   r*   r+   s   @r   r0   r0   *   s     3 3r   r0   c                   J   a  ] tR t^:t o R tR tR tR tR tR t	R t
RtV tR	# )
UFuncConversionc                t   Wn         VP                  P                  4       V n        R V n        V P                   P                  P
                  P                  V P                  4      '       d   V ;P                  R,          un        KZ  . V n        V P                  4       V n	        V P                  4       V n        R# )ufunc_typename_N)r   local_scopeglobal_scoper4   entrycname
startswithinjected_typesget_in_type_infoin_definitionsget_out_type_infoout_definitionsr   s   &&r   r5   UFuncConversion.__init__;   s    	 ,,99;!1iioo##..t/E/EFF""c)" "335#557r   c                   VP                  4       pVP                  4       P                  R R4      P                  RR 4      p\        VVVR7      pV P                  P                  \        P                  ! RRVR7      4       RV 2# )r;   __ )type_substituted_cname
macro_name
type_cnameUFuncTypedef
UFuncs_C.ccontext__Pyx_typedef_ufunc_)empty_declaration_codestripreplacedictr=   use_utility_coder
   load)r   type_rK   declsubstituted_cnamerP   s   &&&   r   _handle_typedef_type_constant-UFuncConversion._handle_typedef_type_constantF   s    ++- JJL00d;CCCM#4!

 	**##	 &&7%899r   c                |   TpVP                   '       d   VP                  p\        P                  ! V4      pV\        P                  J d   \        VR V,          4       R# VP                  '       d   V P                  VR4      # VP                  '       d\   RpVP                  \        P                  8X  d   RpM!VP                  \        P                  8X  d   RpV P                  VRV R24      # VP                  '       d   V P                  VR4      # VP                  '       d   R	# \        VR V,          4       R# )
z,Type '%s' cannot be used as a ufunc argumentN__PYX_GET_NPY_COMPLEX_TYPE SU__PYX_GET_NPY_INT_TYPE__PYX_GET_NPY_FLOAT_TYPE
NPY_OBJECT)
is_typedeftypedef_base_typer   remove_cv_refc_bint_typer   
is_complexr[   is_intsignedSIGNEDUNSIGNEDis_floatis_pyobject)r   posrX   	base_typerl   s   &&&  r   _get_type_constant"UFuncConversion._get_type_constantV   s   	!33I,,Y7	
...#EMN5502 2 \\\F||z000!4!4455 13 3 ^^^55*, ,  	cAEIJr   c                \   . p\        V P                  P                  4       F  w  r#V P                   R V 2pV P                  P                  V4       V P                  V P                  P                  VP                  4      pVP                  \        VP                  WT4      4       K  	  V# )_in_)
	enumerater   argsr4   rA   appendrs   rq   r2   r0   )r   definitionsnargr4   
type_consts   &     r   rB    UFuncConversion.get_in_type_infov   s    		/FA#'#9#9":$qc B&&'8900IJ}SXXzUV	 0
 r   c                   V P                   P                  P                  '       d"   V P                   P                  P                  pMV P                   P                  .p. p\	        V4       Fr  w  r4V P
                   R V 2pV P                  P                  V4       V P                  V P                   P                  V4      pVP                  \        WFV4      4       Kt  	  V# )_out_)r   return_type	is_ctuple
componentsrw   r4   rA   ry   rs   rq   r0   )r   r   rz   r{   r2   r4   r}   s   &      r   rD   !UFuncConversion.get_out_type_info   s    99  ***..99J))//0J ,GA#'#9#9":%s C&&'8900EJd0AB	 - r   c                   V P                    Uu. uF  qP                  VP                  3NK  	  ppV P                   Uu. uF  qP                  VP                  3NK  	  pp\	        W#,           4      pR V P
                  P                  n        V P                  P                  V P
                  P                  P                  R,           4      p\        ;QJ d    R V 4       F  '       g   K   R M	  RM! R V 4       4      ;'       g5    \        ;QJ d    R V 4       F  '       g   K   R M	  RM! R V 4       4      '       * p\	        RRVRVRVRV P
                  P                  P                  R	V P
                  P                  P                  P                  R
V/VB p\        P                  ! RRV P                  P                   4      pVP#                  V P
                  P                  P                  V P
                  P                  P                  V P
                  P                  P                  V P
                  P$                  RR7       \&        P(                  ! RRVVR7      p	V	P+                  R R7      p
V
# u upi u upi )T
_ufunc_defc              3   >   "   T F  w  rVP                   x  K  	  R # 5ir   rp   .0r;   ts   &  r   	<genexpr>;UFuncConversion.generate_cy_utility_code.<locals>.<genexpr>   s     -R	amm	   Fc              3   >   "   T F  w  rVP                   x  K  	  R # 5ir   r   r   s   &  r   r   r      s     4)$!)r   
func_cnamein_types	out_typesinline_func_callnogilwill_be_called_without_gilufunc_moduleNextern)namer?   r2   rq   
visibilityUFuncDefinitionz
UFuncs.pyx)rP   
from_scope)entries_only )rC   r4   r2   rE   rU   r   r>   usedr=   next_idr   anyr?   r   r   ModuleScoperP   declare_cfunctionrq   r	   rW   get_tree)r   a	arg_typesr   context_typesufunc_cnamer   rP   ufunc_global_scopecoder!   s   &          r   generate_cy_utility_code(UFuncConversion.generate_cy_utility_code   s   <@<O<OP<Oq))1662<O	P<@<P<PQ<Pq))1662<P	QY23#		''//		0D0D|0ST*-#-R	-R###-R	-R*R +5 +5C4)4CCC4)44&6"  
"

  
 "YY__22	

 ))//&&,,
 (B
 
 $//D$"3"3";";
 	,,&&))//''%%		 	- 	
 !%%+	
 }}$}/Q QQs
    I= Jc                &   V P                   P                  \        P                  ! R R4      4       V P                   P                  \        P                  ! RR4      4       V P                   P                  \        P                  ! RR4      4       R# )
UFuncsInitrN   UFuncTypeHandlingNumpyImportUFunczNumpyImportArray.cN)r=   rV   r   load_cached)r   s   &r   use_generic_utility_code(UFuncConversion.use_generic_utility_code   su    **##L,?	
 	**##$7F	
 	**##$68LM	
r   )r=   rC   r4   rA   r   rE   N)r$   r%   r&   r'   r5   r[   rs   rB   rD   r   r   r)   r*   r+   s   @r   r8   r8   :   s0     	8: K@)V

 

r   r8   c                 h   \        V \        P                  4      '       dN   V P                  P                  P
                  '       d   \        V P                  R 4       V # \        V 4      .pT pM\        V \        P                  4      '       d   \        V P                  \        P                  4      '       dz   V P                  P                  P                  P
                  '       d   \        V P                  R 4       V # V P                   Uu. uF  p\        V4      NK  	  ppV P                  pM\        V P                  R4       V # V'       g   R# V^ ,          P                  P                  VP                  P                    V^ ,          P#                  4        V .\%        W4      ,           # u upi )z0Methods cannot currently be converted to a ufuncz,Only C functions can be converted to a ufuncN)
isinstancer   CFuncDefNoder<   parent_scopeis_c_class_scoper   rq   r8   r   FusedCFuncDefNoder   nodesr=   entriesr>   r   r   _generate_stats_from_converters)r   
convertersoriginal_noder{   s   &   r   convert_to_ufuncr      s?   $**++((999$((NOK%d+,
	D)55	6	6:		5%%< < 99  -->>>$((NOK26**=*Qoa(*
=		dhhFG1""**=+>+>+C+CDqM**,63JNNN >s   F/c                    V ^ ,          P                   pVP                  \        P                  R,           4      pVP                  \        P                  R,           4      pVP                  \        P                  R,           4      p. pRpRp	V  F  p
V
P                   Uu. uF  qP
                  NK  	  ppVe   V\        V4      8X  g   Q hM\        V4      pVP                  V4       V
P                   Uu. uF  qP
                  NK  	  ppV	e   V	\        V4      8X  g   Q hM\        V4      p	VP                  V4       K  	  V Uu. uF  qP                  P                  NK  	  pp\        VVVVVR7      pVP                  \        P                  ! RRVR7      4       VP                  pVP                  P                   pVP"                  pV: R	V: R
V: R	\        V4      : R
V: R
V	: RV: RV'       d   VP%                  4       MR: R2p\&        P(                  ! VR\*        P,                  ! \*        P.                  \*        P0                  ! R\*        P2                  R4      .4      \&        P4                  ! V\*        P2                  VR7      .R7      pVP7                  V\*        P.                  V4      p\8        P:                  ! V\&        P<                  ! VV\*        P.                  VR7      VR7      pV# u upi u upi u upi )    funcstypesdataN)ufunc_funcs_namefunc_cnamesufunc_types_nametype_constantsufunc_data_nameUFuncConstsrN   rO   z(), z, z, PyUFunc_None, "z", NULLz, 0PyUFunc_FromFuncAndDatadummy)r2   value)function_name	func_typerx   )r   r2   r>   )lhsrhs)r=   r   r   pyrex_prefixrC   r3   lenextendrE   r>   r?   rU   rV   r
   rW   rq   r   docas_c_string_literalr   PythonCapiCallNoder   	CFuncTypepy_object_typeCFuncTypeArgc_void_ptr_type	ConstNodedeclare_varr   SingleAssignmentNodeNameNode)r   cfunc_nodesr   r=   r   r   r   r   narg_innarg_outcdin_const	out_constcfnoder   rP   rq   	func_namedocstrargs_to_func	call_node	lhs_entry
assgn_nodes   &&&                     r   generate_ufunc_initializationr      s   a=--L#++F,?,?',IJ#++F,?,?',IJ"**6+>+>+GHONGH-.-=-=>-=OO-=>c(m+++(mGh'./.?.?@.?__.?	@s9~---9~Hi(  5@@K&<<%%KK@))%'G !!|WM 

C##((IF 	K(.""$F:	L ,,/&&%%$$Wj.H.H$OP

 *44L
I ((J4M4MsSI++ij&?&?y
 J  ? A As   K:6K?Lc                    . pV  Fh  pVP                  4       p\        V4      pVP                  P                  P	                  VP
                  P                  4       VP                  V4       Kj  	  VP                  \        WV4      4       V# r   )r   r.   r=   utility_code_listr   scopery   r   )r   r   stats	converterr!   
ufunc_nodes   &&    r   r   r   -  st    E	113(.
0077

8T8TUZ    
LL.z$GHLr   N)r_   r   r   r   r   Errorsr   r   r   r	   Coder
   Visitorr   r   r   r.   r0   r8   r   r   r   r   r   r   <module>r      s]       * 1    .%3 3 I
 I
XO8HV
r   