Ë
    üÇ:jÙ�  ã                   ó–  — d Z ddlZddlZddlZddlmZ ddlmZ ddlZ	ddl
Z
ddlmZmZmZ ddlmZ ddlmZmZmZ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 m!Z! dd	l"m#Z# dd
l$m%Z% ddl&m'Z'm(Z( ddlm)Z)  ed«      Z* G d„ de+«      Z, G d„ de+«      Z- G d„ d edd«      «      Z. G d„ d edd«      «      Z/ G d„ d edd«      «      Z0d-d„Z1 ejd                  ejd                   ejf                  ejd                  «      ejd                   ejf                  ejd                  «      «      Z4d„ Z5d„ Z6d„ Z7d„ Z8d „ Z9d!„ Z:d"„ Z; G d#„ d$e+«      Z<d%„ Z=d&„ Z>	 d.d'„Z?d.d(„Z@e*jƒ                  e
j„                  ej†                  «      d)„ «       ZDd*„ ZE eE ejŒ                  «       e*j‚                  «       e(d+„ «       ZG e'e	j�                  «      d,„ «       ZIy)/z3
Implementation of functions in the Numpy package.
é    N)Ú
namedtuple)ÚarrayobjÚufunc_dbÚnumpy_support)Úparse_signature)ÚRegistryÚimpl_ret_new_refÚforce_error_modelÚimpl_ret_borrowed)ÚtypingÚtypesÚutilsÚcgutilsÚcallconvÚconfig)Úufunc_find_matching_loopÚselect_array_wrapperÚ
from_dtypeÚ_ufunc_loop_sig)Ú_getitem_array_generic)Únpydecl)ÚoverloadÚ	intrinsic)ÚerrorsÚnpyimplc                   ó   — e Zd Zd„ Zd„ Zy)Ú_ScalarIndexingHelperc                  ó   — y ©N© )ÚselfÚloop_indicesÚnames      úe/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/numba/np/npyimpl.pyÚupdate_indicesz$_ScalarIndexingHelper.update_indices-   ó   € Øó    c                  ó   — y r   r    ©r!   s    r$   Ú	as_valuesz_ScalarIndexingHelper.as_values0   r&   r'   N©Ú__name__Ú
__module__Ú__qualname__r%   r*   r    r'   r$   r   r   ,   s   „ òór'   r   c                   ó8   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zed„ «       Z	y)Ú_ScalarHelpera\  Helper class to handle scalar arguments (and result).
    Note that store_data is only used when generating code for
    a scalar ufunc and to write the output value.

    For loading, the value is directly used without having any
    kind of indexing nor memory backing it up. This is the use
    for input arguments.

    For storing, a variable is created in the stack where the
    value will be written.

    Note that it is not supported (as it is unneeded for our
    current use-cases) reading back a stored value. This class
    will always "load" the original value it got at its creation.
    c                 óZ  — || _         || _        || _        || _        |j	                  t
        j                  «      }t        j                  |d«      g| _	        |t
        j                  k7  r|j                  |«      nt        j                  d«      }t        j                  ||«      | _        y ©Né   )ÚcontextÚbuilderÚvalÚ	base_typeÚget_value_typer   ÚintpÚirÚConstantÚshapeÚbooleanÚget_data_typeÚIntTyper   Úalloca_onceÚ_ptr)r!   ÚctxtÚbldr6   ÚtyÚintptyÚltys          r$   Ú__init__z_ScalarHelper.__init__D   s€   € ØˆŒØˆŒØˆŒØˆŒØ×$Ñ$¤U§Z¡ZÓ0ˆÜ—k‘k &¨!Ó,Ð-ˆŒ
à(*¬e¯m©mÒ(;ˆd× Ñ  Ô$ÄÇÁÈAÃˆÜ×'Ñ'¨¨SÓ1ˆ�	r'   c                 ó   — t        «       S r   )r   r)   s    r$   Úcreate_iter_indicesz!_ScalarHelper.create_iter_indicesO   s   € Ü$Ó&Ð&r'   c                 ó   — | j                   S r   )r6   ©r!   Úindicess     r$   Ú	load_dataz_ScalarHelper.load_dataR   s   € Ø�x‰xˆr'   c                 óP   — | j                   j                  || j                  «       y r   )r5   ÚstorerA   )r!   rL   r6   s      r$   Ú
store_dataz_ScalarHelper.store_dataU   s   € Ø�‰×Ñ˜3 §	¡	Õ*r'   c                 óL   — | j                   j                  | j                  «      S r   )r5   ÚloadrA   r)   s    r$   Ú
return_valz_ScalarHelper.return_valX   s   € à�|‰|× Ñ  §¡Ó+Ð+r'   N)
r,   r-   r.   Ú__doc__rG   rI   rM   rP   ÚpropertyrS   r    r'   r$   r0   r0   4   s/   „ ñò	2ò'òò+ð ñ,ó ñ,r'   r0   c                   ó   — e Zd Zd„ Zd„ Zy)Ú_ArrayIndexingHelperc                 óB  — | j                   j                  }| j                   j                  j                  t        j
                  «      }t        j                  t        j                  |j                  «      d«      }|t        |«      t        | j                  «      z
  d  }t        || j                  | j                   j                  «      D ]E  \  }}}	|j                  d|	|«      }
|j                  |
«      5  |j!                  ||«       d d d «       ŒG y # 1 sw Y   ŒRxY w)Nr3   ú>)Úarrayr5   r4   r8   r   r9   r:   r;   r?   ÚwidthÚlenrL   Úzipr<   Úicmp_unsignedÚif_thenrO   )r!   r"   r#   rC   rE   ÚONErL   ÚsrcÚdstÚdimÚconds              r$   r%   z#_ArrayIndexingHelper.update_indices_   sâ   € Ø�j‰j× Ñ ˆØ—‘×#Ñ#×2Ñ2´5·:±:Ó>ˆÜ�k‰kœ"Ÿ*™* V§\¡\Ó2°AÓ6ˆð
 œs <Ó0´3°t·|±|Ó3DÑDÐEÐFˆÜ  ¨$¯,©,¸¿
