o
    ÔôjP�  ã                   @   sJ  d dl mZ d dlZd dlmZ d dlZd dlZd dlZd dl	m
Z
 d dlmZmZmZmZmZmZmZmZmZmZmZ d dlmZmZmZmZ d dlmZmZ d dlm Z  d d	l!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z' d d
l(m)Z)m*Z*m+Z+ d dl,m-Z- d dl.m/Z/ eej0ƒdd„ ƒZ1eej2ej3ej3ƒdd„ ƒZ4eej5ej3ej3ƒdd„ ƒZ6eej5ej7ej7ƒdd„ ƒZ8eej5ej9ej9ƒdd„ ƒZ:eej;ej<ej<ƒeej;ej=ej=ƒdd„ ƒƒZ>eej?ej<ej<ƒeej?ej=ej=ƒdd„ ƒƒZ@dd„ ZAeej;ƒeAdƒƒ eej?ƒeAdƒƒ eejBƒdd „ ƒZCeej3ejBƒeejDejBƒeej9ejBƒd!d"„ ƒƒƒZEeejBej3ƒeejBej9ƒeejBejDƒd#d$„ ƒƒƒZFeejGejHejIƒd%d&„ ƒZJeejKejHejIej3ƒd'd(„ ƒZLd)d*„ ZMd+d,„ ZNeeOejPƒd-d.„ ƒZQeeOejPejIƒd/d0„ ƒZReeSej3ƒd1d2„ ƒZTed3d4„ ƒZUeeVƒd5d6„ ƒZWeeSejXƒd7d8„ ƒZYeeZe [ej3¡ƒd9d:„ ƒZ\eej]ej3ƒd;d<„ ƒZ^eej_ƒd=d>„ ƒZ`eejaƒd?d@„ ƒZbeejDƒdAdB„ ƒZceedej3ƒdCdD„ ƒZeeefejgƒdEdF„ ƒZheeiejjƒdGdH„ ƒZkedIej3ej3ƒdJdK„ ƒZleemejnƒdLdM„ ƒZoeepejqƒdNdO„ ƒZreesƒdPdQ„ ƒZteesejuƒdRdS„ ƒZveepƒdTdU„ ƒZweepdVdW�dXdY„ ƒZxd dZlymzZzm{Z{ d d[l|mZm}Z} eezej~ejƒeezej€ejƒd\d]„ ƒƒZ�ee‚ƒd^d_„ ƒZƒee‚ƒd`da„ ƒZ„ee…ƒdbdc„ ƒZ†ee…ƒddde„ ƒZ‡ee…ƒdfdg„ ƒZˆee‚ƒdhdi„ ƒZ‰edjdk„ ƒZŠedldm„ ƒZ‹e}dndo„ ƒZŒe}dpdo„ ƒZ�e}dqdr„ ƒZŽee‚ƒdsdt„ ƒZ�ee…ƒdudv„ ƒZ�eej‘e [ej3¡ƒdwdx„ ƒZ’ee“ƒd–dydz„ƒZ”ee•ƒd{d|„ ƒZ–ee—ƒd}d~„ ƒZ˜ee™ƒdd€„ ƒZšd�d‚„ Z›ee›ƒdƒd„„ ƒZœed…d†„ ƒZ�ed‡dˆƒZžežƒ ZŸee dd‰�dŠd‹„ ƒZ¡ee ƒdŒd�„ ƒZ¢edŽd�„ ƒZ£ee¤ƒd�d‘„ ƒZ¥ee¦ƒd’d“„ ƒZ§ee¨ƒd—d”d•„ƒZ©dS )˜é    )Ú
namedtupleN)Úreduce)Úir)Úlower_builtinÚlower_getattrÚlower_getattr_genericÚ
lower_castÚlower_constantÚiternext_implÚcall_getiterÚcall_iternextÚimpl_ret_borrowedÚimpl_ret_untrackedÚnumba_typeref_ctor)ÚtypingÚtypesÚutilsÚcgutils)ÚoverloadÚ	intrinsic)Ú
Conversion)ÚTypingErrorÚLoweringErrorÚNumbaExperimentalFeatureWarningÚNumbaTypeErrorÚRequireLiteralValueÚNumbaPerformanceWarning)ÚAbstractTemplateÚinfer_globalÚ	signature)Úliteral_unroll)Úas_numba_typec                 C   s   t | tjƒrdd„ }|S d S )Nc                 S   s   | S ©N© ©Úvalr#   r#   úi/var/www/html/academy/tools/voices/clone/cosy-venv/lib/python3.10/site-packages/numba/cpython/builtins.pyÚimpl    ó   zol_truth.<locals>.impl©Ú
isinstancer   ÚBoolean)r%   r'   r#   r#   r&   Úol_truth   s   ýr,   c                 C   s   |   tj|¡}| |||ƒ¡S )z3
    Implement `x is not y` as `not (x is y)`.
    )Úget_functionÚoperatorÚis_Únot_)ÚcontextÚbuilderÚsigÚargsZis_implr#   r#   r&   Úgeneric_is_not%   s   r5   c                 C   s`   |j \}}||kr-|jrd}t|ƒ‚z	|  tj|¡}W n ty'   tj Y S w |||ƒS tjS )z-
    Default implementation for `x is y`
    zno default `is` implementation)	r4   Úmutabler   r-   r.   ÚeqÚNotImplementedErrorr   Ú	false_bit)r1   r2   r3   r4   Úlhs_typeÚrhs_typeÚmsgÚeq_implr#   r#   r&   Ú
