
    shQ                          S r SSKJr  SSKrSSKJrJr  SSKJrJ	r	  SSS.S jr
S	 r " S
 S\5      r " S S\5      r " S S\5      rg)z
Function descriptors.
    )defaultdictN)typesitanium_mangler)_dynamic_modname_dynamic_module abi_tagsuidc                ,    [         R                  " XX#S9$ )Nr	   )r   mangle)nameargtypesr
   r   s       g/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/core/funcdesc.pydefault_manglerr      s    !!$8MM    c                 6    U (       a  SR                  X5      $ U$ )zK
Returns a new string that is used for the first half of the mangled name.
z{}.{})format)modnamequalnames     r   qualifying_prefixr      s    
 187>>',EXEr   c                       \ rS rSrSrSr   SS jrS rS rS r	\
S	 5       r\
S
 5       r\
S 5       rS r\S 5       r\  SS j5       rSrg)FunctionDescriptor   a
  
Base class for function descriptors: an object used to carry
useful metadata about a natively callable function.

Note that while `FunctionIdentity` denotes a Python function
which is being concretely compiled by Numba, `FunctionDescriptor`
may be more "abstract".
)nativer   r   doctypemap	calltypesargskwsrestyper   mangled_nameunique_nameenv_nameglobal_dictinlinenoaliasr
   r   Nc                 8  ^  UT l         UT l        UT l        UT l        UT l        UT l        UT l        UT l        U	T l        U