¹
×8HÑ8HÓIò 	$‰MˆC��cØ×$Ñ$ S¨#¨sÓ3ˆDØ—‘˜TÓ"ñ $Ø—	‘	˜#˜sÔ#÷$ð $ñ	$÷$ð $ús   Ã7DÄD	c                 óŠ   — | j                   j                  }| j                  D �cg c]  }|j                  |«      ‘Œ c}S c c}w )zø
        The indexing helper is built using alloca for each value, so it
        actually contains pointers to the actual indices to load. Note
        that update_indices assumes the same. This method returns the
        indices as values
        )rZ   r5   rL   rR   )r!   rC   Úindexs      r$   r*   z_ArrayIndexingHelper.as_valuesm   s3   € ð �j‰j× Ñ ˆØ-1¯\©\Ö: E�—‘˜•Ò:Ð:ùÒ:s   ¥A Nr+   r    r'   r$   rW   rW   ]   s   „ ò$ó;r'   rW   )rZ   rL   c                   ó(   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zy)Ú_ArrayHelperz­Helper class to handle array arguments/result.
    It provides methods to generate code loading/storing specific
    items as well as support code for handling indices.
    c                 óÞ  — | j                   j                  t        j                  «      }t	        j
                  t	        j                  |j                  «      d«      }g }t        | j                  «      D ]l  }t        j                  | j                  t	        j                  |j                  «      «      }| j                  j                  ||«       |j                  |«       Œn t        | |«      S ©Nr   )r4   r8   r   r9   r:   r;   r?   r[   ÚrangeÚndimr   r@   r5   rO   ÚappendrW   ©r!   rE   ÚZEROrL   ÚiÚxs         r$   rI   z _ArrayHelper.create_iter_indices€   s¦   € Ø—‘×,Ñ,¬U¯Z©ZÓ8ˆÜ�{‰{œ2Ÿ:™: f§l¡lÓ3°QÓ7ˆàˆÜ�t—y‘yÓ!ò 	ˆAÜ×#Ñ# D§L¡L´"·*±*¸V¿\¹\Ó2JÓKˆAØ�L‰L×Ñ˜t QÔ'Ø�N‰N˜1Õð	ô $ D¨'Ó2Ð2r'   c           	      ó²   — t        j                  | j                  | j                  | j                  | j
                  | j                  | j                  |¬«      S ©N)Údatar<   ÚstridesÚlayoutÚinds)r   Úget_item_pointer2r4   r5   rt   r<   ru   rv   rK   s     r$   Ú_load_effective_addressz$_ArrayHelper._load_effective_address‹   sA   € Ü×(Ñ(¨¯©Ø)-¯©Ø.2¯i©iØ/3¯z©zØ15·±Ø04·±Ø.5ô7ð 	7r'   c                 ó¢   — | j                   j                  | j                     }| j                  |«      }|j	                  | j
                  |«      S r   )r4   Údata_model_managerr7   ry   Úload_from_data_pointerr5   )r!   rL   ÚmodelÚptrs       r$   rM   z_ArrayHelper.load_data”   sA   € Ø—‘×/Ñ/°·±Ñ?ˆØ×*Ñ*¨7Ó3ˆØ×+Ñ+¨D¯L©L¸#Ó>Ð>r'   c                 ó  — | j                   }| j                  }|j                  || j                  |«      }|j	                  | j                  «      |j
                  k(  sJ ‚|j                  || j                  |«      «       y r   )r4   r5   Úget_value_as_datar7   r>   ÚtyperO   ry   )r!   rL   ÚvalueÚctxrC   Ústore_values         r$   rP   z_ArrayHelper.store_data™   sh   € Ø�l‰lˆØ�l‰lˆØ×+Ñ+¨C°·±ÀÓGˆØ× Ñ  §¡Ó0°K×4DÑ4DÒDÐDÐDØ�	‰	�+˜t×;Ñ;¸GÓDÕEr'   N)r,   r-   r.   rT   rI   ry   rM   rP   r    r'   r$   rh   rh   x   s   „ ñò	3ò7ò?ó
Fr'   rh   )	r4   r5   r<   ru   rt   rv   r7   rl   rS   c                   ó8   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zdd defd„Z	y	)
Ú_ArrayGUHelperz÷Helper class to handle array arguments/result.
    It provides methods to generate code loading/storing specific
    items as well as support code for handling indices.

    Contrary to _ArrayHelper, this class can create a view to a subarray
    c                 ó  — | j                   j                  t        j                  «      }t	        j
                  t	        j                  |j                  «      d«      }g }t        | j                  | j                  j                  z
  «      D ]l  }t        j                  | j                  t	        j                  |j                  «      «      }| j                  j                  ||«       |j                  |«       Œn t!        | |«      S rj   )r4   r8   r   r9   r:   r;   r?   r[   rk   rl   Úinner_arr_tyr   r@   r5   rO   rm   rW   rn   s         r$   rI   z"_ArrayGUHelper.create_iter_indices«   s·   € Ø—‘×,Ñ,¬U¯Z©ZÓ8ˆÜ�{‰{œ2Ÿ:™: f§l¡lÓ3°QÓ7ˆàˆÜ�t—y‘y 4×#4Ñ#4×#9Ñ#9Ñ9Ó:ò 	ˆAÜ×#Ñ# D§L¡L´"·*±*¸V¿\¹\Ó2JÓKˆAØ�L‰L×Ñ˜t QÔ'Ø�N‰N˜1Õð	ô $ D¨'Ó2Ð2r'   c           	      ój  — | j                   }| j                  }t        j                  | j                  | j
                  | j                  «      } |j                  |«      ||| j                  «      }t        j                  |||j                  | j                  | j                  | j                  |¬«      S rs   )r4   r5   r   ÚArrayr7   rl   rv   Ú
make_arrayrt   r   rx   r<   ru   )r!   rL   r4   r5   Úarr_tyÚarrs         r$   ry   z&_ArrayGUHelper._load_effective_address¶   sˆ   € Ø—,‘,ˆØ—,‘,ˆÜ—‘˜TŸ^™^¨T¯Y©Y¸¿¹ÓDˆØ(ˆg× Ñ  Ó(¨°'¸4¿9¹9ÓEˆä×(Ñ(¨Ø)0Ø.1¯h©hØ/3¯z©zØ15·±Ø04·±Ø.5ô7ð 	7r'   c           	      ó”  — | j                   | j                  }}| j                  j                  dk(  rH| j                  r<|j
                  | j                     }| j                  |«      }|j                  ||«      S | j                  j                  dk(  �r‚| j                  �su|j                  t        j                  «      } |d«      }t        j                  | j                  | j                  | j                  «      }t        j                  | j                  d| j                  «      }	 |t        j                  ||«      «      }
 | j                   j!                  |«      ||| j"                  «      } | j                   j!                  |	«      ||«      }t        j$                  || j                  |«      t'        j(                  ||g«      t'        j(                  ||
g«      |j*                  |j,                  |j.                  ¬«       |j1                  «       S t        j2                  f| j                  | j                  j                  z
  z  }t        j                  | j                  | j                  | j                  «      } | j                   j!                  |«      ||| j"                  «      }t5        ||| j                  ||||«      }|S )Nr   r3   )rt   r<   ru   ÚitemsizeÚmeminfoÚparent)r4   r5   rˆ   rl   Úis_input_argr{   r7   ry   r|   r8   r   r9   rŠ   rv   r   Úget_itemsizer‹   rt   Úpopulate_arrayr   Ú
pack_arrayr�   r�   r‘   Ú	_getvalueÚint64r   )r!   rL   r4   r5   r}   r~   rE   ÚoneÚfromtyÚtotyr�   Úarr_fromÚarr_toÚindex_typesÚarrtyr�   Úress                    r$   rM   z_ArrayGUHelper.load_dataÄ   s5  € ØŸ<™<¨¯©�ˆà×Ñ×!Ñ! QÒ&¨4×+<Ò+<à×.Ñ.¨t¯~©~Ñ>ˆEØ×.Ñ.¨wÓ7ˆCØ×/Ñ/°¸Ó=Ð=Ø×Ñ×#Ñ# qÓ(°×1BÓ1Bð ×+Ñ+¬E¯J©JÓ7ˆFÙ˜“)ˆCä—[‘[ §¡°·±¸D¿K¹KÓHˆFÜ—;‘;˜tŸ~™~¨q°$·+±+Ó>ˆDÙœh×3Ñ3°G¸VÓDÓEˆHð 7�t—|‘|×.Ñ.¨vÓ6°wØ7>Ø7;·y±yóBˆHð 3�T—\‘\×,Ñ,¨TÓ2°7¸GÓDˆFÜ×#Ñ#ØØ×1Ñ1°'Ó:Ü×(Ñ(¨°3°%Ó8Ü×*Ñ*¨7°X°JÓ?Ø!×*Ñ*Ø ×(Ñ(Ø—‘õ(ð ×#Ñ#Ó%Ð%ô !Ÿ;™;˜.¨D¯I©I¸×8IÑ8I×8NÑ8NÑ,NÑOˆKÜ—K‘K §¡°·	±	¸4¿;¹;ÓGˆEØ0�$—,‘,×)Ñ)¨%Ó0°¸'À4Ç9Á9ÓMˆCÜ(¨°'Ø)-×):Ñ):¸EÀ3Ø)4°gó?ˆCð
 ˆJr'   c           	      ó  ‡— | j                   j                  Šˆfd„}| j                  | j                  }}t	        j
                  t	        j                  t        j                  t        |«      «      t	        j                  t        j                  t        | j                  «      «      «      }|j                  ||j                  d   |«      |j                  ||j                  d   | j                  «      f}|j                  ||||«       y )Nc                 ó˜   •— t        |«      ‰z
  }|t        | «      kD  }|st        |«      D ]  }|||   | |   k7  z  }Œ |rt        d«      ‚y )Nz&Loop and array shapes are incompatible©r\   rk   Ú
