+
    :iA                        ^ RI t ^ RIHtHt ^ RIt^ RIt^ RIHt ^ RIt	^ RI
t
^ RIHtHtHtHtHt ^ RIHt ^ RIHt R t]P*                  ! R4       ! R	 R
]P,                  4      4       t]
P0                  ] P2                  ]
P4                  ] P6                  ]
P8                  ] P:                  /t]
P>                  ] P@                  ]
PB                  ] PD                  ]
PF                  ] PH                  ]
PJ                  ] PL                  ]
PN                  ] PP                  ]
PR                  ] PT                  ]
PV                  ] PX                  ]
PZ                  ] P\                  ]
P^                  ] P`                  ]
Pb                  ] Pd                  ]
Pf                  ] Ph                  ]
Pj                  ] Pl                  /t7]
Pp                  ] Pr                  ]
Pt                  ] Pv                  ]
Px                  ] Pz                  ]
P|                  ] P~                  ]
P                  ] P                  ]
P                  ] P                  /tDR tE]P                  R 4       tG ! R R] P                  4      tIR R ltJR tKR# )    N)defaultdictOrderedDict)SimpleNamespace)typestargetconfigirrewritescompiler)npydecl)DUFuncc                 B    \        V \        P                  \        34      # N)
isinstancenpufuncr   )funcs   &X/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/np/ufunc/array_exprs.py	_is_ufuncr      s    dRXXv.//    zafter-inferencec                   l   a a ] tR t^t oRtV 3R ltR tR tR tR t	R t
R tR	 tR
 tR tRtVtV ;t# )RewriteArrayExprszThe RewriteArrayExprs class is responsible for finding array
expressions in Numba intermediate representation code, and
rewriting those expressions to a single operation that will expand
into something similar to a ufunc call.
c                   < \         \        V `
  ! V.VO5/ VB  VP                  P                  pR V9  d   \
        VR &   R# R# )	arrayexprN)superr   __init__	targetctxspecial_ops_lower_array_expr)selfstateargskwsr   	__class__s   &&*, r   r   RewriteArrayExprs.__init__   sC    /DDDoo11k)'8K$ *r   c                V   \        V4      ^ 8X  d   R# W n        W0n        \        4       V n        / V n        VP                  \        P                  4      pV F  pVP                  P                  pVP                  p\        V\        P                  4      '       dE   \        VP                  VR4      \        P                   4      '       d   V P#                  WhV4       K  \        V\        P$                  4      '       g   K  WP
                  V&   K  	  \        V P                  4      ^ 8  # )z
