
    J/Ph                         d dl Z d dlZd dl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mZ d dlmZmZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZ d d	lmZmZ d d
lmZ d dl m!Z!m"Z" d dlm#Z# d dl$m%c m&Z'  G d de(          Z) G d de(          Z* G d de*          Z+ e j,        dd          Z- G d de(          Z. G d dej/                  Z0 G d d          Z1 G d dej2        e1e0          Z/ G d dej2        e1e0          Z3 G d d e3          Z4 G d! d"e3          Z5 G d# d$e5          Z6ej7        r+ ej8        e) e9d% ej:        D                                  dS  ej8        e) e9d& ej;        D                                  dS )'    N)	ExitStack)abstractmethod)_dispatcher)utilstypeserrorstyping	serializeconfigcompilersigutils)global_compiler_lock)default_type_manager)fold_arguments)Purposetypeof)get_code_object)	NullCacheFunctionCache)entrypointsc                   4    e Zd ZdZd Zd Zed             ZdS )
OmittedArgzC
    A placeholder for omitted arguments with a default value.
    c                     || _         d S Nvalue)selfr   s     U/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/core/dispatcher.py__init__zOmittedArg.__init__    s    


    c                     d| j         dS )Nzomitted arg()r   r   s    r   __repr__zOmittedArg.__repr__#   s     $(JJJ00r    c                 4    t          j        | j                  S r   )r   Omittedr   r#   s    r   _numba_type_zOmittedArg._numba_type_&   s    }TZ(((r    N)__name__
__module____qualname____doc__r   r$   propertyr'    r    r   r   r      sW           1 1 1 ) ) X) ) )r    r   c                   >    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	S )
_FunctionCompilerc                     || _         || _        || _        || _        t	          j        | j                   | _        || _        i | _        d S r   )	py_functargetdescrtargetoptionslocalsr   pysignaturepysigpipeline_class_failed_cache)r   r1   r2   r3   r4   r7   s         r   r   z_FunctionCompiler.__init__,   sL    &*&t|44
,  r    c                 X    d }d }d }t          | j        |||||          }| j        |fS )z
        Given positional and named argument types, fold keyword arguments
        and resolve defaults by inserting types.Omitted() instances.

        A (pysig, argument types) tuple is returned.
        c                     |S r   r-   )indexparamr   s      r   normal_handlerz=_FunctionCompiler.fold_argument_types.<locals>.normal_handler@   s    Lr    c                 *    t          j        |          S r   )r   r&   )r;   r<   defaults      r   default_handlerz>_FunctionCompiler.fold_argument_types.<locals>.default_handlerC   s    =)))r    c                 *    t          j        |          S r   )r   StarArgTuple)r;   r<   valuess      r   stararg_handlerz>_FunctionCompiler.fold_argument_types.<locals>.stararg_handlerF   s    %f---r    )r   r6   )r   argskwsr=   r@   rD   s         r   fold_argument_typesz%_FunctionCompiler.fold_argument_types9   s`    	 	 		* 	* 	*	. 	. 	. dj$,--/ / z4r    c                 @    |                      ||          \  }}|r|S |r   )_compile_cached)r   rE   return_typestatusretvals        r   compilez_FunctionCompiler.compileO   s-    --dK@@ 	MLr    c                     t          |          |f}	 d| j        |         fS # t          $ r Y nw xY w	 |                     ||          }d|fS # t          j        $ r}|| j        |<   d|fcY d }~S d }~ww xY w)NFT)tupler8   KeyError_compile_corer   TypingError)r   rE   rJ   keyrL   es         r   rI   z!_FunctionCompiler._compile_cachedV   s    Dkk;&	$,S111 	 	 	D		 ''k::F
 <	 ! 	 	 	&'Ds#!8OOOOOO	s)   " 
//A A4A/)A4/A4c           
      j   t          j                    }| j        j                            || j                   |                     |          }|                     |i           }t          j        | j        j	        | j        j
        ||||| j        | j                  }|j        |j        s|j        |S )N)rE   rJ   flagsr4   r7   )r   Flagsr2   optionsparse_as_flagsr3   _customize_flags_get_implementationcompile_extratyping_contexttarget_contextr4   r7   typing_errorenable_pyobject)r   rE   rJ   rV   implcress         r   rQ   z_FunctionCompiler._compile_coree   s       //t7IJJJ%%e,,''b11%d&6&E&*&6&E&*+/[,1$+595HJ J J (1F(##r    c                 4    t          j        | j                  S r   r
   #_get_function_globals_for_reductionr1   r#   s    r   get_globals_for_reductionz+_FunctionCompiler.get_globals_for_reductionv   s    <T\JJJr    c                     | j         S r   )r1   r   rE   rF   s      r   r[   z%_FunctionCompiler._get_implementationy   s
    |r    c                     |S r   r-   )r   rV   s     r   rZ   z"_FunctionCompiler._customize_flags|   s    r    N)r(   r)   r*   r   rG   rM   rI   rQ   rf   r[   rZ   r-   r    r   r/   r/   +   s                  ,         "K K K      r    r/   c                   *     e Zd Z fdZd Zd Z xZS )_GeneratedFunctionCompilerc                     t          t          |                               |||||           t                      | _        d S r   )superrk   r   setimpls)r   r1   r2   r3   r4   r7   	__class__s         r   r   z#_GeneratedFunctionCompiler.__init__   sC    ($//88[-	I 	I 	IUU


r    c                 4    t          j        | j                  S r   rd   r#   s    r   rf   z4_GeneratedFunctionCompiler.get_globals_for_reduction   s     <T\JJJr    c           	      D    | j         |i |}t          j        | j                   }t          j        |          }t          |j                  t          |j                  k    }|rt          |j                                        |j                                                  D ]E\  }}|j        |j        k    s.|j        |j        k    s|j	        |j
        ur|j	        |j	        k    rd}F|st          d|d|d|d          | j                            |           |S )NFzgenerated implementation z& should be compatible with signature 'z', but has signature '')r1   r   r5   len
parametersziprC   namekindr?   empty	TypeErrorro   add)	r   rE   rF   ra   r6   implsigokpyparam	implparams	            r   r[   z._GeneratedFunctionCompiler._get_implementation   s<   t|T)S)) !$,//#D))!""c'*<&=&== 		&)%*:*A*A*C*C*1*<*C*C*E*E'G 'G  " LIN22LIN22&io==&'/99B 	6)#ttUUUGGG5 6 6 6 	
tr    )r(   r)   r*   r   rf   r[   __classcell__rp   s   @r   rk   rk      sY            K K K
      r    rk   _CompileStats
cache_path
cache_hitscache_missesc                   .    e Zd ZdZd Zd Zd Zd ZeZdS )CompilingCounterzQ
    A simple counter that increment in __enter__ and decrement in __exit__.
    c                     d| _         d S Nr   counterr#   s    r   r   zCompilingCounter.__init__   s    r    c                 @    | j         dk    sJ | xj         dz  c_         d S )Nr      r   r#   s    r   	__enter__zCompilingCounter.__enter__   s)    |q    r    c                 @    | xj         dz  c_         | j         dk    sJ d S )Nr   r   r   )r   rE   kwargss      r   __exit__zCompilingCounter.__exit__   s+    |q      r    c                     | j         dk    S r   r   r#   s    r   __bool__zCompilingCounter.__bool__   s    |ar    N)	r(   r)   r*   r+   r   r   r   r   __nonzero__r-   r    r   r   r      s[             ! ! !      KKKr    r   c                       e Zd ZdZdZd Zd Zd Zd Ze	d             Z
e	d             Zd"d
Zd Zd Zd Zd Ze	d             Zd Zd#dZd#dZ	 	 d$dZd%dZd#dZd#dZd Zd Zd Zd Zd Zd Zd  Zd! Z dS )&_DispatcherBasez;
    Common base class for dispatcher Implementations.
    r1   c                 >   t           | _        t          j                    | _        || _        t          |          | _        | j        | _        t                      | _
        |j        | _        t          |j                  }| j        j        pd}t          d |D                       }	 t          |j                                                  d         }	|	j        |	j        k    }
n# t$          $ r d}
Y nw xY wt&          j                            | | j                                        || j        ||||
|	  	         |j        | _        t5                      | _        t9          t:          j                  | _        tA          j!        | | "                                           d S )Nr-   c              3   4   K   | ]}t          |          V  d S r   )r   ).0vals     r   	<genexpr>z+_DispatcherBase.__init__.<locals>.<genexpr>   s(      BBC
3BBBBBBr    F)#r   _tmcollectionsOrderedDict	overloadsr1   r   	func_code__code__rn   _types_active_call__defaults__rO   ru   listrC   rx   VAR_POSITIONAL
IndexErrorr   
Dispatcherr   get_pointer
_fold_argsr+   docr   _compiling_counterboolr   ENABLE_SYS_MONITORING_enable_sysmonweakreffinalize_make_finalizer)r   	arg_countr1   r6   can_fallbackexact_match_requiredargnamesdefault_valuesdefargslastarghas_starargs              r   r   z_DispatcherBase.__init__   s   ' %022(11"%%%#0)**28bBB>BBBBB	A5+224455b9G ",'*@@KK  	  	  	 KKK	  	''dh.B.B.D.D(14?(0'(4(3(<	> 	> 	> ?"2"4"4"6#?@@t335566666s   ',C$ $C32C3c                 ,    t          j                     dS )ae  
        This will be called ahead of any part of compilation taking place (this
        even includes being ahead of working out the types of the arguments).
        This permits activities such as initialising extension entry points so
        that the compiler knows about additional externally defined types etc
        before it does anything.
        N)r   init_allr#   s    r   _compilation_chain_init_hookz,_DispatcherBase._compilation_chain_init_hook   s     	r    c                 `    |                                   | j                                         d S r   )_clearr   clearr#   s    r   _reset_overloadsz _DispatcherBase._reset_overloads   s)    r    c                 J    | j         | j        t          j        ffd	}|S )zq
        Return a finalizer function that will release references to
        related compiled functions.
        c                      |             rd S                                  D ]-}	                     |j                   # t          $ r Y *w xY wd S r   )rC   remove_user_functionentry_pointrP   )shutting_downrb   r   	targetctxs     r   	finalizerz2_DispatcherBase._make_finalizer.<locals>.finalizer  s~     }  "((**  2243CDDDD   D s   A  