ValueError)Ú
loop_shapeÚarray_shapeÚ	remainingÚ_raiserp   Ú
inner_ndims        €r$   Ú
raise_implz._ArrayGUHelper.guard_shape.<locals>.raise_impló   sh   ø€ ô
 ˜KÓ(¨:Ñ5ˆIØ¤# j£/Ñ1ˆFÙÜ˜yÓ)ò @�AØ˜{¨1™~°¸A±Ñ>Ñ?‘Fð@áô
 !Ð!IÓJÐJð r'   r   r3   )rˆ   rl   r4   r5   r   ÚnoneÚUniTupler9   r\   r<   Ú
make_tupleÚargsÚcompile_internal)r!   Ú	loopshaper©   r4   r5   ÚsigÚtupr¨   s          @r$   Úguard_shapez_ArrayGUHelper.guard_shapeñ   sÁ   ø€ Ø×&Ñ&×+Ñ+ˆ
ô	Kð"  Ÿ<™<¨¯©�ˆÜ�j‰jÜ�N‰Nœ5Ÿ:™:¤s¨9£~Ó6Ü�N‰Nœ5Ÿ:™:¤s¨4¯:©:£Ó7ó
ˆð ×!Ñ! '¨3¯8©8°A©;¸	ÓBØ×!Ñ! '¨3¯8©8°A©;¸¿
¹
ÓCðEˆà× Ñ  ¨*°c¸3Õ?r'   ÚotherÚndimsc           	      ó  ‡— ˆfd„}| j                   | j                  }}t        j                  t        j                  t        j
                  t        | j                  «      «      t        j                  t        j
                  t        |j                  «      «      «      }|j                  ||j                  d   | j                  «      |j                  ||j                  d   |j                  «      f}|j                  ||||«       y )Nc                 ó¨   •— d}t        | «      ‰z
  t        |«      ‰z
  }}t        ‰«      D ]  }|| ||z      |||z      k(  z  }Œ |sd}t        |«      ‚y )NTzŽOperand has a mismatch in one of its core dimensions. Please, check if all arguments to a @guvectorize function have the same core dimensions.r¢   )Ú
self_shapeÚother_shapeÚsameÚaÚbrp   Úmsgr´   s          €r$   r©   z8_ArrayGUHelper.guard_match_core_dims.<locals>.raise_impl  sv   ø€ ØˆDÜ�z“? UÑ*¬C°Ó,<¸uÑ,DˆqˆAÜ˜5“\ò @�Ø˜
 1 q¡5Ñ)¨[¸¸Q¹Ñ-?Ñ?Ñ?‘ð@áðA�ô ! “oÐ%ð r'   r   r3   )r4   r5   r   rª   r«   r9   r\   r<   r¬   r­   r®   )r!   r³   r´   r©   r4   r5   r°   r±   s     `     r$   Úguard_match_core_dimsz$_ArrayGUHelper.guard_match_core_dims  s¸   ø€ ô	&ð"  Ÿ<™<¨¯©�ˆÜ�j‰jÜ�N‰Nœ5Ÿ:™:¤s¨4¯:©:£Ó7Ü�N‰Nœ5Ÿ:™:¤s¨5¯;©;Ó'7Ó8ó
ˆð ×!Ñ! '¨3¯8©8°A©;¸¿
¹
ÓCØ×!Ñ! '¨3¯8©8°A©;¸¿¹ÓDðGˆà× Ñ  ¨*°c¸3Õ?r'   N)
r,   r-   r.   rT   rI   ry   rM   r²   Úintr½   r    r'   r$   r†   r†   ¡   s4   „ ñò	3ò7ò+òZ@ð8 @Ð+;ð  @ÀCô  @r'   r†   )
r4   r5   r<   ru   rt   rv   r7   rl   rˆ   r’   c                 ó  — t        |t        j                  «      r"|}|j                  }| j	                  ||||«      }t        |t        j
                  «      rª | j                  |«      | ||«      }t        j                  ||j                  |j                  «      }t        j                  ||j                  |j                  «      }t        | ||||j                  |j                  |j                  |j                  |«	      S t        j                   |«      t        j"                  t        j$                  hz  v s$t        |t        j&                  j(                  «      rt+        | |||«      S t-        dj/                  |t1        |«      «      «      ‚)zîreturns an instance of the appropriate Helper (either
    _ScalarHelper or _ArrayHelper) class to handle the argument.
    using the polymorphic interface of the Helper classes, scalar
    and array cases can be handled with the same codezunsupported type for {0}: {1})Ú
isinstancer   ÚOptionalr�   ÚcastÚArrayCompatibler‹   r   Úunpack_tupler<   rl   ru   rh   rt   rv   ÚdtypeÚ	unliteralÚnumber_domainr=   ÚscalarsÚ_NPDatetimeBaser0   ÚNotImplementedErrorÚformatÚstr)	rB   rC   ÚinpÚtyinpÚwhereÚotyÚaryr<   ru   s	            r$   Ú_prepare_argumentrÒ   0  s4  € ô �%œŸ™Ô(ØˆØ—
‘
ˆØ�i‰i˜˜S # uÓ-ˆô �%œ×.Ñ.Ô/Ø(�$—/‘/ %Ó(¨¨s°CÓ8ˆÜ×&Ñ& s¨C¯I©I°u·z±zÓBˆÜ×&Ñ& s¨C¯K©K¸¿¹ÓDˆÜ˜D # u¨g°s·x±xØ!ŸL™L¨%¯+©+°u·z±zÀ3óHð 	Hä
�/‰/˜%Ó
 ¤E×$7Ñ$7¼5¿=¹=¸/Ñ$IÑ
IÜ˜œuŸ}™}×<Ñ<Ô=Ü˜T 3¨¨UÓ3Ð3ä!Ð"A×"HÑ"HÈÜ"% e£*ó#.ó /ð 	/r'   c                 óœ   — | |kD  ryd}|| z
  }|| k  r9||   }||   }|dk7  r||k7  r|dk7  r|dz    S |dk7  r|||<   |dz  }|dz  }|| k  rŒ9|S )a¡  Low-level utility function used in calculating a shape for
    an implicit output array.  This function assumes that the
    destination shape is an LLVM pointer to a C-style array that was
    already initialized to a size of one along all axes.

    Returns an integer value:
    >= 1  :  Succeeded.  Return value should equal the number of dimensions in
             the destination shape.
    0     :  Failed to broadcast because source shape is larger than the
             destination shape (this case should be weeded out at type
             checking).
    < 0   :  Failed to broadcast onto destination axis, at axis number ==
             -(return_value + 1).
    r   r3   r    )Úsrc_ndimÚ	src_shapeÚ	dest_ndimÚ