generic_is.   s   

þ
r>   c                 C   sJ   |j \}}||kr"| |d tj¡}| |d tj¡}| d||¡S tjS )z7
    Implementation for `x is y` for Opaque types.
    r   é   z==)r4   Úptrtointr   Úintp_tÚicmp_unsignedr9   )r1   r2   r3   r4   r:   r;   Zlhs_ptrZrhs_ptrr#   r#   r&   Ú	opaque_isH   s   
rC   c                 C   sb   |\}}|j \}}|  |||tj¡}|  |||tj¡}	|  tjt tjtjtj¡¡}
|
|||	fƒS )zà
    Implementation for `x is y` for types derived from types.Boolean
    (e.g. BooleanLiteral), and cross-checks between literal and non-literal
    booleans, to satisfy Python's behavior preserving identity for bools.
    )	r4   Úcastr   Úbooleanr-   r.   r7   r   r   )r1   r2   r3   r4   Úarg1Úarg2Z	arg1_typeZ	arg2_typeZ_arg1Z_arg2r=   r#   r#   r&   Úbool_is_implX   s   
þrH   c                 C   s@   |j \}}d}|j|jkrd}t t d¡|¡}t| ||j|ƒS ©Nr   r?   ©r4   Úliteral_valuer   ÚConstantÚIntTyper   Úreturn_type©r1   r2   r3   r4   rF   rG   r%   Úresr#   r#   r&   Úconst_eq_implk   ó   
rQ   c                 C   s@   |j \}}d}|j|jkrd}t t d¡|¡}t| ||j|ƒS rI   rJ   rO   r#   r#   r&   Úconst_ne_implw   rR   rS   c                    s   ‡ fdd„}|S )Nc                    sŽ   t | tjƒ}t |tjƒ}|r|r‡fdd„}|S ||A rEt | tjƒ}t |tjƒ}|s,|r:ˆr4dd„ }|S dd„ }|S ˆ ‰ ‡ fdd„}|S d S )Nc                    ó   ˆ S r"   r#   ©ÚaÚbr$   r#   r&   r'   ˆ   r(   z/gen_non_eq.<locals>.none_equality.<locals>.implc                 S   s   | |u S r"   r#   rU   r#   r#   r&   r'   –   ó   c                 S   s   | |uS r"   r#   rU   r#   r#   r&   r'   ™   rX   c                    rT   r"   r#   rU   ©Znvalr#   r&   r'   Ÿ   r(   )r*   r   ÚNoneTypeÚOptional)rV   rW   Za_noneZb_noner'   Z
a_optionalZ
b_optionalr$   rY   r&   Únone_equalityƒ   s$   þëz!gen_non_eq.<locals>.none_equalityr#   )r%   r\   r#   r$   r&   Ú
gen_non_eq‚   s   r]   TFc                 C   s4   |  ¡ }|  ||||¡}|  ||¡}|| ||||ƒS )z>
    Deferred.__getattr__ => redirect to the actual type.
    )ÚgetrD   Úget_getattr)r1   r2   ÚtypÚvalueÚattrZ
