
    xKg                     |   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y)z_
Separate module with function samples for serialization tests,
to avoid issues with __main__.
    Njit)typesc                     | |z   S N abs     b/home/alanp/www/video.onchill/myenv/lib/python3.12/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    
Hq5Lr   c                 0     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      s    $ Lr   g      @)sqrtc                 .     t        di | fd       }|S )Nc                 v    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(   s0     1q5M zz!Q$q'))r   r   r   )r(   jit_argsr   s   `  r   closure_with_globalsr*   '   s"    _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                 ~    t        j                  d       t        j                  |       t        j                         fS )N*   )nprandseednpcosrandomr0   s    r   get_renamed_moduler9   <   s&    
KKO66!9fmmo%%r   c                 0     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   s    $( (Lr   c                 \     t        d       fd       t        d       fd       }|S )NTr   c                 0    t        j                  |       S r   r,   )r&   r(   s    r   other_innerz2closure_calling_other_closure.<locals>.other_innerI   s    zz!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   s8    $    	$" "Lr   c                  f    d}i }t        |j                         |        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   s7    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  
    ekk5;;  !   d  d    d  d   d& &

+ $' $/ r   