dest_shapeÚ	src_indexÚ
dest_indexÚsrc_dim_sizeÚdest_dim_sizes           r$   Ú_broadcast_ontorÜ   N  sš   € ð �)Òð àˆ	Ø Ñ)ˆ
Ø˜(Ò"Ø$ YÑ/ˆLØ& zÑ2ˆMð  Ò!ð   =Ò0°\ÀQÒ5FØ'¨!™^Ð,Ð,Ø Ò"à)5�
˜:Ñ&Ø˜‰NˆIØ˜!‰OˆJð ˜(Ó"ð  Ðr'   c                 ó@  ‡ ‡‡ — |D �cg c]*  }t        |t        j                  «      r|j                  n|‘Œ, }}‰ j	                  t        j
                  «      }ˆ fd„} |d«      } |d«      }	t        j                  ‰||j                  d«      }
 ||j                  «      }t        j                  ‰||j                  d«      Š t        ˆˆ fd„t        |j                  «      D «       «      }|D ]  }‰j                  |	|«       Œ t        |«      D �]+  \  }}t        |d«      sŒ ||j                  «      }t        |j                  «      D ]6  }‰j                  |j                  |   t        j                  ‰|
|«      «       Œ8 ‰ j!                  ‰t"        t$        ||
|‰ g«      }t        j&                  ‰‰j)                  d||	«      «      5  d	|fz  }t*        j,                  j/                  d
d«      }|�|d|j0                  |j2                  fz  z  }‰ j4                  j7                  ‰t8        |f«       ddd«       �Œ. |j:                  }t        ˆfd„|D «       «      }t=        j>                  ‰ ‰||«      }tA        |«      }||   }	 ‰ jC                  d |||«      «      }||   jD                  |jG                  «       f} |‰|«      }|j                  }t        jN                  ‰|j                  |«      }t        jN                  ‰|jP                  |«      }tS        ‰ ‰|||jT                  |jV                  |jX                  ||«	      S c c}w # 1 sw Y   �ŒGxY w# tH        $ r; |jJ                  t        jL                  jJ                  k7  r‚ |jG                  «       }Y ŒÔw xY w)zªUtility function to handle allocation of an implicit output array
    given the target context, builder, output array type, and a list of
    _ArrayHelper instances.
    c                 óD   •— ‰j                  t        j                  | «      S r   )Úget_constantr   r9   )r6   r4   s    €r$   Úmake_intp_constz%_build_array.<locals>.make_intp_const€  s   ø€ Ø×#Ñ#¤E§J¡J°Ó4Ð4r'   r   r3   rÕ   r×   c              3   óL   •K  — | ]  }t        j                  ‰‰|«      –— Œ y ­wr   )r   Úgep_inbounds)Ú.0rf   r5   r×   s     €€r$   ú	<genexpr>z_build_array.<locals>.<genexpr>‹  s*   øè ø€ ò @Ø!&ô %×1Ñ1°'¸:Àu×Mñ @ùs   ƒ!$rl   ú<z/unable to broadcast argument %d to output arrayÚlocNz
File "%s", line %d, c              3   ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr   )rR   )rã   Údest_shape_addrr5   s     €r$   rä   z_build_array.<locals>.<genexpr>¬  s$   øè ø€ ò DØ.ð #Ÿ<™<¨×8ñ Dùs   ƒÚ__array_wrap__)-rÀ   r   rÁ   r�   r8   r9   r   r@   rl   Útuplerk   rO   Ú	enumerateÚhasattrr<   râ   r®   rÜ   Ú_broadcast_onto_sigÚif_unlikelyÚicmp_signedr   Úloc_infoÚgetÚfilenameÚlineÚ	call_convÚreturn_user_excr£   Úas_arrayr   Ú_empty_nd_implr   Úget_functionrS   r–   rÊ   Úarray_priorityrŠ   rÄ   ru   rh   rt   rv   rÅ   )!r4   r5   Úarray_tyÚinput_typesÚinputsrq   Úintp_tyrà   ro   r`   rÕ   rÖ   Údest_shape_addrsrè   Ú
arg_numberÚargÚarg_ndimrf   Ú
arg_resultr¼   ræ   Úreal_array_tyÚdest_shape_tupÚ	array_valÚarray_wrapper_indexÚarray_wrapper_tyÚ
array_wrapÚ	wrap_argsÚout_valrl   r<   ru   r×   s!   ``                              @r$   Ú_build_arrayr  v  s“  ú€ ð (ö)Øô (¨¬5¯>©>Ô:�1—6’6ÀÑAð )€Kð )ð ×$Ñ$¤U§Z¡ZÓ0€Gô5ñ ˜1Ó€DÙ
˜!Ó
€Cä×#Ñ# G¨W°h·m±mØ$/ó1€Iá §¡Ó.€IÜ×$Ñ$ W¨g°x·}±}Ø%1ó3€Jäô @Ü*/°·±Ó*>ô@ó @Ðð ,ò ,ˆØ�‰�c˜?Õ+ð,ô % VÓ,ó K‰ˆ
�CÜ�s˜FÔ#ØÙ" 3§8¡8Ó,ˆÜ˜3Ÿ8™8“_ò 	KˆEØ�M‰M˜#Ÿ)™) EÑ*Ü!×.Ñ.¨w¸	À5ÓIõKð	Kð ×-Ñ-Ø”_Ô&9Ø�y )¨ZÐ8ó:ˆ
ô × Ñ  Ø!(×!4Ñ!4°S¸*ÀcÓ!JóLñ 		KàCØðGñ ˆCô —/‘/×%Ñ% e¨TÓ2ˆCØˆØÐ/°3·<±<ÀÇÁÐ2JÑJÑJ�à×Ñ×-Ñ-¨g´zÀCÀ6ÔJ÷		Kñ 		KðKð* ×%Ñ%€Mäó DØ2BôDó D€Nä×'Ñ'¨°¸-Ø(6ó8€Iô /¨{Ó;ÐØ"Ð#6Ñ7Ðð1à×)Ñ)Ð*:Ù*2Ð3CÀ]Ó*SóUˆ
ð Ð/Ñ0×;Ñ;¸Y×=PÑ=PÓ=RÐSˆ	Ù˜W iÓ0ˆà�=‰=€DÜ×"Ñ" 7¨I¯O©O¸TÓB€EÜ×"Ñ" 7¨I×,=Ñ,=¸tÓD€GÜ˜ ¨%°¸)¿.¹.Ø Ÿ™¨¯©¸Øó!ð !ùòS)÷F		Kñ 		Kûô2 ò (ð ×*Ñ*¬e¯k©k×.HÑ.HÒHØØ×%Ñ%Ó'Šð(ús%   ˆ/MÇ
A)MÊM ÍM	ÍANÎNc                 ód   — | j                   dk(  r|j                  gS t        |j                  «      S r2   )ÚnoutÚreturn_typeÚlist)Úufuncr°   s     r$   Ú_unpack_output_typesr  Ë  s)   € Ø‡z�z�Q‚Ø—‘Ð Ð ä�C—O‘OÓ$Ð$r'   c                 óR   — | j                   dk(  r|gS t        j                  ||«      S r2   )r  r   rÄ   )r  r5   Úvaluess      r$   Ú_unpack_output_valuesr  Ò  s'   € Ø‡z�z�Q‚Øˆxˆä×#Ñ# G¨VÓ4Ð4r'   c                 óP   — | j                   dk(  r|d   S |j                  |||«      S )Nr3   r   )r  r¬   )r  r4   r5   Útypr  s        r$   Ú_pack_output_valuesr  Ù  s,   € Ø‡z�z�Q‚Ø�a‰yÐà×!Ñ! '¨3°Ó7Ð7r'   c           
      óØ  — t        ||j                  «      D ��cg c]  \  }}t        | |||«      ‘Œ }}}t        |«      |j                  k  r9t        dj                  |j                  |j                  t        |«      «      «      ‚t        t        ||«      «      D ]Ñ  \  }	}