AA)r   r   r   r   )r   r   r   r   s     @@r   r   z_DispatcherBase._make_finalizer   sG    
 N	N	 %*$7 	 	 	 	 	 	 	 r    c                 *    t          | j                  S )zA
        Returns a list of compiled function signatures.
        )r   r   r#   s    r   
signaturesz_DispatcherBase.signatures  s    
 DN###r    c                 H    d | j                                         D             S )Nc                 *    g | ]}|j         	|j        S r-   )
objectmode	signature)r   rb   s     r   
<listcomp>z7_DispatcherBase.nopython_signatures.<locals>.<listcomp>  s0     ( ( (4( ( ( (r    )r   rC   r#   s    r   nopython_signaturesz#_DispatcherBase.nopython_signatures  s0    ( (4>+@+@+B+B ( ( ( 	(r    Tc                 N    |rt          | j                  dk    sJ | | _        dS )z@Disable the compilation of new signatures at call time.
        r   N)rt   r   _can_compile)r   r   s     r   disable_compilez_DispatcherBase.disable_compile   s4     4C0014444 #Gr    c                     t          |j        j                  }d |D             }|                     ||j        |j                   || j        |<   d S )Nc                     g | ]	}|j         
S r-   )_code)r   as     r   r   z0_DispatcherBase.add_overload.<locals>.<listcomp>)  s    %%%1qw%%%r    )rO   r   rE   _insertr   r   r   )r   rb   rE   sigs       r   add_overloadz_DispatcherBase.add_overload'  sT    T^())%%%%%S$*DO<<<#tr    c                 8    | j                             ||          S r   	_compilerrG   rh   s      r   rG   z#_DispatcherBase.fold_argument_types-  s    ~11$<<<r    c                    | j                             ||          \  }}i }| j        r"|                     t	          |                     | j        j        }d                    |          }t          j	        ||| j
                  }||||fS )z
        Get a typing.ConcreteTemplate for this dispatcher and the given
        *args* and *kws* types.  This allows to resolve the return type.

        A (template, pysig, args, kws) tuple is returned.
        CallTemplate({0})rS   r   )r   rG   r   rM   rO   r1   r(   formatr	   make_concrete_templater   r   rE   rF   r6   	func_namerw   call_templates          r   get_call_templatez!_DispatcherBase.get_call_template0  s     n88sCCt 	&LLt%%% L)	")))44 5iD,DF F FeT3..r    c                 n    t          j        |          \  }}| j        t          |                   j        S )zG
        Return the compiled function for the given signature.
        )r   normalize_signaturer   rO   r   )r   r   rE   rJ   s       r   get_overloadz_DispatcherBase.get_overloadJ  s/     %8==k~eDkk*66r    c                     | j         S )zG
        Whether a specialization is currently being compiled.
        )r   r#   s    r   is_compilingz_DispatcherBase.is_compilingQ  s    
 &&r    c           	         |rJ |                                   d }g }D ]l}t          |t                    r-|                    t	          j        |j                             D|                    |                     |                     md}	 |                     t          |                    }n# t          j        $ rfdj        D             }|rWd}d                    fdt          |          D                       }	t          j        |                    |	                    fdt#                    D              | j         }Y dn7dwt          j        $ rg }