Using typing and a basic block, search the basic block for array
expressions.
Return True when one or more matches were found, False otherwise.
FN)len
crnt_blocktypemapr   array_assignsconst_assigns
find_instsr   Assigntargetnamevaluer   Exprgetr   Array_match_array_exprConst)	r   func_irblockr(   	calltypesassignmentsinstrtarget_nameexprs	   &&&&&    r   matchRewriteArrayExprs.match!   s     y>Q(]&&ryy1 E,,++K;;D4))7;;{D95;;GG&&uK@D"((++ 37"";/ ! 4%%&**r   c                  a  VP                   pS P                  pVR9   d   VP                  \        P                  9   de   \
        ;QJ d-    V 3R lVP                  4        4       F  '       d   K   RM"	  RM! V 3R lVP                  4        4       4      '       d   WV&   R# R# VR8X  d   VP                  P                  S P                  9   d   S P                  VP                  P                  ,          p\        V\        P                  4      '       d?   VP                  p\        V4      '       d    S P                  W'4      '       g   WV&   R# R# R# R# R# R# )zy
Find whether the given assignment (*instr*) of an expression (*expr*)
to variable *target_name* is an array expression.
c              3   r   <"   T F,  pSP                   VP                  ,          P                  x  K.  	  R # 5ir   )r(   r.   is_internal).0varr   s   & r   	<genexpr>6RewriteArrayExprs._match_array_expr.<locals>.<genexpr>Q   s+      0.s <<)55.s   47FTcallNunarybinop)opr)   fnr   supported_array_operatorsall	list_varsr   r.   r(   r   r   Function
typing_keyr   _has_explicit_output)r   r9   r;   r:   expr_opr)   	func_typefunc_keys   f&&&    r   r3   #RewriteArrayExprs._match_array_exprB   s    ''****7<<< s 0"nn.0sss 0"nn.0 0 0-2k*0 & tyy~~'ETYY^^4I)U^^44$//X&&44TDD5:k2 E ' 5 (F r   c                    \        VP                  4      \        VP                  4      ,           pVP                  e   R# W2P                  8  # )zZ
Return whether the *expr* call to *func* (a ufunc) features an
explicit output argument.
T)r&   r!   r"   varargnin)r   r;   r   nargss   &&& r   rP   &RewriteArrayExprs._has_explicit_output`   s:    
 DIITXX.;;" xxr   c                    VP                   pVR9   d   VP                  # VR8X  d2   V P                  VP                  P                  ,          P
                  # \        RP                  V4      4      h)rG   rE   z:Don't know how to find the operator for '{0}' expressions.rF   )rI   rJ   r(   r   r.   rO   NotImplementedErrorformatr   ir_exprir_ops   && r   _get_array_operator%RewriteArrayExprs._get_array_operatorl   sb    

&&::f_<< 1 12===!HOO 	r   c                    VP                   pVR8X  d   VP                  VP                  3# VR8X  d   VP                  4       # VR8X  d   VP                  # \        RP                  V4      4      h)zkGiven a Numba IR expression, return the operands to the expression
in order they appear in the expression.
rH   rG   rE   z:Don't know how to find the operands for '{0}' expressions.)rI   lhsrhsrM   r!   r[   r\   r]   s   && r   _get_operandsRewriteArrayExprs._get_operandsv   sn     

G;;++g$$&&f_<<!HOO 	r   c                    VP                   pVR8X  d   VP                  # V P                  V4       Uu. uF)  pV P                  P	                  VP
                  V4      NK+  	  ppV P                  V4      V3# u upi )zJTranslate the given expression from Numba IR to an array expression
tree.
r   )rI   r;   re   r*   r1   r.   r`   )r   r^   r_   op_varoperands_or_argss   &&   r   _translate_expr!RewriteArrayExprs._translate_expr   s     

K<<*.*<*<W*EG*E !..226;;G*E 	 G''02BBBGs   /A7c                   / p\        4       p\        \        4      pV P                  P	                  4        EF*  pVP
                  p. pV P                  V4      V3p\        P                  ! RVP                  VV P                  VP                  P                  ,          R7      p\        P                  ! WP                  VP                  4      p	WV&   WP                  VP                  P                  &   V P                  V4       EFU  p
V
P                  pV
P                  '       d   WP                  9   d   V P                  V,          pVP
                  pVP!                  4       pV F!  p
W:P                  ;;,          ^,          uu&   K#  	  VP#                  V P%                  V4      4       VP                  P                  '       d,   VP'                  VP                  P                  4       RW&   K  K  WP(                  9   d&   VP#                  V P(                  V,          4       EK&  W:P                  ;;,          ^,          uu&   VP#                  V
4       EKX  	  EK-  	  WV3# )zdIterate over the matches, trying to find which instructions should
be rewritten, deleted, or moved.
r   )rI   locr;   tyN)setr   intr)   valuesr/   r`   r   r0   rm   r(   r-   r.   r,   re   is_temprM   appendrj   addr*   )r   replace_map	dead_vars	used_varsr9   r;   arr_inpsarr_exprnew_expr	new_instroperandoperand_namechild_assign
child_exprchild_operandss   &              r   _handle_matches!RewriteArrayExprs._handle_matches   s    E	$	''..0E;;DH//5x?Hww+#'88$,"&,,u||/@/@"ACH 		(LL%))DI!*4=u||001--d3&||???|7I7I'I#'#5#5l#CL!-!3!3J%/%9%9%;N#1!,,/14/ $2OOD$8$8$DE#**222!l&9&9&>&>?481 3 "%7%77OOD$6$6|$DEll+q0+OOG,! 4 18 y00r   c                6    W,          pW19   d   W,          pK  V# )zFind the final replacement instruction for a given initial
instruction by chasing instructions in a map from instructions
to replacement instructions.
 )r   replacement_mapr9   replacements   &&& r   _get_final_replacement(RewriteArrayExprs._get_final_replacement   s     
 &,,)6Kr   c                   V P                  4       w  rpV P                  P                  4       pVP                  4        / pV P                  P                   EFc  p\        V\        P                  4      '       d   Wa9   d   V P                  W4      pV'       d   VP                  V4       VP                  P                  4        FX  pVP                  p	W9   d!   VP                  VP                  V	4      4       W9,          ^ 8  g   KD  W9;;,          ^,          uu&   KZ  	  K  K  VP                  V4       K  \        V\        P                  4      '       dR   VP                  p