|j                  |	z   t        |«      k\  rwt        |
t        j                  «      rt        | ||
|j                  |«      }n1t        | |t        j                  | j!                  |
«      d «      |
«      }|j#                  |«       Œ˜| j$                  sŒ¥| j&                  j)                  ||
||j                  |	z      «       ŒÓ |d |j                   }||j                  d  }t        |«      |j*                  k(  sJ ‚t-        |D �cg c]  }|j.                  ‘Œ c}|D �cg c]  }|j.                  ‘Œ c}«      } || ||«      }| j!                  t        j0                  «      }|D �cg c]  }|j3                  «       ‘Œ }}|d   j4                  }|D �cg c]  }t        |t6        «      r|j8                  ‘Œ  }}t        |D �cg c]
  }|dk(  sŒ	|‘Œ c}«      }t        |D �cg c]
  }|dk(  sŒ	|‘Œ c}«      }||kD  rd}nd}t;        j<                  ||||¬«      5 }g }t        t        ||«      «      D ]H  \  }\  }}|j?                  ||«       |j#                  |jA                  |jC                  «       «      «       ŒJ tE        || |jF                  |Ž «      }t        ||«      D ]  \  }}|jI                  ||«       Œ 	 d d d «       tK        || ||jL                  |D � cg c]  } | jN                  ‘Œ c} «      }!tQ        | ||jL                  |!«      S c c}}w c c}w c c}w c c}w c c}w c c}w c c}w # 1 sw Y   ŒvxY wc c} w )Nz+Not enough inputs to {}, expected {} got {}r   ÚCÚF©r9   Úorder))r]   r­   rÒ   r\   ÚninÚRuntimeErrorrË   r,   rë   r  rÀ   r   rÃ   r  r:   r;   r8   rm   Ú
enable_nrtÚnrtÚincrefr  r   r7   r9   rI   r<   rh   rv   r   Ú	loop_nestr%   rM   r*   r  ÚgeneraterP   r  r  rS   r	   )"r4   r5   r°   r­   r  Úkernel_classr   ÚtyargÚ	argumentsÚout_iÚret_tyÚoutputrü   Úoutputsrº   Ú	outer_sigÚkernelrE   rÍ   rL   r¯   Úinput_layoutsrq   Únum_c_layoutÚnum_f_layoutr  r"   Úvals_inrp   rf   Úvals_outÚval_outÚoÚouts"                                     r$   Únumpy_ufunc_kernelr5  à  s“  € ô $' t¨S¯X©XÓ#6÷8Ù�S˜%ô # 7¨G°S¸%Õ@ð 8€Iñ 8ô ˆ9ƒ~˜Ÿ	™	Ò!ÜØ9ß‰V�E—N‘N E§I¡I¬s°9«~Ó>ó@ð 	@ô #Ô#7¸¸sÓ#CÓDò I‰ˆˆvØ�9‰9�uÑ¤ I£Ò.ä˜&¤%×"7Ñ"7Ô8Ü% g¨w¸ÀÇÁÈ)ÓT‘ä*Ø˜WÜ—K‘K × 6Ñ 6°vÓ >ÀÓEÀvóO�ð ×Ñ˜VÕ$Ø×Óà�K‰K×Ñ˜w¨°°U·Y±YÀÑ5FÑ0GÕHðIð �z˜Ÿ	™	Ð"€FØ˜Ÿ	™	˜
Ð#€GÜˆw‹<˜5Ÿ:™:Ò%Ð%Ð%äØ%Ö&˜ˆ�‹Ò&Ø$Ö%˜ˆ�‹Ò%ó€Iñ ˜' 7¨IÓ6€FØ×#Ñ#¤E§J¡JÓ/€Fà4:Ö;¨Sˆs×&Ñ&Õ(Ð;€GÐ;ð ˜‘
× Ñ €Ið ,2ö 7 CÜ" 3¬Ô5ð —Z“Zð 7€Mð 7ä =Ö=˜a°A¸³HšÒ=Ó>€LÜ =Ö=˜a°A¸³HšÒ=Ó>€Lð �lÒ"Ø‰àˆä	×	Ñ	˜7 I°FÀ%Ô	Hð 5ÈLØˆÜ(¬¨W°fÓ)=Ó>ò 	=‰OˆA‰|��sØ× Ñ  ¨qÔ1Ø�N‰N˜3Ÿ=™=¨¯©Ó):Ó;Õ<ð	=ô )¨°¸¸¿¹È'Ð9RÓSˆÜ" 8¨WÓ5ò 	5‰OˆG�VØ×Ñ˜l¨GÕ4ñ	5÷5ô ˜e W¨g°s·±Ð_fÖHgÐZ[ÈÏËÒHgÓ
h€CÜ˜G W¨c¯o©o¸sÓCÐCùóC8ùò6 	'ùÚ%ùò
 <ùò7ùâ=ùÚ=÷5ð 5üò IhsH   šN7Æ0N=Ç	O
ÈOÈ<#OÉ*
OÉ5OÊ	
OÊOËB#OÎO'ÏO$c                 ó  — g }|j                   j                  «       }|d   |d   z   }dg|j                  z  dg|j                  z  z   }t	        ||j
                  ||«      D �]  \  }	}
}}t        |
t        j                  «      rË | j                  |
«      | ||	«      }t        j                  ||j                  |
j                  «      }t        j                  ||j                  |
j                  «      }|
j                  |¬«      }|
j                  }|
j                   }|
j"                  }t%        | ||||	|||||«
      }|j'                  |«       Œît)        | ||	|
«      }|j'                  |«       �Œ  || ||«      }|D �	cg c]  }	t        |	t$        «      r|	j                   ‘Œ  }}	t+        |D �cg c]
  }|dk(  sŒ	|‘Œ c}«      }t+        |D �cg c]
  }|dk(  sŒ	|‘Œ c}«      }||kD  rd}nd}||j                  d  }| j-                  t        j.                  «      }|D �cg c]  }|j1                  «       ‘Œ }}|d   j                  |d   j2                  j                  z
  } |d   j                  d |  }!t5        |j6                  j8                  «      }"t;        j<                  t	        t?        t+        |«      «      |"d   |"d   z   «      d¬	«      D ]U  \  \  }#}$\  }%}&||#   ||%   }(}'|$|&k(  sŒtA        d