t#                    D ]\  }}t          |t                    r|j        n|}	 t)          |t*          j                  }||
                    |d| f           [# t.          $ r.}|
                    |t1          |          f           Y d}~d}~ww xY w|
r[d	                    d
 |
D                       }t1                                                     d| d	}                    |            |d           Y dndwt          j        $ r |d           Y dndwt          j        t          j        t          j        f$ r |d           Y dndwt          j        $ r |d           Y dndwt@          $ r~tB          j"        rktG          d          r[t          j$        d         }                    d	                    t1                                                    |f                     dww xY w| j%        &                                 n# | j%        &                                 w xY w|S )z
        For internal use.  Compile a specialized version of the function
        for the given *args* and *kws*, and return the resulting callable.
        c                    t           j        r[t          j        |         }|                     d                    t          |                                           |f                     t           j        r| | 	                    d          )z{
            Rewrite and raise Exception `e` with help supplied based on the
            specified issue_type.
            
N)
r   	SHOW_HELPr   error_extraspatch_messagejoinstrrstripFULL_TRACEBACKSwith_traceback)rT   
issue_typehelp_msgs      r   error_rewritez8_DispatcherBase._compile_for_args.<locals>.error_rewriteb  sr    
  H!.z:		3q66==??H*E F FGGG% -&&t,,,r    Nc                 T    g | ]$}t          |         t          j                  "|%S r-   )
isinstancer   Literalr   irE   s     r   r   z5_DispatcherBase._compile_for_args.<locals>.<listcomp>}  sD     F F FQ",T!Wem"D"DFq F F Fr    z~Repeated literal typing request.
{}.
This is likely caused by an error in typing. Please see nested and suppressed exceptions., c              3   P   K   | ] }d                      ||                   V  !dS )zArg #{} is {}N)r   r   s     r   r   z4_DispatcherBase._compile_for_args.<locals>.<genexpr>  sS       !C !C%& "1!7!747!C!C !C !C !C !C !C !Cr    c                 d    g | ],\  }} |j         v rt          j        nd  |                   -S )c                     | S r   r-   )xs    r   <lambda>z>_DispatcherBase._compile_for_args.<locals>.<listcomp>.<lambda>  s    A r    )requested_argsr   literal)r   r   vrE   rT   s      r   r   z5_DispatcherBase._compile_for_args.<locals>.<listcomp>  s[     1 1 1 1&Q--- ]]%+tAw0 0 1 1 1r    z%cannot determine Numba type of value r   c              3   ,   K   | ]\  }}d | d| V  dS )z- argument z: Nr-   )r   r   errs      r   r   z4_DispatcherBase._compile_for_args.<locals>.<genexpr>  sH       % %17C,!,,s,,% % % % % %r    zA 

This error may have been caused by the following argument(s):
r	   unsupported_errorinterpreterconstant_inferencer   
reportable)'r   r   r   appendr   r&   r   typeof_pyvalrM   rO   r   ForceLiteralArgr  r   sortedCompilerErrorr   	enumerate_compile_for_argsrR   r   r   argument
ValueErrorr   r   r   UnsupportedErrorNotDefinedErrorRedefinedErrorVerificationErrorConstantInferenceError	Exceptionr   r   hasattrr   r   r   )r   rE   rF   r   argtypesr   
return_valalready_lit_posminfofailed_argsr   argr   tp
typeof_excargs_strmsgr   rT   s    `                 @r   r  z!_DispatcherBase._compile_for_argsX  s   
  	))+++	- 	- 	-  	6 	6A!Z(( 6ag 6 67777 1 1! 4 45555
F	,eHoo66JJ% 	7 	7 	7F F F F!*: F F FO 	;D yy !C !C !C !C*0*A*A!C !C !C C C*188D>>:::1 1 1 1 1 !*$1 1 1D
 0/6JJJJJJ! 	' 	' 	' K#D// 	P 	P3#-c:#>#>GciiCPW%566B z#** M M MNP P P	 " = = =&&3z??';<<<<<<<<=  %99 % %;F% % %   a&&--// F F9AF F F$$$M!X&&&&&&&&& 	2 	2 	2M!011111111&(=(* 	, 	, 	, M!]++++++++, 	3 	3 	3 M!122222222 	 	 	 L1o.. L%2<@HOODIIs1vv}}.I$J$JKKKG	 #))++++D#))++++s   "B6 4N. 6NBEN. N04J%G?J
H&$H
JHA,J N. NJ)$N. ))NK#N. #N5LN. NA9NNN. .O	Nc                      |& j         |         j        }|                                S t           fd j        D                       S )a&  Get the LLVM intermediate representation generated by compilation.

        Parameters
        ----------
        signature : tuple of numba types, optional
            Specify a signature for which to obtain the LLVM IR. If None, the
            IR is returned for all available signatures.

        Returns
        -------
        llvm : dict[signature, str] or str
            Either the LLVM IR string for the specified signature, or, if no
            signature was given, a dictionary mapping signatures to LLVM IR
            strings.
        Nc              3   F   K   | ]}|                     |          fV  d S r   )inspect_llvmr   r   r   s     r   r   z/_DispatcherBase.inspect_llvm.<locals>.<genexpr>  s6      MMcS$++C001MMMMMMr    )r   libraryget_llvm_strdictr   r   r   libs   `  r   r,  z_DispatcherBase.inspect_llvm  sQ       .+3C##%%%MMMMT_MMMMMMr    c                      |& j         |         j        }|                                S t           fd j        D                       S )a  Get the generated assembly code.

        Parameters
        ----------
        signature : tuple of numba types, optional
            Specify a signature for which to obtain the assembly code. If
            None, the assembly code is returned for all available signatures.

        Returns
        -------
        asm : dict[signature, str] or str
            Either the assembly code for the specified signature, or, if no
            signature was given, a dictionary mapping signatures to assembly
            code.
        Nc              3   F   K   | ]}|                     |          fV  d S r   )inspect_asmr-  s     r   r   z._DispatcherBase.inspect_asm.<locals>.<genexpr>  s6      LLSS$**3//0LLLLLLr    )r   r.  get_asm_strr0  r   r1  s   `  r   r5  z_DispatcherBase.inspect_asm  sO       .+3C??$$$LLLLDOLLLLLLr    Fr?   c                    | j         }||| j         |         i}|s|t          j        }|                                D ]]\  }}t	          | j        j        d||           t	          d|           t	          |j        |           t	          d|           ^dS |t          d          ddl	m
}	  |	| ||	          S )
a  Print/return Numba intermediate representation (IR)-annotated code.

        Parameters
        ----------
        file : file-like object, optional
            File to which to print. Defaults to sys.stdout if None. Must be
            None if ``pretty=True``.
        signature : tuple of numba types, optional
            Print/return the intermediate representation for only the given
            signature. If None, the IR is printed for all available signatures.
        pretty : bool, optional
            If True, an Annotate object will be returned that can render the
            IR with color highlighting in Jupyter and IPython. ``file`` must
            be None if ``pretty`` is True. Additionally, the ``pygments``
            library must be installed for ``pretty=True``.
        style : str, optional
            Choose a style for rendering. Ignored if ``pretty`` is ``False``.
            This is directly consumed by ``pygments`` formatters. To see a
            list of available styles, import ``pygments`` and run
            ``list(pygments.styles.get_all_styles())``.

        Returns
        -------
        annotated : Annotate object, optional
            Only returned if ``pretty=True``, otherwise this function is only
            used for its printing side effect. If ``pretty=True``, an Annotate
            object is returned that can render itself in Jupyter and IPython.
        N )filezP--------------------------------------------------------------------------------zP================================================================================z$`file` must be None if `pretty=True`r   )Annotate)r   style)r   sysstdoutitemsprintr1   r(   type_annotationr  &numba.core.annotations.pretty_annotater:  )
