
    J/Ph                        d Z ddlZddlmZ ddlmZ  eej        ej        f          d             Zed             Z ed          d	             Z	 ed          d
             Z
d ZdZddlmZ d Z ed          d             Z ed          d             ZddlZddlmZ  ed          d             Zd Zd Zd Z ed          Z ed          ZdS )z_
Separate module with function samples for serialization tests,
to avoid issues with __main__.
    Njit)typesc                     | |z   S N abs     ^/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/tests/serialize_usecases.pyadd_with_sigr          q5L    c                     | |z   S r   r   r	   s     r   add_without_sigr      r   r   Tnopythonc                     | |z   S r   r   r	   s     r   add_nopythonr      r   r   c                 (    t                       | |z   S r   )objectr	   s     r   add_nopython_failr      s    
HHHq5Lr   c                 >     t          d           fd            }|S )NTr   c                     | z   |z   S r   r   )r   cr
   s     r   innerzclosure.<locals>.inner   s    1uqyr   r   )r
   r   s   ` r   closurer      s7    $    Lr   g      @)sqrtc                 6     t          di | fd            }|S )Nc                     t          t          t          dz             }t          j        |           t	          |          z   S )N   )maxKmathhypotr   )ykxs     r   r   z#closure_with_globals.<locals>.inner(   s5     1q5MM z!Q$q''))r   r   r   )r(   jit_argsr   s   `  r   closure_with_globalsr*   '   s7    __8__* * * * _* Lr   c                 ,    t          j        | |          S r   r$   r%   )r(   r&   s     r   other_functionr-   1   s    :ar   )forceobjc                     t           | z  S r   )r#   r(   s    r   get_global_objmoder1   5   s    q5Lr   c                 x    t          j        d           t          j        |           t          j                    fS )N*   )nprandseednpcosrandomr0   s    r   get_renamed_moduler9   <   s(    
KOOO6!99fmoo%%r   c                 >     t          d           fd            }|S )NTr   c                 *    t          |           |z   S r   )r-   )r&   zr(   s     r   r   z-closure_calling_other_function.<locals>.innerC   s    a##a''r   r   )r(   r   s   ` r   closure_calling_other_functionr=   B   s7    $( ( ( ( (Lr   c                 x     t          d           fd            t          d           fd            }|S )NTr   c                 .    t          j        |           S r   r,   )r&   r(   s    r   other_innerz2closure_calling_other_closure.<locals>.other_innerI   s    z!Qr   c                       |           z   S r   r   )r&   r@   r(   s    r   r   z,closure_calling_other_closure.<locals>.innerM   s    {1~~!!r   r   )r(   r   r@   s   ` @r   closure_calling_other_closurerB   H   sn    $          	$" " " " " "Lr   c                      d}i }t          |                                |            t          di | |d                   S )Nz
        def dyn_func(x):
            res = 0
            for i in range(x):
                res += x
            return res
        dyn_funcr   )execstripr   )r)   codenss      r   _get_dyn_funcrI   T   sF    D 
Br3????2j>***r   )__doc__r$   numbar   
numba.corer   int32r   r   r   r   r   r#   r   r*   r-   r1   numpyr6   numpy.randomr8   r4   r9   r=   rB   rI   rD   dyn_func_objmoder   r   r   <module>rQ      s   
              ek5;    !     d   d              d   d            d& & &
    
+ 
+ 
+ =$''' =$///   r   