„ |'|(fD «       «      sŒ1||#   ||%   }(}'|'jC                  |(t+        |$«      «       ŒW |d |j                   D ]$  }	t        |	t$        «      sŒ|	jE                  |!«       Œ& t        jF                  ||!||¬«      5 })g }*tI        t	        ||«      «      D ]H  \  }+\  },}	|,jK                  |)|+«       |*j'                  |	jM                  |,jO                  «       «      «       ŒJ  |jP                  |*Ž  d d d «       y c c}	w c c}w c c}w c c}w # 1 sw Y   y xY w)Nr   r3   TF)rl   r  r  é   )Úrc              3   ó<   K  — | ]  }t        |t        «      –— Œ y ­wr   )rÀ   r†   )rã   rq   s     r$   rä   z&numpy_gufunc_kernel.<locals>.<genexpr>h  s   è ø€ ÒJ°a”J˜q¤.×1ÑJùs   ‚r  ))ÚdufuncÚexpected_ndimsr  r  r]   r­   rÀ   r   rÃ   r‹   r   rÄ   r<   rl   ru   Úcopyrv   rÅ   r†   rm   r0   r\   r8   r9   rI   rˆ   r   Úgufunc_builderÚ	signatureÚ	itertoolsÚcombinationsrk   Úallr½   r²   r"  rë   r%   rM   r*   r#  )-r4   r5   r°   r­   r  r$  r&  r;  Úis_inputr   rD   Úexp_ndimÚis_inpr�   r<   ru   rˆ   rl   rv   r7   Úarray_helperÚscalar_helperr,  Úlayoutsrq   r.  r/  r  r*  rE   rÍ   rL   Úloopshape_ndimr¯   Ú_sigÚidx_aÚsig_aÚidx_bÚsig_bÚarg_aÚarg_br"   r0  rp   rf   s-                                                r$   Únumpy_gufunc_kernelrP  0  sì  € Ø€IØ!×(Ñ(×7Ñ7Ó9€NØ# AÑ&¨¸Ñ):Ñ:€NØˆv˜Ÿ	™	Ñ! U G¨e¯j©jÑ$8Ñ8€HÜ%(¨¨s¯x©x¸ÈÓ%Ró ,Ñ!ˆˆR�˜6Ü�bœ%×/Ñ/Ô0ð )�'×$Ñ$ RÓ(¨°'¸3Ó?ˆCÜ×(Ñ(¨°#·)±)¸R¿W¹WÓEˆEÜ×*Ñ*¨7°C·K±KÀÇÁÓIˆGØŸ7™7¨˜7Ó1ˆLØ—7‘7ˆDØ—Y‘YˆFØŸ™ˆIÜ)¨'°7Ø*/°¸#Ø*0°)¸TØ*6¸ó@ˆLð ×Ñ˜\Õ*ä)¨'°7¸CÀÓDˆMØ×Ñ˜]Ö+ð%,ñ& ˜' 7¨CÓ0€Fà%.ö 3˜cÜ˜S¤.Ô1ð �z‹zð 3€Gð 3ä 7Ö7˜a¨a°3«hšÒ7Ó8€LÜ 7Ö7˜a¨a°3«hšÒ7Ó8€Lð �lÒ"Ø‰àˆà˜Ÿ	™	˜
Ð#€GØ×#Ñ#¤E§J¡JÓ/€FØ4=Ö>¨Sˆs×&Ñ&Õ(Ð>€GÐ>Ø˜Q‘Z—_‘_ w¨q¡z×'>Ñ'>×'CÑ'CÑC€NØ˜‘
× Ñ Ð"2 NÐ3€Iä˜5×/Ñ/×9Ñ9Ó:€DÜ*3×*@Ñ*@Ü””c˜)“nÓ%Ø�‰G�d˜1‘gÑóàô+ò ;Ñ&‰ˆ�™˜ ð ! Ñ'¨°5Ñ)9ˆuˆØ�E‹>ÜÑJ¸EÀ5¸>ÔJÕJØ$ UÑ+¨Y°uÑ-=�5ˆEØ×'Ñ'¨¬s°5«zÕ:ð;ð ˜˜%Ÿ)™)Ð$ò 'ˆÜ�cœ>Õ*Ø�O‰O˜IÕ&ð'ô 
×	Ñ	˜7Ø$Ø &Ø!&ô
(ð 	"ð ,8ØˆÜ(¬¨W°iÓ)@ÓAò 	=‰OˆA‰|��sØ× Ñ  ¨qÔ1Ø�N‰N˜3Ÿ=™=¨¯©Ó):Ó;Õ<ð	=ð 	ˆ�‰˜Ñ!÷	"ð 	"ùòM3ùâ7ùÚ7ùò ?÷,	"ð 	"ús1   Å?#O/Æ-
O4Æ8O4Ç
O9ÇO9ÈO>Í4A2PÐPc                   ó   — e Zd Zd„ Zd„ Zd„ Zy)Ú_Kernelc                 ó.   — || _         || _        || _        y r   )r4   r5   r+  )r!   r4   r5   r+  s       r$   rG   z_Kernel.__init__~  s   € ØˆŒØˆŒØ"ˆ�r'   c                 óN  — t        |t        j                  «      rdt        |t        j                  «      sJ|j                  }| j                  j                  |d«      } || j                  | j                  ||d«      }|}| j                  j                  | j                  |||«      S )zùNumpy uses cast semantics that are different from standard Python
        (for example, it does allow casting from complex to float).

        This method acts as a patch to context.cast so that it allows
        complex to real/int casts.

        Úreal)rÀ   r   ÚComplexÚunderlying_floatr4   Úget_getattrr5   rÂ   )r!   r6   r™   rš   ÚnewtyÚattrs         r$   rÂ   z_Kernel.castƒ  sƒ   € ô �vœuŸ}™}Ô-Ü˜4¤§¡Ô/ð ×+Ñ+ˆEØ—<‘<×+Ñ+¨F°FÓ;ˆDÙ�t—|‘| T§\¡\°6¸3ÀÓGˆCØˆFð �|‰|× Ñ  §¡¨s°F¸DÓAÐAr'   c           
      óø  — | j                   }| j                  }t        ||j                  |j                  «      D ���cg c]  \  }}}| j	                  |||«      ‘Œ }}}}| j
                  j                  rZ| j                  j                  j                  t        j                  t        j                  gt        |j                  «      z  «      }n:| j                  j                  j                  |j                  |j                  «      }| j                  j                  j                   j"                  }	t%        j&                  |	|| j
                  j(                  j*                  «      }