r   r9  r   prettyr;  r   r   verresr:  s
             r   inspect_typesz_DispatcherBase.inspect_types  s   < N	 "DN9$=>I 	D|z%OO-- + +S!6!6!6<4HHHHhT****c)5555hT*****	+ +  !GHHHGGGGGG8DIUCCCCr    c                     |[ j         |         }|j        }dk    r|j        j        }ndk    r|j        j        }n|j        j        } |j        |fd j        i|S t           fd j	        D                       S )a{	  
        For inspecting the CFG of the function.

        By default the CFG of the user function is shown.  The *show_wrapper*
        option can be set to "python" or "cfunc" to show the python wrapper
        function or the *cfunc* wrapper function, respectively.

        Parameters accepted in kwargs
        -----------------------------
        filename : string, optional
            the name of the output file, if given this will write the output to
            filename
        view : bool, optional
            whether to immediately view the optional output file
        highlight : bool, set, dict, optional
            what, if anything, to highlight, options are:
            { incref : bool, # highlight NRT_incref calls
              decref : bool, # highlight NRT_decref calls
              returns : bool, # highlight exits which are normal returns
              raises : bool, # highlight exits which are from raise
              meminfo : bool, # highlight calls to NRT*meminfo
              branches : bool, # highlight true/false branches
             }
            Default is True which sets all of the above to True. Supplying a set
            of strings is also accepted, these are interpreted as key:True with
            respect to the above dictionary. e.g. {'incref', 'decref'} would
            switch on highlighting on increfs and decrefs.
        interleave: bool, set, dict, optional
            what, if anything, to interleave in the LLVM IR, options are:
            { python: bool # interleave python source code with the LLVM IR
              lineinfo: bool # interleave line information markers with the LLVM
                             # IR
            }
            Default is True which sets all of the above to True. Supplying a set
            of strings is also accepted, these are interpreted as key:True with
            respect to the above dictionary. e.g. {'python',} would
            switch on interleaving of python source code in the LLVM IR.
        strip_ir : bool, optional
            Default is False. If set to True all LLVM IR that is superfluous to
            that requested in kwarg `highlight` will be removed.
        show_key : bool, optional
            Default is True. Create a "key" for the highlighting in the rendered
            CFG.
        fontsize : int, optional
            Default is 8. Set the fontsize in the output to this value.
        Npythoncfuncr1   c              3   J   K   | ]}|                     |           fV  dS ))show_wrapperN)inspect_cfg)r   r   r   rJ  s     r   r   z._DispatcherBase.inspect_cfg.<locals>.<genexpr>W  sO       0 0 $**3\*JJK 0 0 0 0 0 0r    )
r   r.  fndescllvm_cpython_wrapper_namellvm_cfunc_wrapper_namemangled_nameget_function_cfgr1   r0  r   )r   r   rJ  r   rb   r2  fnames   ` `    r   rK  z_DispatcherBase.inspect_cfg  s    ^  >),D,Cx''=((;0'3'NNt|NvNNN 0 0 0 0 0#0 0 0 0 0 	0r    c                      |3 j         |         }|j        }|                    |j        j                  S t           fd j        D                       S )a  
        For inspecting the CFG of the disassembly of the function.

        Requires python package: r2pipe
        Requires radare2 binary on $PATH.
        Notebook rendering requires python package: graphviz

        signature : tuple of Numba types, optional
            Print/return the disassembly CFG for only the given signatures.
            If None, the IR is printed for all available signatures.
        Nc              3   F   K   | ]}|                     |          fV  d S r   )inspect_disasm_cfgr-  s     r   r   z5_DispatcherBase.inspect_disasm_cfg.<locals>.<genexpr>k  sJ       0 0 $11#667 0 0 0 0 0 0r    )r   r.  get_disasm_cfgrL  rO  r0  r   )r   r   rb   r2  s   `   r   rT  z"_DispatcherBase.inspect_disasm_cfgZ  sq      >),D,C%%dk&>??? 0 0 0 0#0 0 0 0 0 	0r    c                    || j         n|g}t          j                    }|D ]f}| j        |         }|j        }|j        j        dz   t          |j        j        dz             z   |j	        f}|
                                |         ||<   g|S )z
        Gets the annotation information for the function specified by
        signature. If no signature is supplied a dictionary of signature to
        annotation information is returned.
        N:r   )r   r   r   r   r@  func_idfilenamer   firstlinenor   annotate_raw)r   r   r   outr   rb   tarS   s           r   get_annotation_infoz#_DispatcherBase.get_annotation_infon  s     )2(9T__	{
%'' 	. 	.C>#&D%B:&,s2:3IA3M/N/NN<!C((-CHH
r    c                      |r
J d            t           fd|D                       } j        } j                             j        |||d           dS )8
        Callback for the C _Dispatcher object.
        kwargs not handledc                 :    g | ]}                     |          S r-   r  r   r   r   s     r   r   z6_DispatcherBase._explain_ambiguous.<locals>.<listcomp>  s'    999qd''**999r    F)allow_ambiguousN)rO   r   	typingctxresolve_overloadr1   )r   rE   rF   sigss   `   r   _explain_ambiguousz"_DispatcherBase._explain_ambiguous~  s|     ,,,,,,9999D999:: '''dD#8= 	( 	? 	? 	? 	? 	?r    c                      |r