inner_typer%   Úimpr#   r#   r&   Údeferred_getattr©   s   rd   c                 C   s0   |   |||| ¡ ¡}| j| }| || ¡ |¡S r"   )rD   r^   Údata_model_managerÚsetÚmake_uninitialized)r1   r2   ÚfromtyÚtotyr%   ÚactualÚmodelr#   r#   r&   Úany_to_deferred³   s   
rl   c                 C   s*   | j | }| ||¡}|  ||| ¡ |¡S r"   )re   r^   rD   )r1   r2   rh   ri   r%   rk   r#   r#   r&   Údeferred_to_any»   s   
rm   c                 C   s0   |\}}|  ||g¡}| |¡}t| ||j|ƒS r"   )ÚgepÚloadr   rN   )r1   r2   r3   r4   Úbase_ptrÚidxÚelem_ptrrP   r#   r#   r&   Úgetitem_cpointerÆ   s   
rs   c                 C   s(   |\}}}|  ||g¡}| ||¡ d S r"   )rn   Ústore)r1   r2   r3   r4   rp   rq   r%   rr   r#   r#   r&   Úsetitem_cpointerÎ   s   
ru   c           	         sX   t |ƒt |ƒksJ ||fƒ‚t |ƒdksJ ‚‡ ‡‡fdd„}t||ƒ}t||ƒ\}}|S )Nr   c                    sŠ   | \}}|\}}ˆj  ||¡}|d usJ ‚ˆ ˆ |||¡}ˆ ˆ |||¡}t tj||¡}ˆ ˆ|¡}|ˆ ||fƒ}	ˆ  |	||¡}
||
fS r"   )	Útyping_contextÚunify_typesrD   r   r   r   rE   r-   Úselect)Zaccumulatorra   ZacctyÚaccZvtyÚvÚtyÚcmpsigÚgeÚpredrP   ©r2   Úcmpopr1   r#   r&   Úbinary_minmaxÛ   s   z do_minmax.<locals>.binary_minmax)ÚlenÚzipr   )	r1   r2   Úargtysr4   r€   r�   ZtypvalsÚrestyZresvalr#   r   r&   Ú	do_minmax×   s   
r†   c                 C   s   d| j f S )Nzllvm.rint.f%d)Úbitwidth)Útpr#   r#   r&   Ú_round_intrinsicî   s   r‰   c           
      C   sj   |j d }|  |¡}|j}t ||g¡}t ||t|ƒ¡}| ||¡}	| 	|	|  |j
¡¡}	t| ||j
|	ƒS ©Nr   )r4   Úget_value_typeÚmoduler   ÚFunctionTyper   Úget_or_insert_functionr‰   ÚcallÚfptosirN   r   )
r1   r2   r3   r4   ÚflttyÚlltyrŒ   ÚfntyÚfnrP   r#   r#   r&   Úround_impl_unaryò   s   

r•   c                    sN   |j d }t t|ƒt ||¡¡‰ ‡ fdd„}|  ||||¡}t| ||j|ƒS )Nr   c                    sŽ   t  | ¡s
t  | ¡r| S |dkr8|dkrd|d  }d}nd| }d}| | | }t  |¡r0| S ˆ |ƒ| | S d|  }| | }ˆ |ƒ| S )Nr   é   g      $@g’ÕMÏð€Dg      ð?)ÚmathÚisinfÚisnan)ÚxÚndigitsZpow1Zpow2Úy©Ú_roundr#   r&   Úround_ndigits  s   