|
j,                  j/                  d«       | j                  j                  j1                  | j                  |
|j                  |j                  |«      \  }}| j	                  ||j                  |j                  «      S c c}}}w )NÚalwaysinline)Ú	inner_sigr+  r]   r­   rÂ   ÚcresÚ
objectmoder4   rô   Úget_function_typer   Úpyobjectr\   r  r5   ÚblockÚfunctionÚmoduler   Úget_or_insert_functionÚfndescÚllvm_func_nameÚ
attributesÚaddÚcall_function)r!   r­   ÚisigÚosigr6   ÚintyÚouttyÚ	cast_argsÚ	func_typerd  Úentry_pointÚ_rŸ   s                r$   r#  z_Kernel.generate—  s…  € Ø�~‰~ˆØ�~‰~ˆô ˜˜tŸy™y¨$¯)©)Ó4÷6ð 6Ù)˜˜d Eð —Y‘Y˜s D¨%Õ0ð 6ˆ	ò 6ð �9‰9×ÒØŸ™×.Ñ.×@Ñ@Ü—‘¤§¡Ð 0´3°t·y±y³>Ñ AóC‰Ið Ÿ™×.Ñ.×@Ñ@Ø× Ñ  $§)¡)ó-ˆIà—‘×#Ñ#×,Ñ,×3Ñ3ˆÜ×4Ñ4Ø�IØ�I‰I×Ñ×+Ñ+ó-ˆð 	×Ñ×"Ñ" >Ô2à—‘×'Ñ'×5Ñ5Ø�L‰L˜+ t×'7Ñ'7¸¿¹Øó‰ˆˆ3ð �y‰y˜˜d×.Ñ.°×0@Ñ0@ÓAÐAùô%6s   ¾G5N)r,   r-   r.   rG   rÂ   r#  r    r'   r$   rR  rR  }  s   „ ò#ò
Bó(Br'   rR  c                 ó.   ‡ ‡—  G ˆˆ fd„dt         «      Š‰S )a  Use the ufunc loop type information to select the code generation
    function from the table provided by the dict_of_kernels. The dict
    of kernels maps the loop identifier to a function with the
    following signature: (context, builder, signature, args).

    The loop type information has the form 'AB->C'. The letters to the
    left of '->' are the input types (specified as NumPy letter
    types).  The letters to the right of '->' are the output
    types. There must be 'ufunc.nin' letters to the left of '->', and
    'ufunc.nout' letters to the right.

    For example, a binary float loop resulting in a float, will have
    the following signature: 'ff->f'.

    A given ufunc implements many loops. The list of loops implemented
    for a given ufunc can be accessed using the 'types' attribute in
    the ufunc object. The NumPy machinery selects the first loop that
    fits a given calling signature (in our case, what we call the
    outer_sig). This logic is mimicked by 'ufunc_find_matching_loop'.
    c                   ó*   •‡ — e Zd Zˆˆ ˆfd„Zd„ Zˆ xZS )ú'_ufunc_db_function.<locals>._KernelImplc           
      óŽ  •— t         ‰| �  |||«       t        ‰|j                  t	        t        ‰|«      «      z   «      }|j                  ‰«      j                  |j                  «      | _	        t        |j                  |j                  «      | _        | j                  €'d}t        |j                  ‰j                   |«      «      ‚y )Nz2Don't know how to lower ufunc '{0}' for loop '{1}')ÚsuperrG   r   r­   rê   r  Úget_ufunc_inforñ   Ú	ufunc_sigÚfnr   r*  rü   r]  rÊ   rË   r,   )	r!   r4   r5   r+  Úloopr¼   Ú_KernelImplÚ	__class__r  s	         €€€r$   rG   z0_ufunc_db_function.<locals>._KernelImpl.__init__Æ  s    ø€ Ü�+˜tÑ-¨g°wÀ	ÔJÜ+Ø�y—~‘~¬Ô.BÀ5È)Ó.TÓ(UÑUóWˆDà×,Ñ,¨UÓ3×7Ñ7¸¿¹ÓGˆDŒGÜ,¨T¯\©\¸4¿;¹;ÓGˆDŒNà�w‰wˆØJ�Ü)¨#¯*©*°U·^±^ÀTÓ*JÓKÐKð r'   c           
      ó@  — | j                   }| j                  }t        ||j                  |j                  «      D ���cg c]  \  }}}| j	                  |||«      ‘Œ }}}}t        | j                  d«      5  | j                  | j                  | j                  ||«      }d d d «       | j                  j                  }	|	|j                     j                  | j                  «      }| j	                  ||j                  |j                  «      S c c}}}w # 1 sw Y   ŒvxY w)NÚnumpy)r]  r+  r]   r­   rÂ   r
   r4   rz  r5   r{   r  Úfrom_return)
r!   r­   rk  rl  r6   rm  rn  ro  rŸ   Údmms
             r$   r#  z0_ufunc_db_function.<locals>._KernelImpl.generateÑ  sþ   € Ø—>‘>ˆDØ—>‘>ˆDô 25°T¸4¿9¹9Ø59·Y±Yó2@÷Að AÙ-˜S $¨ð Ÿ™ 3¨¨eÕ4ð AˆIò Aô # 4§<¡<°Ó9ñ KØ—g‘g˜dŸl™l¨D¯L©L¸$À	ÓJ�÷Kà—,‘,×1Ñ1ˆCØ�d×&Ñ&Ñ'×3Ñ3°D·L±LÀ#ÓFˆCØ—9‘9˜S $×"2Ñ"2°D×4DÑ4DÓEÐEùôA÷Kð Kús   ¾DÁ6)DÄD)r,   r-   r.   rG   r#  Ú__classcell__)r}  r|  r  s   @€€r$   r|  ru  Å  s   ù„ ö		Lö	Fr'   r|  )rR  )r  r|  s   `@r$   Ú_ufunc_db_functionrƒ  ¯  s   ù€ ÷,F”gô Fð2 Ðr'   c                 óÚ   ‡ ‡— ˆˆ fd„}t         j                  }|f‰ j                  z  }t        ‰ j                  dz   «      D ]'  }t         j
                  f|z  }  |‰ g|¢|¢­Ž |«       Œ) ‰S )Nc                 ó$   •— t        | |||‰‰«      S r   ©r5  ©r4   r5   r°   r­   r,  r  s       €€r$   Údo_ufuncz'register_ufunc_kernel.<locals>.do_ufuncå  ó   ø€ Ü! '¨7°C¸¸uÀfÓMÐMr'   r3   )r   ÚAnyr  rk   r  rŠ   )r  r,  Úlowerrˆ  Ú_anyÚin_argsÚn_explicit_outÚout_argss   ``      r$   Úregister_ufunc_kernelr�  ä  sr   ù€ õNô �9‰9€DØˆg˜Ÿ	™	Ñ!€Gô   §