W:,          ^ 8  d   W:;;,          ^,          uu&   WeV
&   EK5  W9  d   VP                  V4       EKO  EKR  VP                  V4       EKf  	  V'       d)   VP                  4        F  pVP!                  V4       K  	  V# )zmWhen we've found array expressions in a basic block, rewrite that
block, returning a new, transformed block.
)r   r'   copyclearbodyr   r   r,   r   rs   r/   rM   r.   popDelrq   insert_before_terminator)r   ru   rv   rw   result
delete_mapr9   r   rB   var_nameinstr_values   &          r   applyRewriteArrayExprs.apply   s{    -1,@,@,B)	 %%'
__))E%++'"&"="=##,K"k2#.#4#4#>#>#@C'*xxH'5 &jnnX.F G(2Q6 ) 3q 8 3 $A # MM%(E266**#kk)A-*a/*.3{+ 1MM%( 2 e$1 *2 #**,//6 -r   )r)   r*   r'   r(   )__name__
__module____qualname____firstlineno____doc__r   r<   r3   rP   r`   re   rj   r   r   r   __static_attributes____classdictcell____classcell__r#   __classdict__s   @@r   r   r      sD     
9+B;<
 	C#1J( (r   r   c                   \        V \        4      '       Ed   V w  r. p/ pV F2  p\        V4      w  rgVP                  V4       VP	                  V4       K4  	  V\
        P                  9   d   \        V4      ^8X  d   V\        9   d9   \        P                  ! V^ ,          \        V,          ! 4       V^,          4      V3# V\        9   d;   \        P                  ! V^ ,          \        V,          ! 4       .V^,          .4      V3# EMV\        9   g   Q h\        P                  ! \        V,          ! 4       V^ ,          4      V3# \        V4      '       d|   RP!                  \#        \%        V4      4      P'                  RR4      4      p\        P(                  ! V\        P*                  ! 4       4      p	WV&   \        P,                  ! W. 4      p
W3# M\        V \.        P0                  4      '       d   \        P(                  ! V P2                  \        P*                  ! 4       V P4                  P6                  V P4                  P8                  '       d   V P4                  P8                  M^ R7      / 3# \        V \.        P:                  4      '       d#   \        P<                  ! V P>                  4      / 3# \A        RV : R24      h)zSBuild a Python expression AST from an array expression built by
RewriteArrayExprs.
z__ufunc_or_dufunc_{0}-_)lineno
col_offsetz.Don't know how to translate array expression '')!r   tuple_arr_expr_to_astrs   updater   rK   r&   _binopsastBinOp_cmpopsCompare	_unaryopsUnaryOpr   r\   hexhashreplaceNameLoadCallr   Varr.   rm   linecolr4   Constantr/   r[   )r;   rI   arr_expr_argsast_argsenvargast_arg	child_envfn_namefn_ast_nameast_calls   &          r   r   r   
  s!    $  C!1#!6GOOG$JJy! ! 2228}!=99 WR[]HQKABEF F=;; gbkm_x{mEFIJ J ! Y&{{9R=?HQK@#EEr]]-44DH%%c3/1G((7CHHJ7KLxxr:H=   
D"&&	!	!xx		388:#xx}}3788<<<488<<QHIKL 	L 
D"((	#	#||DJJ'++
?CEG Gr   c              #    "   \        4       pV  F  pVP                  pVP                  P                  W2P                  R7      P                  pVP                  RR4      P                  RR4      pWA9   d   \        V: R24      hW#3W&   WBn        K  	  \        V4      p Vx  VP                  4        F  w  r#W2n        K  	  R#   TP                  4        F  w  r#Y2n        K  	  i ; i5i)zU
Legalize names in the variable list for use as a Python function's
parameter names.
)rm   $r   .z not uniqueN)	r   r.   scoperedefinerm   r   AssertionErrorlistrq   )var_listvar_maprB   old_namenew_nameparam_namess   &     r   _legalize_parameter_namesr   2  s      mG8899%%hGG%<AA##C-55c3? H<{!;<<M  w-K  %^^-MCH .W^^-MCH .s   BC) C $!C)!C&&C)c                   >   a a ] tR tRt oV3R lV 3R lltRtVtV ;t# )_EraseInvalidLineRangesiL  c                N   < V ^8  d   QhRS[ P                  RS[ P                  /# )   nodereturnr   AST)r\   r   s   "r   __annotate__$_EraseInvalidLineRanges.__annotate__M  s#      #'' cgg r   c                   < \         SV `  V4      p\        VR 4      '       d/   \        VRR4      e    VP                  VP
                  8  d   V=V=V# )r   