J d             fd|D             }dd                     t          t          |                    z  }t          |          )r`  ra  c                 :    g | ]}                     |          S r-   rc  rd  s     r   r   z;_DispatcherBase._explain_matching_error.<locals>.<listcomp>  '    333!!!$$333r    z.No matching definition for argument type(s) %sr   )r   mapr   rz   )r   rE   rF   r)  s   `   r   _explain_matching_errorz'_DispatcherBase._explain_matching_error  s`     ,,,,,,3333d333?3sD>>**+nnr    c                      |r
J d             fd|D             }d} j         D ]&} j                            ||j                  }|rd}'|S )z
        Callback for the C _Dispatcher object.
        Search for approximately matching signatures for the given arguments,
        and ensure the corresponding conversions are registered in the C++
        type manager.
        ra  c                 :    g | ]}                     |          S r-   rc  rd  s     r   r   z;_DispatcherBase._search_new_conversions.<locals>.<listcomp>  rl  r    FT)r   rf  install_possible_conversionsrE   )r   rE   rF   foundr   convs   `     r   _search_new_conversionsz'_DispatcherBase._search_new_conversions  sv     ,,,,,,3333d333+ 	 	C>>>tSXNND r    c                 @    t          |           j        d| j        dS )N(r"   )typer(   r1   r#   s    r   r$   z_DispatcherBase.__repr__  s"    ::...==r    c                     	 t          |t          j                  }|t          j        }n# t
          $ r t          j        }Y nw xY w| j                            |           |S )z
        Resolve the Numba type of Python value *val*.
        This is called from numba._dispatcher as a fallback if the native code
        cannot decide the type.
        )r   r   r  r   pyobjectr  r   r{   )r   r   r&  s      r   r  z_DispatcherBase.typeof_pyval  sn    	$W-..B z^	  	  	  	 BBB	 
 	##B'''	s   + AAc                     |j         }|6|                    di           }||vr|||<   d S d| d}t          |          d S )Ntimersrs   z metadata is already defined.)metadata
setdefaultAssertionError)r   durationrb   	lock_namemdr{  r)  s          r   _callback_add_timerz#_DispatcherBase._callback_add_timer  sa    ]>]]8R00F&&$,y!!!B)BBB$S))) >r    c                 2    |                      ||d          S )Ncompiler_lockr  r  r   r  rb   s      r   _callback_add_compiler_timerz,_DispatcherBase._callback_add_compiler_timer  s)    ''$2A ( C C 	Cr    c                 2    |                      ||d          S )N	llvm_lockr  r  r  s      r   _callback_add_llvm_timerz(_DispatcherBase._callback_add_llvm_timer  s&    ''$2= ( ? ? 	?r    )Tr   )NNFr?   )NN)!r(   r)   r*   r+   	__numba__r   r   r   r   r,   r   r   r   r   rG   r   r   r   r  r,  r5  rE  rK  rT  r^  ri  rn  rt  r$   r  r  r  r  r-   r    r   r   r      s         I$7 $7 $7L      2 $ $ X$ ( ( X($ $ $ $$ $ $= = =/ / /47 7 7 ' ' X'f f fPN N N N,M M M M, 26*3/D /D /D /Db;0 ;0 ;0 ;0z0 0 0 0(    ? ? ?     > > >   
* 
* 
*C C C? ? ? ? ?r    r   c                   x    e Zd ZdZ ej                    Z ej        e	j
                  Zed             Zd ZdS )
_MemoMixinN)maxlenc                     | j         }|5t          t          j                              }|                     |           |S )z
        An instance-specific UUID, to avoid multiple deserializations of
        a given instance.

        Note: this is lazily-generated, for performance reasons.
        )_MemoMixin__uuidr   uuiduuid4	_set_uuidr   us     r   _uuidz_MemoMixin._uuid  s:     K9DJLL!!ANN1r    c                 n    | j         J || _         | | j        |<   | j                            |            d S r   )r  _memo_recentr  r  s     r   r  z_MemoMixin._set_uuid  s>    {"""
1D!!!!!r    )r(   r)   r*   r  r   WeakValueDictionaryr  r   dequer   FUNCTION_CACHE_SIZEr  r,   r  r  r-   r    r   r  r    sk        F'G'))E  kv'ABBBG  X" " " " "r    r  c                       e Zd ZdZdZdZi i ej        fdZddZ	e
d             Zd Zdd
Zd Zed             Zd Zd Zd Ze
d             ZddZddZd Zd	S )r   z
    Implementation of user-facing dispatcher objects (i.e. created using
    the @jit decorator).
    This is an abstract base class. Subclasses should define the targetdescr
    class attribute.
    Tr1   c                    | j         j        | _        | j         j        | _        t          j        |          }t          |j                  }|	                    dd           }t                              | ||||d           t          j        | |           || _        || _        t!                      | _        t$          } ||| j         |||          | _        t)          j                    | _        t)          j                    | _        t1          j        |           | _        | j                            | | j                   dS )a  
        Parameters
        ----------
        py_func: function object to be compiled
        locals: dict, optional
            Mapping of local variable names to Numba types.  Used to override
            the types deduced by the type inference engine.
        targetoptions: dict, optional
            Target-specific config options.
        pipeline_class: type numba.compiler.CompilerBase
            The compiler pipeline type.
        nopythonF)r   N)r2   r]   rf  r^   r   r   r5   rt   ru   getr   r   	functoolsupdate_wrapperr3   r4   r   _cacher/   r   r   Counter_cache_hits_cache_missesr   r   _typeinsert_global)	r   r1   r4   r3   r7   r6   r   r   compiler_classs	            r   r   zDispatcher.__init__  s+    )8)8!'**())	(,,Z???  y'5,6; 	! 	= 	= 	= 	 w///*kk*'1A(5v~O O&.00(022%d++
$$T4:66666r     c           
      Z   t          | dt          |           j         d| j        j         d| j        j         d           | j                                        D ]}|                    |dz              t          | dt          |           j         d| j        j         d           d S )NzDUMP [z, type code=]z  )tabz	END DUMP )	r?  rw  r(   r1   r  r   r   rC   dump)r   r  rb   s      r   r  zDispatcher.dump  s     1 14::. 1 11F 1 1!Z-1 1 1 	2 	2 	2N))++ 	& 	&DII#*I%%%%MMtDzz2MMT\5JMMMNNNNNr    c                 *    t          j        |           S r   r   r   r#   s    r   r'   zDispatcher._numba_type_"      %%%r    c                 8    t          | j                  | _        d S r   )r   r1   r  r#   s    r   enable_cachingzDispatcher.enable_caching&  s    #DL11r    Nc                 4    || S t          j        | |          S )z9Allow a JIT function to be bound as a method to an object)pytypes
MethodType)r   objobjtypes      r   __get__zDispatcher.__get__)  s    ;K%dC000r    c                     | j         rg }n#d | j                                        D             }t          t	          | j                  | j        | j        | j        | j         |          S )
        Reduce the instance for pickling.  This will serialize
        the original function as well the compilation options and
        compiled signatures, but not the compiled code itself.

        NOTE: part of ReduceMixin protocol
        c                     g | ]	}|j         
S r-   )r   )r   crs     r   r   z-Dispatcher._reduce_states.<locals>.<listcomp>;  s    CCCRBLCCCr    )r  r1   r4   r3   can_compilerh  )	r   r   rC   r0  r   r  r1   r4   r3   )r   rh  s     r   _reduce_stateszDispatcher._reduce_states0  ss      	DDDCC4>+@+@+B+BCCCDTZL;,)
 
 
 	
r    c                     	 | j         |         S # t          $ r Y nw xY w | |||          }|                    |           |D ]}|                    |           ||_        |S )w
        Rebuild an Dispatcher instance after it was __reduce__'d.

        NOTE: part of ReduceMixin protocol
        )r  rP   r  rM   r   )	clsr  r1   r4   r3   r  rh  r   r   s	            r   _rebuildzDispatcher._rebuildF  s    	9T?" 	 	 	D	s7FM22t 	 	CLL'    
c                 z    t                      5 }d  fd} fd}|                    t          j        d|                     |                    t          j        d|                     |                    t                      j        st          d           j        5  t          j	        |          \  }} j
                            t          |                    }||j        cd d d            cd d d            S  j                            | j                  | j        |xx         dz  cc<   j        s, j                            j        j        j        g                                           j        cd d d            cd d d            S  j        |xx         dz  cc<   t1           ||          }t          j        d|	          5  	  j                            ||          n1# t8          j        $ r}	 fd
}
|	                    |
          d }	~	ww xY w                                d d d            n# 1 swxY w Y    j                            |           j        cd d d            cd d d            S # 1 swxY w Y   	 d d d            d S # 1 swxY w Y   d S )Nc                 <                         |            d S d S r   r  durrb   r   s    r   cb_compilerz'Dispatcher.compile.<locals>.cb_compiler^  -    #55c4@@@@@ $#r    c                 <                         |            d S d S r   r  r  s    r   cb_llvmz#Dispatcher.compile.<locals>.cb_llvmb  -    #11#t<<<<< $#r    numba:compiler_locknumba:llvm_lockzcompilation disabledr   
dispatcherrE   rJ   numba:compiledatac                 F    j                             | |          d         S Nr   r   )rE   rF   r   s     r   foldedz"Dispatcher.compile.<locals>.folded  s.    #'>#E#EdFI$K $KKL$N Nr    ) r   enter_contextevinstall_timerr   r   RuntimeErrorr   r   r   r   r  rO   r   r  load_overloadr   r  r   insert_user_functionrL  r.  r   r  r0  trigger_eventr   rM   r   r  bind_fold_argumentssave_overload)r   r   scoper  r  rE   rJ   existing
ev_detailsrT   r  rb   s   `          @r   rM   zDispatcher.compileZ  s   [[ 5	(EDA A A A A A= = = = = =  01F1<!> !> ? ? ? 01BG L LMMM 4555$ ;"#9:::( "( "($,$@$E$E!k>--eDkk::'#/"( "( "( "( "( "( "('5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	(4 {00dnEE#$S)))Q.)))? L;;D<L<@K=A\NL L L %%d++++!"( "( "( "( "( "( "('5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	(J "3'''1,'''!# +  

 %oJGGG , ,<#~55dKHH!1 < < <N N N N N  33F;;;	<
 %%d+++, , , , , , , , , , , , , , , ))#t444'E"( "( "( "( "( "( "('5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	(&"( "( "( "( "( "( "( "( "('5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	( 5	(s   BJ0'AJ.J0BJJ0%=J"I$H ?I H.	H)	)H.	.IJIJI$J>J0J	J0J	J00J47J4c                     t          |j                  }|| j        vr6| j        r|                     |           n| d}t          j        |          | j        |         S )zCompile (if needed) and return the compilation result with the
        given signature.

        Returns ``CompileResult``.
        Raises ``NumbaError`` if the signature is incompatible.
        z' not available and compilation disabled)rO   rE   r   r   rM   r   rR   )r   r   atypesr)  s       r   get_compile_resultzDispatcher.get_compile_result  sj     sx''  .V$$$$EEE(---~f%%r    c                 :   t          | j                  }| j        } |                                              |                                  | j                                         d| _        	 |D ]}|                     |           	 || _        dS # || _        w xY w)z2
        Recompile all signatures afresh.
        TN)r   r   r   r   r   r  flushrM   )r   rh  old_can_compiler   s       r   	recompilezDispatcher.recompile  s     DN##+ 	    	0 " "S!!!!" !0DD////s   -B 	Bc                 N    t          | j        j        | j        | j                  S )Nr   )r   r  r   r  r  r#   s    r   statszDispatcher.stats  s-    {-'+
 
 
 	
r    r   c                 \      fd| |           dS fd j         D              dS )a2  
        Print parallel diagnostic information for the given signature. If no
        signature is present it is printed for all known signatures. level is
        used to adjust the verbosity, level=1 (default) is minimal verbosity,
        and 2, 3, and 4 provide increasing levels of verbosity.
        c                     j         |          }|j                            dd           }|d}t          |          |                               d S )Nparfor_diagnosticsz8No parfors diagnostic available, is 'parallel=True' set?)r   r|  r  r  r  )r   olpfdiagr)  levelr   s       r   r  z-Dispatcher.parallel_diagnostics.<locals>.dump  sS    $B[__%94@@F~P oo%KKr    Nc                 &    g | ]} |          S r-   r-   )r   r   r  s     r   r   z3Dispatcher.parallel_diagnostics.<locals>.<listcomp>  s!    2223TT#YY222r    )r   )r   r   r  r  s   ` `@r   parallel_diagnosticszDispatcher.parallel_diagnostics  s^    	 	 	 	 	 	  DOOOOO2222$/222222r    c                 l     | j         |         j        S t           fd j        D                       S )zH
        Obtain the compilation metadata for a given signature.
        Nc              3   @   K   | ]}|j         |         j        fV  d S r   )r   r|  r-  s     r   r   z*Dispatcher.get_metadata.<locals>.<genexpr>  sC        7:T^C(12     r    )r   r|  r0  r   )r   r   s   ` r   get_metadatazDispatcher.get_metadata  sU      >),55    >Bo     r    c                     | j         s]t          | j                  dk    rGt          | j                                                  d         }t          j        |j                  S dS dS )a   Return unique function type of dispatcher when possible, otherwise
        return None.

        A Dispatcher instance has unique function type when it
        contains exactly one compilation result and its compilation
        has been disabled (via its disable_compile method).
        r   r   N)r   rt   r   rO   rC   r   FunctionTyper   )r   rb   s     r   get_function_typezDispatcher.get_function_type  sf       	6S%8%8A%=%=..0011!4D%dn555	6 	6%=%=r    )r  r   r  )r(   r)   r*   r+   r   r  r   Compilerr   r  r,   r'   r  r  r  classmethodr  rM   r  r  r  r  r  r  r-   r    r   r   r     sJ         JI') ( 1$7 $7 $7 $7LO O O O & & X&2 2 21 1 1 1
 
 
,   [&6( 6( 6(p& & &"0 0 0$ 
 
 X
3 3 3 3&	 	 	 	
6 
6 
6 
6 
6r    r   c                   j    e Zd ZdZdZdZd Zd Zd Ze	d             Z
d Zd Zed	             Zd
 ZdS )
LiftedCodez
    Implementation of the hidden dispatcher objects used for lifted code
    (a lifted loop is really compiled as a separate function).
    Fc                     || _         d | _        || _        || _        || _        || _        t                              | | j         j        | j         j	        j
        | j         j	        j        dd           d S )NTF)r   r   )func_irlifted_fromrf  r   rV   r4   r   r   r   rX  funcr6   )r   r  rf  r   rV   r4   s         r   r   zLiftedCode.__init__  sy    ""
  t|'=!%!5!:!%!5!;.26;	 	! 	= 	= 	= 	= 	=r    c                 v    t          | j        | j        | j        | j        |                                           S )r  )r  r  rV   r4   extras)r0  r  r  rV   r4   _reduce_extrasr#   s    r   r  zLiftedCode._reduce_states  s;     T\;t':':'<'<
 
 
 	
r    c                     i S )zB
        NOTE: sub-class can override to add extra states
        r-   r#   s    r   r	  zLiftedCode._reduce_extras  s	     	r    c                     	 | j         |         S # t          $ r Y nw xY wddlm} |j        j        }|j        j        } | |||||fi |}	|	                    |           |	S )r  r   )registry)r  rP   
numba.corer  
cpu_targetr]   r^   r  )
r  r  r  rV   r4   r  r  rf  r   r   s
             r   r  zLiftedCode._rebuild  s    	9T?" 	 	 	D	 	(''''''6	'6	s7Iy%JJ6JJtr  c                 $    | j         j        j        S )z5Return the starting line number of the loop.
        )r  locliner#   s    r   get_source_locationzLiftedCode.get_source_location*  s     |$$r    c                     dS )zPre-compile actions
        Nr-   r   rE   rJ   rV   s       r   _pre_compilezLiftedCode._pre_compile/  s	     	r    c                     dS )zLifted code should implement a compilation method that will return
        a CompileResult.entry_point for the given signature.Nr-   )r   r   s     r   rM   zLiftedCode.compile4  s	     	r    c                     | S r   r-   r#   s    r   "_get_dispatcher_for_current_targetz-LiftedCode._get_dispatcher_for_current_target:  s	     r    N)r(   r)   r*   r+   r   	can_cacher   r  r	  r   r  r  r  r   rM   r  r-   r    r   r  r    s          JI= = =
 
 
     [.% % %
  
   ^
    r    r  c                       e Zd Zd Zd ZdS )
LiftedLoopc                 (    |j         r
J d            d S )NzEnable looplift flags is on)enable_loopliftr  s       r   r  zLiftedLoop._pre_compileA  s     (GG*GGGGGGr    c                 4    t                      5 }d  fd} fd}|                    t          j        d|                     |                    t          j        d|                     |                    t                      j        5   j        }t          j        |          \  }} j	        
                    t          |                    }||j        cd d d            cd d d            S                      |||           |                                }	d|	_        |                                }
d|
_         j                                        } j                                        }t#           ||          }t          j        d|	          5  	 t'          j         j         j        ||||	 j        d
 j        d
  
        nG# t2          j        $ r5 t'          j         j         j        ||||
 j        d
 j        d
  
        Y nw xY wj        j                                        d d d            n# 1 swxY w Y   j        cd d d            cd d d            S # 1 swxY w Y   	 d d d            d S # 1 swxY w Y   d S )Nc                 <                         |            d S d S r   r  r  s    r   r  z'LiftedLoop.compile.<locals>.cb_compilerH  r  r    c                 <                         |            d S d S r   r  r  s    r   r  z#LiftedLoop.compile.<locals>.cb_llvmL  r  r    r  r  FTr  r  r  r-   
rf  r   r  rE   rJ   rV   r4   liftedr  is_lifted_loop)r   r  r  r  r   r   rV   r   r   r   r  rO   r   r  copyforce_pyobjectr  r0  r  r   
compile_irrf  r   r4   r  r   rR   r_   r   )r   r   r  r  r  rV   rE   rJ   r  npm_loop_flagspyobject_loop_flagscloned_func_ir_npmcloned_func_ir_fbkr  rb   s   `             @r   rM   zLiftedLoop.compileD  s9   [[ K	(EDA A A A A A= = = = = =  01F1<!> !> ? ? ? 01BG L LMMM 4555 ( :( :(
$,$@$E$E!k  >--eDkk::'#/:( :( :( :( :( :( :(#K	( K	( K	( K	( K	( K	( K	( K	(8 !!$U;;; "'05-&+jjll#59#2 &*\%6%6%8%8"%)\%6%6%8%8"!# +  

 %oJGGG , ,I'2T^=A^;M8<?J9G:>+:<?C?OBF	 I 	 I 	 I "- 
I 
I 
I'2T^=A^;M8<?J9L:>+:<?C?OBF	 I 	 I 	 I
I )5"//%%d+++9, , , , , , , , , , , , , , ,: 'u:( :( :( :( :( :( :(#K	( K	( K	( K	( K	( K	( K	( K	(":( :( :( :( :( :( :( :( :(#K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	( K	(s   B JAI4J8B'I4I
!2GI
AH	I
H	&I
>I4
II4I	I4J4I8	8J;I8	<JJJN)r(   r)   r*   r  rM   r-   r    r   r  r  @  s:        H H HL( L( L( L( L(r    r  c                   :    e Zd ZdZd Zed             Zd Zd ZdS )
LiftedWithTc                 ,    t          | j                  S )N)output_types)r0  r.  r#   s    r   r	  zLiftedWith._reduce_extras  s    !23333r    c                 *    t          j        |           S r   r  r#   s    r   r'   zLiftedWith._numba_type_  r  r    c                     | j         r"|                     t          |                     d}| j        j        }d                    |          }t          j        ||| j                  }||||fS z
        Get a typing.ConcreteTemplate for this dispatcher and the given
        *args* and *kws* types.  This enables the resolving of the return type.

        A (template, pysig, args, kws) tuple is returned.
        Nr   r   )	r   rM   rO   r1   r(   r   r	   r   r   r   s          r   r   zLiftedWith.get_call_template  s~      	&LLt%%%L)	")))44 5iD,DF F FeT3..r    c                     t                      5 }d  fd} fd}|                    t          j        d|                     |                    t          j        d|                     |                    t                      j        5   j        }t          j        |          \  }} j	        
                    t          |                    }||j        cd d d            cd d d            S                      |||            j                                        }	t!           ||          }
t          j        d|
          5  t%          j         j         j        |	||| j        d j        d	

  
        j        |j        sj                                        d d d            n# 1 swxY w Y   j        cd d d            cd d d            S # 1 swxY w Y   	 d d d            d S # 1 swxY w Y   d S )Nc                 <                         |            d S d S r   r  r  s    r   r  z'LiftedWith.compile.<locals>.cb_compiler  r  r    c                 <                         |            d S d S r   r  r  s    r   r  z#LiftedWith.compile.<locals>.cb_llvm  r  r    r  r  r  r  r  r-   Tr!  )r   r  r  r  r   r   rV   r   r   r   r  rO   r   r  r  r$  r0  r  r   r&  rf  r   r4   r  r_   r`   r   )r   r   r  r  r  rV   rE   rJ   r  cloned_func_irr  rb   s   `          @r   rM   zLiftedWith.compile  so    [[ 6	(EDA A A A A A= = = = = =  01F1<!> !> ? ? ? 01BG L LMMM 4555 ( %( %(
$,$@$E$E!k  >--eDkk::'#/%( %( %( %( %( %( %(#6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	(8 !!$U;;; "&!2!2!4!4!# +  

 %oJGGG , ,#.9=7E48;F5:4;68;?;K>BE E ED )5 % 5 6"//%%d+++, , , , , , , , , , , , , , ,  'K%( %( %( %( %( %( %(#6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	("%( %( %( %( %( %( %( %( %(#6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	( 6	(si   B G<AG#G<8AG#AF9-G#9F==G# F=	G#
G<#G'	'G<*G'	+G<<H H N)	r(   r)   r*   r  r	  r,   r'   r   rM   r-   r    r   r,  r,    sa        I4 4 4 & & X&/ / /*9( 9( 9( 9( 9(r    r,  c                   Z     e Zd Z fdZed             Zd Zd Ze fd            Z	 xZ
S )ObjModeLiftedWithc                     |                     dd           | _         t          t          |           j        |i | | j        j        st          d          | j        t          d          d| j        _	        d S )Nr.  z expecting `flags.force_pyobject`z`output_types` must be providedT)
popr.  rm   r,  r   rV   r%  r  rz   no_rewrites)r   rE   r   rp   s      r   r   zObjModeLiftedWith.__init__  s    "JJ~t<<(j$($9&999z( 	A?@@@$=>>>!%
r    c                 *    t          j        |           S r   )r   ObjModeDispatcherr#   s    r   r'   zObjModeLiftedWith._numba_type_  s    &t,,,r    c                 p   |rJ |                      |           t          j        gt          |          z  }| j        r"|                     t          |                     t          j        | j	        g|R  g}d}| j
        j        }d                    |          }t          j        |||          }||||fS r1  )_legalize_arg_typesr   ffi_forced_objectrt   r   rM   rO   r	   r   r.  r1   r(   r   r   )r   rE   rF   r   r6   r   rw   r   s           r   r   z#ObjModeLiftedWith.get_call_template  s       &&&'(3t994 	&LLt%%%&t'8@4@@@A
L)	")))445iJ8 8 8 eT3..r    c                 @   t          |d          D ]\  }}t          |t          j                  r)d}t	          j        |                    |                    t          |t          j                  r)d}t	          j        |                    |                    d S )Nr   )startz>Does not support list type inputs into with-context for arg {}zBDoes not support function type inputs into with-context for arg {})r  r   r   Listr   rR   r   r   )r   rE   r   r   r)  s        r   r>  z%ObjModeLiftedWith._legalize_arg_types  s    d!,,, 	8 	8DAq!UZ(( 8.  (A777Au/00 8.  (A7778	8 	8r    c                     t          j        |          \  }}t          j        ft	          |          z  }t                                          |          S r   )r   r   r   r?  rt   rm   rM   )r   r   rE   _rp   s       r   rM   zObjModeLiftedWith.compile%  sC    .s33a&(3t994wws###r    )r(   r)   r*   r   r,   r'   r   r>  r   rM   r   r   s   @r   r7  r7    s        & & & & & - - X-/ / /08 8 8 $ $ $ $ $ $ $ $ $r    r7  c              #   B   K   | ]}t          |          |j        fV  d S r   )r   r   r   ts     r   r   r   0  s/      <<1c!ffag<<<<<<r    c              #   t   K   | ]3}t          |                              d           d         |j        fV  4dS )rD  r   N)r   splitr   rF  s     r   r   r   5  s@      NN!c!ffll3#QW-NNNNNNr    )<r   r  r<  r   r  r  r   
contextlibr   abcr   numbar   r  r   r   r	   r
   r   r   r   numba.core.compiler_lockr   numba.core.typeconv.rulesr   numba.core.typing.templatesr   numba.core.typing.typeofr   r   numba.core.bytecoder   numba.core.cachingr   r   r   numba.core.eventcoreeventr  objectr   r/   rk   
namedtupler   r   r   r   r  ReduceMixinr  r  r,  r7  USE_LEGACY_TYPE_SYSTEMtypeof_initr0  number_domainnp_number_domainr-   r    r   <module>r]     sV           



                                                  : 9 9 9 9 9 : : : : : : 6 6 6 6 6 6 4 4 4 4 4 4 4 4 / / / / / / 7 7 7 7 7 7 7 7 " " " " " "         ) ) ) ) ) ) ) ) R R R R R R R Rj# # # # #!2 # # #L '&AC C    v   ,J? J? J? J? J?k, J? J? J?Z" " " " " " " ":{6 {6 {6 {6 {6&
O {6 {6 {6|U U U U U&
O U U UpP( P( P( P( P( P( P( P(fY( Y( Y( Y( Y( Y( Y( Y(x:$ :$ :$ :$ :$
 :$ :$ :$z 
  	PK<<(;<<<<<> > > > >
 KNNu7MNNNNNP P P P Pr    