¡
¨Q¡Ó/ò 4ˆÜ—K‘K�> NÑ2ˆØ)‰ˆeÐ)�gÐ) Ò)¨(Õ3ð4ð €Mr'   c                 óZ   ‡‡— |rJ ‚ˆˆfd„}t         j                  }  || |«      |«       y )Nc                 ó$   •— t        | |||‰‰«      S r   r†  r‡  s       €€r$   Úlower_unary_operatorz<register_unary_operator_kernel.<locals>.lower_unary_operatorö  r‰  r'   )r   rŠ   )Úoperatorr  r,  r‹  Úinplacer“  Ú	_arr_kinds    ``    r$   Úregister_unary_operator_kernelr—  ó  s,   ù€ áÐˆ;õNä—‘€IØ�Eˆ(�IÓÐ3Õ4r'   c                 óÆ   ‡‡— ˆˆfd„}ˆˆfd„}t         j                  }t         j                  }||f||f||fg}	|	D ]#  }
|s  || g|
¢­Ž |«       Œ  || g|
¢­Ž |«       Œ% y )Nc                 ó$   •— t        | |||‰‰«      S r   r†  r‡  s       €€r$   Úlower_binary_operatorz>register_binary_operator_kernel.<locals>.lower_binary_operatorý  r‰  r'   c                 ó¾   •— t        |«      |d   fz   }t        j                  |j                  g|j                  |j                  d   fz   ¢­Ž }t        | |||‰‰«      S rj   )rê   r   r>  r  r­   r5  r‡  s       €€r$   Úlower_inplace_operatorz?register_binary_operator_kernel.<locals>.lower_inplace_operator   sZ   ø€ ô �T‹{˜d 1™g˜ZÑ'ˆÜ×Ñ˜sŸ™ÐK°·±¸S¿X¹XÀa¹[¸NÑ1JÒKˆÜ! '¨7°C¸¸uÀfÓMÐMr'   )r   rŠ  rŠ   )Úopr  r,  r‹  r•  rš  rœ  rŒ  r–  Úformal_sigsr°   s    ``        r$   Úregister_binary_operator_kernelrŸ  ü  sv   ù€ õNõNô �9‰9€DÜ—‘€IØ˜yÐ)¨D°)Ð+<¸yÈ$Ð>OÐP€KØò 4ˆÙØ‰E�"ˆO�sŠOÐ1Õ2à‰E�"ˆO�sŠOÐ2Õ3ñ	4r'   c                 ó\   —  G d„ dt         «      }t        | |||t        j                  |«      S )z¸Lowering function for +(array) expressions.  Defined here
    (numba.targets.npyimpl) since the remaining array-operator
    lowering functions are also registered in this module.
    c                   ó   — e Zd Zd„ Zy)ú1array_positive_impl.<locals>._UnaryPositiveKernelc                 ó   — |\  }|S r   r    )r!   r­   r6   s      r$   r#  z:array_positive_impl.<locals>._UnaryPositiveKernel.generate  s   € Ø‰EˆSØˆJr'   N)r,   r-   r.   r#  r    r'   r$   Ú_UnaryPositiveKernelr¢    s   „ ó	r'   r¤  )rR  r5  ÚnpÚpositive)r4   r5   r°   r­   r¤  s        r$   Úarray_positive_implr§    s.   € ôœwô ô
 ˜g w°°T¼2¿;¹;Ø2ó4ð 4r'   c           	      óÒ  — i }| D ]  }t        |«      }t        |||«      ||<   Œ t        j                  j                  t        j
                  j                  fD ]u  }|j                  «       D ]`  \  }}t        t        |«      }||   }|j                  dk(  rt        ||||«       Œ9|j                  dk(  rt        ||||«       ŒWt        d«      ‚ Œw t        j                  j                  fD ]y  }|j                  «       D ]d  \  }}t        t        |«      }||   }|j                  dk(  rt        ||||d¬«       Œ;|j                  dk(  rt        ||||d¬«       Œ[t        d«      ‚ Œ{ y )Nr3   r7  z4There shouldn't be any non-unary or binary operatorsT)r•  )rƒ  r�  r   ÚNumpyRulesUnaryArrayOperatorÚ_op_mapÚNumpyRulesArrayOperatorÚitemsÚgetattrr¥  r  r—  rŸ  r  ÚNumpyRulesInplaceArrayOperator)	Úufuncsr‹  Úkernelsr  Údb_funcrª  r”  Ú
ufunc_namer,  s	            r$   Úregister_ufuncsr³  $  sw  € Ø€GØò FˆÜ$ UÓ+ˆÜ.¨u°g¸uÓEˆ�ŠðFô ×8Ñ8×@Ñ@Ü×3Ñ3×;Ñ;ðò [ˆð %,§M¡M£Oò 	[Ñ ˆH�jÜœB 
Ó+ˆEØ˜U‘^ˆFØ�y‰y˜AŠ~Ü.¨x¸ÀÈÕNØ—‘˜a’Ü/°¸%ÀÈÕOä"Ð#YÓZÐZñ	[ð[ô ×:Ñ:×BÑBð ò [ˆà$+§M¡M£Oò 
	[Ñ ˆH�jÜœB 
Ó+ˆEØ˜U‘^ˆFØ�y‰y˜AŠ~Ü.¨x¸ÀÈØ7;ö=à—‘˜a’Ü/°¸%ÀÈØ8<ö>ô #Ð#YÓZÐZñ
	[ñ[r'   c                 ób  ‡— ˆfd„}t        ‰t        j                  «      r0t        t	        j
                  ‰j                  «      «      } ||«      S t        ‰t        j                  j                  «      r;t        ‰j
                  «      }t        t	        j
                  |«      «      } ||«      S y)zPGiven a string or NumberClass description *desc*, returns the dtype object.
    c                 óL   •— t        j                  | «      } |‰«      }d„ }||fS )Nc                 ó"   — | j                  «       S r   )Úget_dummy_value)r4   r5   r>  r­   s       r$   Úcodegenz9_make_dtype_object.<locals>.from_nb_type.<locals>.codegenQ  s   € ð ×*Ñ*Ó,Ð,r'   )r   ÚDType)Únb_typer  r°   r¸  Údescs       €r$   Úfrom_nb_typez(_make_dtype_object.<locals>.from_nb_typeM  s,   ø€ Ü—k‘k 'Ó*ˆÙ˜$Óˆò	-ð
 �Gˆ|Ðr'   N)
rÀ   r   ÚLiteralr   r¥  rÅ   Úliteral_valueÚ	functionsÚNumberClassrÌ   )Ú	typingctxr»  r¼  rº  Úthestrs    `   r$   Ú_make_dtype_objectrÃ  I  s€   ø€ ô	ô �$œŸ™Ô&äœRŸX™X d×&8Ñ&8Ó9Ó:ˆÙ˜GÓ$Ð$Ü	�Dœ%Ÿ/™/×5Ñ5Ô	6Ü�T—Z‘Z“ˆäœRŸX™X fÓ-Ó.ˆÙ˜GÓ$Ð$ð	 
7r'   c                 ó¼   — t        | t        j                  t        j                  j                  f«      rd„ }|S t        j                  dj                  | «      «      ‚)zKProvide an implementation so that numpy.dtype function can be lowered.
    c                 ó   — t        | «      S r   )rÃ  )rÅ   s    r$   Úimpznumpy_dtype.<locals>.impg  s   € Ü% eÓ,Ð,r'   zunknown dtype descriptor: {})rÀ   r   r½  r¿  rÀ  r   ÚNumbaTypeErrorrË   )rÅ   rÆ  s     r$   Únumpy_dtyperÈ  b  sL   € ô �%œ%Ÿ-™-¬¯©×)DÑ)DÐEÔFò	-àˆ
ä×#Ñ#Ø*×1Ñ1°%Ó8ó:ð 	:r'   )zinput operand)F)JrT   ÚmathÚsysr?  Úcollectionsr   Úllvmlite.irr:   r  r¥  r”  Únumba.npr   r   r   Únumba.np.ufunc.sigparser   Únumba.core.imputilsr   r	   r
   r   Ú
numba.corer   r   r   r   r   r   Únumba.np.numpy_supportr   r   r   r   Únumba.np.arrayobjr   Únumba.core.typingr   Únumba.core.extendingr   r   r   ÚregistryÚobjectr   r0   rW   rh   r†   rÒ   r9   ÚCPointerrí   rÜ   r  r  r  r  r5  rP  rR  rƒ  r�  r—  rŸ  r‹  ÚposrŠ   r§  r³  Ú
get_ufuncsrÃ  rÅ   rÈ  r    r'   r$   ú<module>rÚ     sÙ  ðñó
 Û 
Û Ý "å ã Û ç 6Ñ 6Ý 3ß bÓ bß F× F÷ó õ 5Ý %ß 4å á�IÓ€ô˜Fô ô&,�Fô &,ôR;™:Ð&<Ø&:ó<ô ;ô6&F‘:˜nð /=ó >ô &FôRL@‘Z ð 1Qó Rô L@ó^/ð6 !�e—j‘j §¡¨^¨U¯^©^¸E¿J¹JÓ-GØ %§
¡
¨N¨E¯N©N¸5¿:¹:Ó,FóHÐ ò&òPQ!òj%ò5ò8òMDò`I"ôZ/Bˆfô /Bòd/òjð  ,1ó5ó4ð2 
‡��—‘˜eŸk™kÓ*ñ4ó +ð4ò[ñD Ð#�×#Ñ#Ó% x§~¡~Ô 6ð ñ%ó ð%ñ0 
ˆ"�(‰(Óñ	:ó ñ	:r'   