U
    9%e	                     @   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   | | S N abr   r   ]/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/numba/tests/serialize_usecases.pyadd_with_sig   s    r   c                 C   s   | | S r   r   r   r   r   r
   add_without_sig   s    r   TZnopythonc                 C   s   | | S r   r   r   r   r   r
   add_nopython   s    r   c                 C   s   t   | | S r   )objectr   r   r   r
   add_nopython_fail   s    r   c                    s   t dd fdd}|S )NTr   c                    s    |  | S r   r   )r	   cr   r   r
   inner   s    zclosure.<locals>.innerr   )r   r   r   r   r
   closure   s    r   g      @)sqrtc                    s   t f | 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   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   s    r$   )Zforceobjc                 C   s   t |  S r   )r   r   r   r   r
   get_global_objmode5   s    r%   c                 C   s   t d t| t  fS )N*   )nprandseednpcosrandomr   r   r   r
   get_renamed_module<   s    
r,   c                    s   t dd fdd}|S )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   s    r/   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   s    z2closure_calling_other_closure.<locals>.other_innerc                    s    |  S r   r   r0   r1   r   r   r
   r   M   s    z,closure_calling_other_closure.<locals>.innerr   r.   r   r2   r
   closure_calling_other_closureH   s
    r3      r&   c                    s*   d t | tjrdd }n 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
   r6   _   s    )
isinstancer   Complex)r   r   r6   r   r8   r
   generated_addX   s
    
r;   c                  K   s(   d}i }t | | tf | |d S )Nz
        def dyn_func(x):
            res = 0
            for i in range(x):
                res += x
            return res
        dyn_func)execstripr   )r    codensr   r   r
   _get_dyn_funce   s    rA   ) __doc__r   Znumbar   r   Z
numba.corer   Zint32r   r   r   r   r   r   r   r!   r$   r%   numpyr)   Znumpy.randomr+   r'   r,   r/   r3   r5   r7   r;   rA   r<   Zdyn_func_objmoder   r   r   r
   <module>   s@   