T l	        UT l
        Ub$  [        U[        5      (       d   U5       eUT l        O[        U 4S jU	 5       5      T l        Uc  [        OUn[        T R                  T R                  5      nUT l        U" UT R                  UUS9T l        Uc"  U" SR%                  U5      T R                  UUS9nUT l        UT l        UT l        UT l        g )Nc              3   H   >#    U  H  nTR                   S U-      v   M     g7f)zarg.N)r   ).0aselfs     r   	<genexpr>.FunctionDescriptor.__init__.<locals>.<genexpr>>   s     !IDq$,,vz":Ds   "r	   z.NumbaEnv.{})r   r   r%   r   r#   r   r   r   r   r    r!   
isinstancetupler   r   r   r   r"   r   r$   r&   r'   r
   )r,   r   r   r   r#   r   r   r!   r   r   r    manglerr   r&   r'   r$   r%   r
   r   
qualprefixs   `                   r   __init__FunctionDescriptor.__init__&   s    & & "	h..88.$DM "!ID!IIDM%,_/' 't||T]]C
#c
 ~44Z@#}}xSJH  r   c                 \    U R                   =(       d    U R                  5       R                  $ )z
Return the global dictionary of the function.
It may not match the Module's globals if the function is created
dynamically (i.e. exec)
)r%   lookup_module__dict__r,   s    r   lookup_globals!FunctionDescriptor.lookup_globalsO   s$     @4#5#5#7#@#@@r   c                     U R                   [        :X  a  [        $  [        R                  " U R                   5      $ ! [
         a	    [        s $ f = f)z
Return the module in which this function is supposed to exist.
This may be a dummy module if the function was dynamically
generated or the module can't be found.
)r   r   r   	importlibimport_moduleImportErrorr8   s    r   r6    FunctionDescriptor.lookup_moduleW   sF     <<++""' ..t||<< '&&'s   < AAc                 J    [        U R                  5       U R                  5      $ )z?
Return the original function object described by this object.
)getattrr6   r   r8   s    r   lookup_function"FunctionDescriptor.lookup_functionf   s     t))+T]];;r   c                     U R                   $ )z0
The LLVM-registered name for the raw function.
r"   r8   s    r   llvm_func_name!FunctionDescriptor.llvm_func_namel   s    
    r   c                 @    [         R                  " U R                  SS9$ )zq
The LLVM-registered name for a CPython-compatible wrapper of the
raw function (i.e. a PyCFunctionWithKeywords).
cpython)ns)r   prepend_namespacer"   r8   s    r   llvm_cpython_wrapper_name,FunctionDescriptor.llvm_cpython_wrapper_nameu   s"     001B1B4=? 	?r   c                      SU R                   -   $ )zJ
The LLVM-registered name for a C-compatible wrapper of the
raw function.
zcfunc.rE   r8   s    r   llvm_cfunc_wrapper_name*FunctionDescriptor.llvm_cfunc_wrapper_name~   s     $++++r   c                      SU R                   -  $ )Nz<function descriptor %r>)r#   r8   s    r   __repr__FunctionDescriptor.__repr__   s    )T-=-=>>r   c                 X   UR                   R                  nUR                   R                  nUR                  nUR                  =(       d    Sn[        UR                  5      nSnSnUc&  [        nUR                   R                  R                  nUR                   R                  n	X9XEXgU4$ )zq
Returns
-------
qualname, unique_name, modname, doc, args, kws, globals

``unique_name`` must be a unique name.
 r   N)
func_idfuncfunc_qualname
__module____doc__r0   	arg_namesr   __globals__r#   )
clsfunc_irrW   r   r   r   r   r    r%   r#   s
             r   _get_function_info%FunctionDescriptor._get_function_info   s     ##??00//ll bW&&'?&G "//..::Koo11gD{JJr   c
                 z    U R                  U5      u  pppnU " X\XUX#UXXgUUU	UR                  R                  S9nU$ )N)r1   r&   r'   r%   r
   r   )r_   rV   	unique_id)r]   r^   r   r!   r   r   r1   r&   r'   r
   r   r#   r   r   r   r    r%   r,   s                     r   _from_python_function(FunctionDescriptor._from_python_function   sV    
 ##G,	d 6H3Ygg*X00	2
 r   )r
   r   r   r   r   r$   r%   r&   r    r"   r   r   r'   r   r!   r   r   r#   )NNFFNNr   N)NFFr   )__name__rY   __qualname____firstlineno__rZ   	__slots__r3   r9   r6   rB   propertyrF   rL   rO   rR   classmethodr_   rc   __static_attributes__r   r   r   r   r      s    9I BFFJ48'!RA'< ! ! ? ? , ,? K K8 9=DF r   r   c                   <    \ rS rSrSrSr\S 5       r\S 5       rSr	g)PythonFunctionDescriptor   z=
A FunctionDescriptor subclass for Numba-compiled functions.
r   c	                 *    U R                  XX4SUXgUS9	$ )z`
Build a FunctionDescriptor for a given specialization of a Python
function (in nopython mode).
T)r   r1   r&   r'   r
   )rc   )	r]   r^   r   r!   r   r1   r&   r'   r
   s	            r   from_specialized_function2PythonFunctionDescriptor.from_specialized_function   s+     ((704g062: ) < 	<r   c                 |    [        S 5      nUR                  5       n[        R                  nU R	                  XXCSS9$ )zM
Build a FunctionDescriptor for an object mode variant of a Python
function.
c                  "    [         R                  $ N)r   pyobjectr   r   r   <lambda>DPythonFunctionDescriptor.from_object_mode_function.<locals>.<lambda>   s    ennr   F)r   )r   copyr   ru   rc   )r]   r^   r   r   r!   s        r   from_object_mode_function2PythonFunctionDescriptor.from_object_mode_function   sB     45LLN	..((705 ) 7 	7r   N)
re   rY   rf   rg   rZ   rh   rj   rp   ry   rk   r   r   r   rm   rm      s4     I	< 	< 	7 	7r   rm   c                   0   ^  \ rS rSrSrSrU 4S jrSrU =r$ )ExternalFunctionDescriptor   zU
A FunctionDescriptor subclass for opaque external functions
(e.g. raw C functions).
r   c                    > [        [        U5      5       Vs/ s H  nSU-  PM
     nnSS jn[        [        U ]  SS UUSS US US UUS9  g s  snf )Nzarg%dc                     U $ rt   r   )r+   xr
   r   s       r   r1   4ExternalFunctionDescriptor.__init__.<locals>.mangler   s    Hr   TrU   )r   r   r   r#   r   r   r!   r   r   r    r1   r   rt   )rangelensuperr|   r3   )r,   r   r!   r   ir   r1   	__class__s          r   r3   #ExternalFunctionDescriptor.__init__   se    %*3x=%9:%9!%9:	($ 	 $dT%)r4!(Dt!!("*  , ;s   A)	re   rY   rf   rg   rZ   rh   r3   rk   __classcell__)r   s   @r   r|   r|      s     I, ,r   r|   )rZ   collectionsr   r<   
numba.corer   r   numba.core.utilsr   r   r   r   objectr   rm   r|   r   r   r   <module>r      sT    $  - > 13 NFZ Zz71 7>,!3 ,r   