z(round_impl_binary.<locals>.round_ndigits)	r4   r   ÚExternalFunctionr‰   r   r   Úcompile_internalr   rN   )r1   r2   r3   r4   r‘   rŸ   rP   r#   r�   r&   Úround_impl_binaryþ   s   
ÿr¢   c                 C   ó0   |j \}|\}|  ||||j¡}t| ||j|ƒS r"   ©r4   rD   rN   r   )r1   r2   r3   r4   r{   r%   rP   r#   r#   r&   Ú
float_impl$  ó   r¥   c                 C   s2   t |tjƒr	|}ntj}dd„ }t||ƒ}||fS )Nc                 S   r£   r"   r¤   )r1   r2   r   r4   r{   r%   rP   r#   r#   r&   r'   2  s   zcast_int.<locals>.impl)r*   r   ÚIntegerÚintpr   )Ú	typingctxrš   Úrettyr'   r3   r#   r#   r&   Úcast_int+  s   
r«   c                 C   s&   t | tjtjtjfƒrdd„ }|S d S )Nc                 S   ó   t | ƒS r"   )r«   ©rš   r#   r#   r&   r'   >  rX   zol_int.<locals>.impl)r*   r   r§   r+   ÚFloat)rš   r'   r#   r#   r&   Úol_int;  s   ür¯   c                 C   s,   |j \}|  |jt|jƒ¡}t| ||j|ƒS r"   )r4   Úget_constantrN   ÚfloatrK   r   )r1   r2   r3   r4   r{   rP   r#   r#   r&   Úfloat_literal_implC  s   r²   c                 C   sâ   |j }|j}t|jƒdkr9|j\}|\}t|tjƒr*|  ||||¡}t| ||j |ƒS |  ||||¡}	|  	|d¡}
n t|jƒdkrY|j\}}|\}	}
|  ||	||¡}	|  ||
||¡}
|  
||¡}|	|_|
|_| ¡ }t| ||j |ƒS )Nr?   r   é   )rN   Úunderlying_floatr‚   r4   r*   r   ÚComplexrD   r   r°   Úmake_complexÚrealÚimagÚ	_getvalue)r1   r2   r3   r4   Zcomplex_typeZ
float_typeÚargtyÚargrP   r·   r¸   ZrealtyZimagtyÚcmplxr#   r#   r&   Úcomplex_implJ  s(   
r½   c                    sb   t |jtjƒr!|jj‰ ‡ fdd„}|  ||||¡}t| ||j|ƒS |\}|j\}|  ||||j¡S )z1
    Call a number class, e.g. np.int32(...)
    c                     s   t j| ˆ d�S )N)Údtype)ÚnpÚarray)Zarg_hack©Údtr#   r&   Úfoon  s   znumber_constructor.<locals>.foo)	r*   rN   r   ÚArrayr¾   r¡   r   r4   rD   )r1   r2   r3   r4   rÃ   rP   r%   Úvaltyr#   rÁ   r&   Únumber_constructorf  s   rÆ   c                 C   ó   |   ¡ S r"   ©Úget_dummy_value©r1   r2   r{   Úpyvalr#   r#   r&   Úconstant_dummy|  s   rÌ   c                 C   s0   |   |¡}| j|| |¡t|ƒd�}| ||¡S )N)Úinfo)Úget_function_pointer_typeÚadd_dynamic_addrÚget_pointerÚstrÚbitcast)r1   r2   r{   rË   ÚptrtyZptrvalr#   r#   r&   Úconstant_function_pointer�  s
   
ÿrÔ   c                 C   s&   |d u r|   ||j¡S |  ||j|¡S r"   )Úmake_optional_noneÚtypeÚmake_optional_valuerÊ   r#   r#   r&   Úconstant_optional‰  s   rØ   c                 C   rÇ   )z&
    One-argument type() builtin.
    rÈ   )r1   r2   r3   r4   r#   r#   r&   Ú	type_impl“  s   rÙ   c                 C   s    |j \}|\}t| |||ƒ}|S r"   )r4   r   )r1   r2   r3   r4   r{   r%   Úitervalr#   r#   r&   Ú	iter_impl›  s   rÛ   c                 C   sr   |j \}|\}t| |||ƒ}|j| | ¡ ¡dd�� | j |td¡ W d   ƒ | ¡ S 1 s0w   Y  | ¡ S )NF)Úlikelyr#   )	r4   r   Úif_thenr0   Úis_validÚ	call_convÚreturn_user_excÚStopIterationÚyielded_value)r1   r2   r3   r4   ZitertyrÚ   rP   r#   r#   r&   Ú	next_impl£  s   
ÿýrã   znot inc                 C   s"   dd„ }|   ||||¡}| |¡S )Nc                 S   s   t  || ¡S r"   )r.   ÚcontainsrU   r#   r#   r&   Úin_impl´  ó   znot_in.<locals>.in_impl)r¡   r0   )r1   r2   r3   r4   rå   rP   r#   r#   r&   Únot_in²  s   
rç   c                 C   s0   |j \}|j}|  |t|jƒ¡}t| ||j|ƒS r"   )r4   rN   r°   r‚   r   r   )r1   r2   r3   r4   r{   rª   rP   r#   r#   r&   Úconstsized_len½  r¦   rè   c                 C   s   |j \}t|ƒrtjS tjS r"   )r4   r‚   r   Útrue_bitr9   )r1   r2   r3   r4   r{   r#   r#   r&   Ú
sized_boolÅ  s   rê   c                 C   s    |j }|  |¡}t| ||j |ƒS r"   )rN   Úget_constant_undefr   )r1   r2   r3   r4   rª   rP   r#   r#   r&   Úlower_empty_tupleÍ  s   
rì   c                 C   s   |\}t | ||j|ƒS r"   )r   rN   )r1   r2   r3   r4   r%   r#   r#   r&   Úlower_tupleÓ  s   rí   c                 C   s:   t jt jt jt jt jt jt jf}t| |ƒrdd„ }|S d S )Nc                 S   s   t | ƒdkS rŠ   )r‚   r­   r#   r#   r&   Ú	bool_implå  ræ   z bool_sequence.<locals>.bool_impl)	r   ÚCharSeqÚUnicodeCharSeqÚDictTypeÚListTypeÚSetTypeÚUnicodeTypeÚSetr*   )rš   Zvalid_typesrî   r#   r#   r&   Úbool_sequenceØ  s   ù