end_linenoN)r   generic_visithasattrgetattrr   r   )r   r   r#   s   &&r   r   %_EraseInvalidLineRanges.generic_visitM  sM    w$T*4""t\40<;;0r   r   )r   r   r   r   r   r   r   r   r   s   @@r   r   r   L  s       r   r   c                8    V ^8  d   QhR\         P                  /# )r   astreer   )r\   s   "r   r   r   W  s     & &sww &r   c                    \         P                  ! V 4       \        4       P                  V 4       \         P                  ! V 4       R# )z)Inplace fixes invalid lineno ranges.
    N)r   fix_missing_locationsr   visit)r   s   &r   _fix_invalid_lineno_rangesr   W  s1     f%##F+f%r   c           	     "  a aaa R\        \        V4      4      P                  RR4      ,          pVP                  P                  pVP                  4       p\        \        V4      R R7      pV Uu. uF  qfP                  NK  	  pp\        V4      ;_uu_ 4       pV U	u. uF  p	\        P                  ! V	R4      NK  	  p
p	\        P                  ! RP                  V4      VR4      p\        VR	4      '       d   \        VP                   4      ^8X  g   Q hVP                   ^ ,          pWP"                  n        \%        VP&                  4      w  VP                   ^ ,          n        p\+        V4       RRR4       \-        XVR4      p\/        VX4       W,          pS P0                  pS P2                  oVP4                  ! V 3R
 lV 4       !  p. pVP"                   F}  p\7        V\8        P:                  4      '       d   VP<                  p\7        V\8        P>                  4      '       d   VPA                  VPB                  4       Kl  VPA                  V4       K  	  VPD                  PB                  ! V!  o\F        PH                  ! 4       PK                  4       pVf   \L        PN                  ! 4       MVPQ                  4       pRVn)        VPU                  SVSVRR7      o^ RI+H,p  ! VVV3R lRVPZ                  4      p\]        \        V4      ^VR7      pVP^                  VP`                  ,           Vn1        V Uu. uF  pS Pe                  V4      NK  	  ppVPg                  VSVVVV4      # u upi u up	i   + '       g   i     EL; iu upi )z:Lower an array expression built by RewriteArrayExprs.
    z__numba_array_expr_%sr   r   c                     V P                   # r   )r.   )rB   s   &r   <lambda>#_lower_array_expr.<locals>.<lambda>j  s    r   )keyNzdef {0}(): returnexecr   c              3   F   <"   T F  pSP                  V4      x  K  	  R # 5ir   )typeof)rA   r.   lowerers   & r   rC   $_lower_array_expr.<locals>.<genexpr>  s     E94'....9s   !numpyF)flagscaching)npyimplc                   2   <a  ] tR tRt o VVV3R ltRtV tR# )%_lower_array_expr.<locals>.ExprKerneli  c           
     h  < \        WP                  P                  S
