o
    i	                     @   s$  d Z ddlZddlmZmZ ddlmZ eejejfdd Zedd Z	ed	d
dd Z
ed	d
dd Zdd ZdZddlmZ dd Zed	d
dd Zed	ddd ZddlZddlmZ ed	d
dd Zdd Zdd Zd Zd!Zed	d
d"d# Zd$d% Zed	d
Zed	dZdS )&z_
Separate module with function samples for serialization tests,
to avoid issues with __main__.
    N)jitgenerated_jit)typesc                 C      | | S N abr   r   m/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/numba/tests/serialize_usecases.pyadd_with_sig      r   c                 C   r   r   r   r   r   r   r   add_without_sig   r   r   TZnopythonc                 C   r   r   r   r   r   r   r   add_nopython   r   r   c                 C   s   t   | | S r   )objectr   r   r   r   add_nopython_fail   s   r   c                       t dd fdd}|S )NTr   c                    s    |  | S r   r   )r
   cr	   r   r   inner      zclosure.<locals>.innerr   )r	   r   r   r   r   closure      r   g      @)sqrtc                    s   t di | fdd}|S )Nc                    s"   t ttd }t | t| S )N   )maxKmathhypotr   )ykxr   r   r   (   s   z#closure_with_globals.<locals>.innerr   r   )r$   jit_argsr   r   r#   r   closure_with_globals'   s   r&   c                 C   s   t | |S r   r   r    r$   r!   r   r   r   other_function1   r   r)   )Zforceobjc                 C   s   t |  S r   )r   r#   r   r   r   get_global_objmode5   r   r*   c                 C   s   t d t| t  fS )N*   )nprandseednpcosrandomr#   r   r   r   get_renamed_module<   s   
r1   c                    r   )NTr   c                    s   t  | | S r   )r)   )r!   zr#   r   r   r   C   s   z-closure_calling_other_function.<locals>.innerr   r$   r   r   r#   r   closure_calling_other_functionB   r   r4   c                    s2   t ddfdd t dd fdd}|S )NTr   c                    s   t  | S r   r'   r!   r#   r   r   other_innerI   r   z2closure_calling_other_closure.<locals>.other_innerc                    s    |  S r   r   r5   r6   r$   r   r   r   M   r   z,closure_calling_other_closure.<locals>.innerr   r3   r   r7   r   closure_calling_other_closureH   s
   r8      r+   c                    s,   d t | tjrdd }|S  fdd}|S )Nr   c                 S   s   | | t  S r   )k1r(   r   r   r   impl\   s   zgenerated_add.<locals>.implc                    s   | | t    S r   )k2r(   Zk3r   r   r;   _   s   )
isinstancer   Complex)r$   r!   r;   r   r=   r   generated_addX   s   r@   c                  K   s,   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nsr   r   r   _get_dyn_funce   s   rF   ) __doc__r   Znumbar   r   Z
numba.corer   Zint32r   r   r   r   r   r   r   r&   r)   r*   numpyr.   Znumpy.randomr0   r,   r1   r4   r8   r:   r<   r@   rF   rA   Zdyn_func_objmoder   r   r   r   <module>   sB    