ýrö   Úalways)Úinlinec                 C   s    t | tjƒs
| d u rdd„ S d S )Nc                 S   ó   dS ©NFr#   r­   r#   r#   r&   Ú<lambda>ì  s    zbool_none.<locals>.<lambda>©r*   r   rZ   r­   r#   r#   r&   Ú	bool_noneé  s   ÿrý   )Ú
IndexValueÚIndexValueType)r   Úregister_jitablec                 C   s2   |j }|\}}t |¡| |ƒ}||_||_| ¡ S r"   )rN   r   Úcreate_struct_proxyÚindexra   r¹   )r1   r2   r3   r4   r`   r  ra   Zindex_valuer#   r#   r&   Úimpl_index_valueó  s   r  c                 C   ó(   t | tƒrt |tƒrdd„ }|S d S d S )Nc                 S   st   t  | j¡rt  |j¡r| j|jk r| S |S | S t  |j¡r |S | j|jkr(|S | j|jkr8| j|jk r6| S |S | S r"   ©r¿   r™   ra   r  ©Úindval1Úindval2r#   r#   r&   Úmin_impl  ó   zindval_min.<locals>.min_impl©r*   rÿ   )r  r  r	  r#   r#   r&   Ú
indval_minþ  ó   
ÿèr  c                 C   ó,   t | tjƒrt |tjƒrdd„ }|S d S d S )Nc                 S   s   | o|S r"   r#   ©Úval1Úval2r#   r#   r&   Úbool_min_impl  rX   z"boolval_min.<locals>.bool_min_implr)   )r  r  r  r#   r#   r&   Úboolval_min  ó   
ÿür  c                 C   r  )Nc                 S   st   t  | j¡rt  |j¡r| j|jk r| S |S | S t  |j¡r |S |j| jkr(|S | j|jkr8| j|jk r6| S |S | S r"   r  r  r#   r#   r&   Úmax_impl(  r
  zindval_max.<locals>.max_implr  )r  r  r  r#   r#   r&   Ú
indval_max$  r  r  c                 C   r  )Nc                 S   s   | p|S r"   r#   r  r#   r#   r&   Úbool_max_implE  rX   z"boolval_max.<locals>.bool_max_implr)   )r  r  r  r#   r#   r&   Úboolval_maxA  r  r  c                  G   ó–   t | ƒdkr4t| d tjƒrt| d jtjtjfƒs.t| d tjƒr4tdd„ | d jD ƒƒr4dd„ }|S | D ]}t|tjtjfƒsD d S q6dd„ }|S )Nr?   r   c                 s   ó"   � | ]}t |tjtjfƒV  qd S r"   ©r*   r   ÚNumberr+   ©Ú.0r{   r#   r#   r&   Ú	<genexpr>S  ó   €  zol_max.<locals>.<genexpr>c                  W   ó   t | d ƒS rŠ   ©Ú
max_varargr­   r#   r#   r&   r'   V  ræ   zol_max.<locals>.implc                  W   r¬   r"   r"  r­   r#   r#   r&   r'   ^  rX   ©	r‚   r*   r   ÚUniTupler¾   r  r+   Ú	BaseTupleÚall©rš   r'   r{   r#   r#   r&   Úol_maxK  ó"   þýûú	ÿr)  c                  G   r  )Nr?   r   c                 s   r  r"   r  r  r#   r#   r&   r  k  r   zol_min.<locals>.<genexpr>c                  W   r!  rŠ   ©Ú
min_varargr­   r#   r#   r&   r'   n  ræ   zol_min.<locals>.implc                  W   r¬   r"   r+  r­   r#   r#   r&   r'   v  rX   r$  r(  r#   r#   r&   Úol_minc  r*  r-  c                 C   óX   t |ƒdkr
tdƒ‚dd„ }| j|Ž }|d ur t||ƒ}||fS tddd„ |D ƒ› �ƒ‚)Nr   z max() argument is an empty tuplec                 S   ó0   t |jd ƒ}t ||d ¡}t| |||tjƒS rŠ   )Úlistr4   r   Úunpack_tupler†   r.   Úgt©r1   r2   r3   r4   r„   r#   r#   r&   r'   €  ó   zmax_vararg.<locals>.implúGiven types cannot be unified: c                 S   ó   g | ]}|‘qS r#   r#   r  r#   r#   r&   Ú
<listcomp>Š  ó    zmax_vararg.<locals>.<listcomp>©r‚   r   rw   r   ©r1   rš   r'   rª   r3   r#   r#   r&   r#  {  ó   