P                  4      pV UUUu. uF  w  r4pV P                  W4V4      NK  	  ppppV P                  P                  SS	P                  S
V4      pV P                  VS
P                  V P                  P                  4      # u upppi r   )zip	outer_sigr!   castcontextcall_internalfndescreturn_type)r   r!   arg_zipvalintyoutty	cast_argsr   buildercres	inner_sigs   &*      r   generate._lower_array_expr.<locals>.ExprKernel.generate  s    $ 3 3Y^^DG18:18-S 3e418  :\\//i<F99VY%:%:!^^779 9	:s   B-r   N)r   r   r   r   r  r   r   )r   r  r  r  s   @r   
ExprKernelr     s     	9 	9r   r  )rW   noutr   )4r   r   r   rm   filenamerM   sortedro   r.   r   r   r   parser\   r   r&   r   r!   r   r;   r/   r   compiler   r   r  rn   r   r   Optionaltyper2   rs   dtyper   r   ConfigStacktop_or_noner
   Flagsr   error_modelcompile_subroutinenumba.npr   _Kernelr   rW   r	  rX   loadvarnumpy_ufunc_kernel)r   r;   	expr_nameexpr_filenameexpr_var_listexpr_var_uniquerB   	expr_argsexpr_params
param_namer   
ast_moduleast_fn	namespacecode_objimplr   r   inner_sig_argsargtyr   r   r  r   r.   r!   r  r  r  s   f&                        @@@r   r   r   b  s    (3tDz?+B+B3+LMIHH%%MNN$M S/5IJO &55_c_I5 
#?	3	3{&13&1
 GGJ-&1 	 3 YY299)D,f6
z6**s:??/Cq/HHH##*:499*E'Ai":. 
4 z=&9H9D ooGooGE9EFINeU^^,,JJEeU[[))!!%++.!!%(   %%++^<I$$&224E %HNN5::<E  E%%gtYe.3 & 5D !9 9W__ 9 IQKE))ejj(EK.78idGOOD!iD8%%)T5*> >} 63 
4	3	3t 9s+   1M.M8 M3?B3M8<N3M88N		)Lr   collectionsr   r   
contextlibsysr   r   r   r   operator
numba.corer   r   r	   r
   numba.core.typingr   numba.np.ufunc.dufuncr   r   register_rewriteRewriter   posUAddnegUSubinvertInvertr   rt   AddsubSubmulMulttruedivDivmodModor_BitOrrshiftRShiftxorBitXorlshiftLShiftand_BitAndpowPowfloordivFloorDivr   eqEqneNotEqltLtleLtEgtGtgeGtEr   r   contextmanagerr   NodeTransformerr   r   r   r   r   r   <module>r\     s   
 0  
 !   B B % (0 
,-S(( S .Sn LL#((LL#((OOSZZ	 LL#''LL#''LL#((cggLL#''LL#))OOSZZLL#**OOSZZMM3::LL#''s||" KKKKKKKKKKKK%GP    2c11 &J>r   