r#  c                 C   r.  )Nr   z min() argument is an empty tuplec                 S   r/  rŠ   )r0  r4   r   r1  r†   r.   Últr3  r#   r#   r&   r'   ’  r4  zmin_vararg.<locals>.implr5  c                 S   r6  r#   r#   r  r#   r#   r&   r7  œ  r8  zmin_vararg.<locals>.<listcomp>r9  r:  r#   r#   r&   r,  �  r;  r,  c                 C   s   | |kS r"   r#   rU   r#   r#   r&   rû   ¢  ó    rû   c                 C   s   | |k S r"   r#   rU   r#   r#   r&   rû   £  r=  c                    s    t | tjƒr‡ fdd„}|S d S )Nc                    s,   t | ƒ}t|ƒ}|D ]	}ˆ ||ƒr|}q
|S r"   )ÚiterÚnext)ÚiterableÚitÚ
return_valr%   ©Úopr#   r&   r'   ©  s   
€zmin_max_impl.<locals>.impl)r*   r   ÚIterableType)r@  rD  r'   r#   rC  r&   Úmin_max_impl¦  s   ørF  c                 C   ó
   t | tƒS r"   )rF  Ú	less_than©r@  r#   r#   r&   Úiterable_min³  ó   
rJ  c                 C   rG  r"   )rF  Úgreater_thanrI  r#   r#   r&   Úiterable_max¸  rK  rM  c                 C   sz   |j }dd„ }tj |j¡}t |t |¡|¡}t|ƒdkr*|  	¡ |  
|||¡f}n|  	¡ |  
||d¡f}|  ||||¡S )ae  Redirect constructor implementation to `numba_typeref_ctor(cls, *args)`,
    which should be overloaded by the type's implementation.

    For example:

        d = Dict()

    `d` will be typed as `TypeRef[DictType]()`.  Thus, it will call into this
    implementation.  We need to redirect the lowering to a function
    named ``numba_typeref_ctor``.
    c                 W   s   t | g|¢R Ž S r"   )r   )Úclsr4   r#   r#   r&   Ú	call_ctorÌ  s   z%redirect_type_ctor.<locals>.call_ctorr   r#   )rN   r   ÚTupleÚ
from_typesr4   r   r   ÚTypeRefr‚   rÉ   Ú
make_tupler¡   )r1   r2   r3   r4   rN  rO  Z	ctor_argsr#   r#   r&   Úredirect_type_ctor½  s   ÿÿrT  c                    s¢   d }t |tjƒrd}nt |tjƒrd}nt |tjƒrd}|d ur)dj|Ž }t|ƒ‚t | tjjtj	tj
tjtjfƒr<t‰ nt | tjjƒrFt‰ nd S d‡ fdd„	}|S )	N)ÚstringsÚ )ÚbytesrW   )Ú	bytearrayrW   z/sum() can't sum {} [use {}''.join(seq) instead]r   c                    s   |}ˆ | ƒD ]}|| }q|S r"   r#   )r@  Ústartry   rš   ©Úiteratorr#   r&   r'   ø  s   
zol_sum.<locals>.impl©r   )r*   r   rô   ÚBytesÚ	ByteArrayÚformatr   Ú
containersÚ_HomogeneousTupleÚListrò   rÄ   Ú	RangeTyper>  Ú_HeterogeneousTupler    )r@  rY  Úerrorr<   r'   r#   rZ  r&   Úol_sumÝ  s&   
ÿrf  c                 G   ó   dd„ }|S )Nc                 w   s&   � t |g|¢R Ž D ]}| |Ž V  q	d S r"   )rƒ   )Úfuncr@  r4   rš   r#   r#   r&   r'     s   €ÿzol_map.<locals>.implr#   )rh  r@  r4   r'   r#   r#   r&   Úol_map  s   ri  c                 C   s,   | d u s
t | tjƒrdd„ }|S dd„ }|S )Nc                 s   s   � |D ]}|r
|V  qd S r"   r#   ©rh  r@  rš   r#   r#   r&   r'     s   €€þzol_filter.<locals>.implc                 s   s   � |D ]	}| |ƒr|V  qd S r"   r#   rj  r#   r#   r&   r'     s   €€þrü   )rh  r@  r'   r#   r#   r&   Ú	ol_filter  s
   	ürk  c                 C   s~  dd„ }dd„ }t | ƒ}t|tjƒrd|› d�}t|ƒ‚tjtjtjtjtj	tj
tjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjtjf}t||ƒs[d|› d�}t|ƒ‚|}t|tjƒrh|jd	 }t|tjƒsq|f}|D ]É}t|tjƒr�|jd	 }	nt|tjƒrŠ|}	n|j}	ttjttjttjtj	ft tj
t!tj"t#tji}
|	|
v r´t||
|	 ƒr³|  S qst|tj$ƒrØ|	tjtjtjfvrÊd
}t|ƒ‚t%|ƒ|	u rÔ|  S |  S t |	ƒ}||krä|  S t|tjtjfƒrùt|t%|ƒƒrø|  S qst|tjƒ�rt|tjƒ�r|j|j&jk�r|  S t|tj'ƒ�r<|jd	 tj(k�r<t||j)ƒ�s8t|tj"ƒ�r<t|tj"ƒ�r<|  S qs|S )Nc                 S   rù   )NTr#   ©ÚvarÚtypsr#   r#   r&   Ú	true_impl  r(   z ol_isinstance.<locals>.true_implc                 S   rù   rú   r#   rl  r#   r#   r&   Ú
false_impl"  r(   z!ol_isinstance.<locals>.false_implz1isinstance cannot handle optional types. Found: "ú"z1isinstance() does not support variables of type "z".r   zLNumba type classes (except numba.typed.* container types) are not supported.)*r!   r*   r   r[   r   r  r]  rc  rñ   ÚLiteralStrKeyDictrb  rò   rP  r%  rõ   ÚFunctionÚ	ClassTyperô   ÚClassInstanceTyperZ   rÄ   r+   r®   rð   rµ   Ú
NPDatetimeÚNPTimedeltaró   ÚkeyrW  ÚrangeÚdictr0  Útupler&  rf   rR  rÖ   Úinstance_typeÚ	ContainerÚ	undefinedÚ	__class__)rm  rn  ro  rp  Zvar_tyr<   Zsupported_var_tyZt_typsr`   rx  Ztypes_not_registeredZ	numba_typr#   r#   r&   Úol_isinstance  s†   ù

úÿ
ÿ
ÿ
þ€r€  c                 C   s   d S r"   r#   ©ÚobjÚnamer#   r#   r&   Ú_getattr_raise_attr_exc„  s   r„  c                    s<   t |tjƒs
tdƒ‚|j}d| › d|› d�‰ ‡ fdd„}|S )Nú(argument 'name' must be a literal stringú'z' has no attribute 'c                    s   t ˆ ƒ‚r"   )ÚAttributeErrorr�  ©Úmessager#   r&   r'   ‘  rX   z(ol__getattr_raise_attr_exc.<locals>.impl)r*   r   ÚStringLiteralr   rK   )r‚  rƒ  Úlnamer'   r#   rˆ  r&   Úol__getattr_raise_attr_excŠ  s   rŒ  c                    s$  t |tjƒs
tdƒ‚|j‰|  ˆˆ¡‰t ˆtjƒr)dˆ› dˆ› dˆ› d�}t|ƒ‚ˆd u rht ˆtjƒr8ˆj	t
ksHˆˆ|ˆƒ}‡fdd„}||fS |  t¡‰ˆ | ˆ|fi ¡‰t ˆ|ˆ¡}‡‡fdd„}||fS ˆˆ|ˆƒ}t ˆtjƒr‡‡fd	d„}||fS |  ˆˆ¡‰ ‡ ‡‡‡fd
d„}||fS )Nr…  zQReturning function objects is not implemented. getattr() was requested to return z from attribute 'z' of Ú.c                    s   |d }| j  |ˆ |¡ |S ©Néÿÿÿÿ)ÚnrtÚincref)Úcgctxr2   r3   ÚllargsÚtmp)Údefaultr#   r&   r'   «  s   zresolve_getattr.<locals>.implc                    s   |   ˆ ˆ¡}|||d d… ƒS rŽ  )r-   )r’  r2   r3   r“  Znative_impl)r“   Ú	raise_sigr#   r&   r'   ´  s   c                    s<   ˆ j }|  ||d ˆ|¡}|  |||¡}| j |ˆ |¡ |S rŠ   )ÚthisrD   Úget_bound_functionr�  r‘  )r’  r2   r3   Úll_argsZ	cast_typeÚcastedrP   )r”   r‚  r#   r&   r'   ¼  s
   c                    sD   |   ˆˆ¡}|| |ˆ|d ˆƒ}|  ||ˆ ˆ¡}| j |ˆ|¡ |S rŠ   )r_   rD   r�  r‘  )r’  r2   r3   r™  Z	attr_implrP   rš  )Úattrtyr”   r‹  r‚  r#   r&   r'   Æ  s
   )r*   r   rŠ  r   rK   Úresolve_getattrrs  r   Ú
NamedTupleÚinstance_classÚ_getattr_default_typeÚresolve_value_typer„  Úget_call_typeÚnoneÚBoundFunction)Útyctxr‚  rƒ  r•  r<   r3   r'   r#   )r›  r•  r”   r“   r‹  r‚  r–  r&   rœ  –  s>   ÿþþ
!
åíùrœ  rŸ  rV  )Úprefer_literalc                 C   ó   dd„ }|S )Nc                 S   s   t | |tƒS r"   )rœ  Ú_getattr_defaultr�  r#   r#   r&   r'   Ù  ræ   zol_getattr_2.<locals>.implr#   ©r‚  rƒ  r'   r#   r#   r&   Úol_getattr_2×  ó   r©  c                 C   rg  )Nc                 S   s   t | ||ƒS r"   )rœ  )r‚  rƒ  r•  r#   r#   r&   r'   ä  ræ   zol_getattr_3.<locals>.implr#   )r‚  rƒ  r•  r'   r#   r#   r&   Úol_getattr_3â  rª  r«  c                    sb   t |tjƒs
tdƒ‚|j}|  ||¡‰ ˆ d u rt d¡}nt d¡}|||ƒ}‡ fdd„}||fS )Nr…  FTc                    s   ˆ d u rt jS t jS r"   )r   r9   ré   )r’  r2   r3   r™  ©r”   r#   r&   r'   ú  s   zresolve_hasattr.<locals>.impl)r*   r   rŠ  r   rK   rœ  Úliteral)r¤  r‚  rƒ  r‹  rª   r3   r'   r#   r¬  r&   Úresolve_hasattré  s   

r®  c                 C   r¦  )Nc                 S   s
   t | |ƒS r"   )r®  r�  r#   r#   r&   r'     s   
zol_hasattr.<locals>.implr#   r¨  r#   r#   r&   Ú
ol_hasattr  rª  r¯  c                    s   d| › d�‰ ‡ fdd„}|S )Nz<object type:ú>c                    s"   d}t | |ƒdkrt| |ƒƒ S ˆ S )NÚ__repr__T)ÚhasattrÚgetattr)r‚  rb   ©Zmissing_repr_formatr#   r&   r'     s   zol_repr_generic.<locals>.implr#   )r‚  r'   r#   r´  r&   Úol_repr_generic
  s   rµ  c                 C   s   ddd„}|S )NrV  c                 S   s&   d}t | |ƒdkrt| |ƒƒ S t| ƒS )NÚ__str__T)r²  r³  Úrepr)Úobjectrb   r#   r#   r&   r'     s   zol_str_generic.<locals>.impl©rV  r#   )r¸  r'   r#   r#   r&   Úol_str_generic  s   
rº  r\  r¹  )ªÚcollectionsr   r—   Ú	functoolsr   Únumpyr¿   r.   ÚwarningsÚllvmliter   Únumba.core.imputilsr   r   r   r   r	   r
   r   r   r   r   r   Ú
numba.corer   r   r   r   Únumba.core.extendingr   r   Únumba.core.typeconvr   Únumba.core.errorsr   r   r   r   r   r   Únumba.core.typing.templatesr   r   r   Únumba.misc.specialr    Únumba.core.typing.asnumbatyper!   Útruthr,   Úis_notÚAnyr5   r/   r>   ÚOpaquerC   r+   rH   r7   ÚLiteralÚIntegerLiteralrQ   ÚnerS   r]   ÚDeferredTyperd   r[   rl   rm   ÚgetitemÚCPointerr§   rs   Úsetitemru   r†   r‰   Úroundr®   r•   r¢   r±   r¥   r«   Úintr¯   rŠ  r²   ÚcomplexÚVarArgr½   ÚNumberClassrÆ   ÚDummyrÌ   ÚExternalFunctionPointerrÔ   rØ   rÖ   rÙ   r>  rE  rÛ   r?  ÚIteratorTyperã   rç   r‚   Ú
ConstSizedrè   ÚboolÚSizedrê   r{  rì   r&  rí   rö   rý   Znumba.core.typing.builtinsrþ   rÿ   Znumba.extendingr   r¨   ÚTypeÚuintpr  Úminr  r  Úmaxr  r  r)  r-  r#  r,  rL  rH  rF  rJ  rM  rR  rT  Úsumrf  Úmapri  Úfilterrk  r*   r€  r„  rŒ  rœ  rŸ  r§  r³  r©  r«  r®  r²  r¯  r·  rµ  rÑ   rº  r#   r#   r#   r&   Ú<module>   s,   4 





	"
	





%










	
















	



	







'


g


9






