U
    -e                     @   s"  d Z ddlZddlmZ ddlmZmZ ddlm	Z	m
Z
 ddlmZmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6 ddl7m8Z8 dzddZ9dd Z:dd Z;eej<ddej=dfddZ>eej<dd{ddZ?eej<dd|ddZ@eej<ddejAfddZBeej<d dejAd!fd"d#ZCeej<d$dejAfd%d&ZDeej<d'dejAfd(d)ZEeej<d*d}d-d.ZFeej<d/d~d0d1ZGeej<d2dd3d4ZHeej<d5dd6d7ZIeej<d8dd9d:ZJeej<d;dd<d=ZKeej<d>dd?d@ZLeej<dAddBdCZMeej<dDddEdFZNeej<dGddHdIZOeej<dJddKdLZPeej<dMddNdOZQeej<dPddQdRZReej<dSddTdUZSeej<dVddWdXZTeej<dYddZd[ZUeej<d\dd]d^ZVeej<d_dd`daZWeej<dbddcddZXeej<deddfdgZYeej<dhddidjZZeej<dkddldmZ[eej<dnddodpZ\eej<dqddrdsZ]eej<dtddudvZ^eej<dwddxdyZ_dS )z;
Implementation of method overloads for Generator objects.
    N)types)overload_methodregister_jitable)as_dtype
from_dtype)
next_floatnext_double)is_nonelike)TypingError)TupleUniTuple)"!random_standard_exponential_inv_frandom_standard_exponential_invrandom_standard_exponentialrandom_standard_normal_frandom_standard_gammarandom_standard_normalrandom_uniformrandom_standard_exponential_frandom_standard_gamma_frandom_normalrandom_exponentialrandom_gammarandom_betarandom_powerrandom_frandom_chisquarerandom_standard_cauchyrandom_paretorandom_weibullrandom_laplacerandom_logisticrandom_lognormalrandom_rayleighrandom_standard_trandom_waldrandom_geometricrandom_zipfrandom_triangularrandom_poissonrandom_negative_binomialrandom_logseriesrandom_noncentral_chisquarerandom_noncentral_frandom_binomial)random_methods	the givenc                 C   s|   t |tjr|j}|}t |tr0tt|}nt |tjrH|}t	|}|tj
tjfkr`td|tj
krp| }n|}||fS )a  
        Most of the standard NumPy distributions that accept dtype argument
        only support either np.float32 or np.float64 as dtypes.

        This is a helper function that helps Numba select the proper underlying
        implementation according to provided dtype.
    zLArgument dtype is not one of the expected type(s):  np.float32 or np.float64)
isinstancer   Omittedvaluetyper   npdtypeNumberClassr   Zfloat32float64r
   )Zfunc_32Zfunc_64r6   	dist_nameZnp_dtnb_dtZ	next_func r;   b/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/numba/np/random/generator_methods.py_get_proper_func   s    

r=   c                 C   sF   t t| tot| jtjt| to*| jdkt| tjgsBtdd S )Nr   zdArgument size is not one of the expected type(s):  an integer, an empty tuple or a tuple of integers)	anyr1   r   r6   r   Integerr   countr
   )sizer;   r;   r<   
check_size;   s    
rB   c                    sZ   t  tjr j t |ttfs&|g}t fdd|D sVtd| dd|  dS )z\
    Check if given object is one of the provided types.
    If not raises an TypeError
    c                    s   g | ]}t  |qS r;   )r1   ).0_typeobjr;   r<   
<listcomp>P   s     zcheck_types.<locals>.<listcomp>z	Argument z is not one of thez expected type(s): N)r1   r   r2   r3   listtupler>   r
   )rF   Z	type_listZarg_namer;   rE   r<   check_typesE   s    rJ   ZintegersFc           
         s^  t |tjtjttgd t |tjtjttgd t |tjtgd t|tjrT|j}t|tjrf|j}t|t	rt
t|}|}n"t|tjr|}t|}ntd|tjkrtj ddnLzt|}W n tk
r   tdY nX ttd|j d |j|jt|r4d tjd	f fd
d	}	|	S t| d tjd	f fdd	}	|	S d S )NlowhighendpointzArgument dtype is not one of the expected type(s): np.int32, np.int64, np.int16, np.int8, np.uint32, np.uint64, np.uint16, np.uint8, np.bool_   Zrandom_bounded_uintZ_fillFc                    s   t ||| |sP||d8 }||}||}|| } | j||d|d S ||}||}|| } | j||d|d S d S )N   r   r/   Z_randint_arg_checkbit_generatorinstrK   rL   rA   r6   rM   rngZint_funclower_boundupper_boundr;   r<   impl   s    
 z/NumPyRandomGeneratorType_integers.<locals>.implc                    sz   t ||| |sL||d8 }||}||}|| } | j||||S ||}||}|| } | j||||S d S )NrP   rQ   rS   rV   r;   r<   rY      s    
 )rJ   r   r?   Booleanboolintr1   r2   r3   r4   r   r5   r6   r7   r   r
   Zbool_r/   Zrandom_bounded_bool_fillZiinfo
ValueErrorgetattrbitsminmaxr	   int64rB   )
rT   rK   rL   rA   r6   rM   r:   Z_dtypeZi_inforY   r;   rV   r<   !NumPyRandomGeneratorType_integersV   sd       



  rc   shufflec                 C   s0   t |tjgd t |ttjgd ddd}|S )Nxaxisr   c                 S   s   |dk r||j  }||j d ks(|dk r0tdt|d|}t|d }tt|d ddD ]R}tt	
| j|}||krq`||df |d< ||df ||df< |||df< q`d S )Nr   rP   z)Axis is out of bounds for the given array)r   .rN   .)ndim
IndexErrorr5   ZswapaxesZ
empty_likerangelenr   Zintpr/   Zrandom_intervalrR   )rT   re   rf   zbufijr;   r;   r<   rY      s    
z.NumPyRandomGeneratorType_shuffle.<locals>.impl)r   )rJ   r   Arrayr\   r?   rT   re   rf   rY   r;   r;   r<    NumPyRandomGeneratorType_shuffle   s    
rq   Zpermutationc                    sD   t |tjtjgd t |ttjgd t|tj d fdd	}|S )Nre   rf   r   c                    s4    rt |}| | n| }| j||d |S )N)rf   )r5   Zarangerd   copy)rT   re   rf   Znew_arrZIS_INTr;   r<   rY      s    
z2NumPyRandomGeneratorType_permutation.<locals>.impl)r   )rJ   r   ro   r?   r\   r1   rp   r;   rs   r<   $NumPyRandomGeneratorType_permutation   s
    
rt   randomc                    sj   t tt|d\ t|tjr$|j}t|rFd tj	f fdd	}|S t
| d tj	f fdd	}|S d S )Nru   c                    s    | j S NrR   rT   rA   r6   	dist_funcr:   r;   r<   rY      s    z-NumPyRandomGeneratorType_random.<locals>.implc                    s6   t j||d}|j}t|jD ]} | j||< q|S Nr6   r5   emptyflatri   rA   rR   rT   rA   r6   outout_frm   rz   r;   r<   rY      s
    )r=   r   r   r1   r   r2   r3   r	   r5   r8   rB   rT   rA   r6   rY   r;   ry   r<   NumPyRandomGeneratorType_random   s     r   Zstandard_exponentialzigc                    s   t |tjtgd ttt|\ttt|\ t	|tj
rD|j}t|rjd tjdf fdd	}|S t| d tjdf fdd	}|S d S )Nmethodr   c                    s8   |dkr | j S |dkr,| j S tdd S )Nr   inv$Method must be either 'zig' or 'inv')rR   r]   )rT   rA   r6   r   rz   dist_func_invr:   r;   r<   rY     s
    z;NumPyRandomGeneratorType_standard_exponential.<locals>.implc                    sp   t j||d}|j}|dkr<t|jD ]} | j||< q&n0|dkrdt|jD ]}| j||< qNntd|S )Nr|   r   r   r   )r5   r~   r   ri   rA   rR   r]   )rT   rA   r6   r   r   r   rm   )rz   r   r;   r<   rY     s    )rJ   r   ZUnicodeTypestrr=   r   r   r   r   r1   r2   r3   r	   r5   r8   rB   )rT   rA   r6   r   rY   r;   r   r<   -NumPyRandomGeneratorType_standard_exponential   s$    r   Zstandard_normalc                    sh   t tt|\ t|tjr"|j}t|rDd tj	f fdd	}|S t
| d tj	f fdd	}|S d S )Nc                    s    | j S rv   rw   rx   ry   r;   r<   rY   /  s    z6NumPyRandomGeneratorType_standard_normal.<locals>.implc                    s6   t j||d}|j}t|jD ]} | j||< q|S r{   r}   r   r   r;   r<   rY   5  s
    )r=   r   r   r1   r   r2   r3   r	   r5   r8   rB   r   r;   ry   r<   (NumPyRandomGeneratorType_standard_normal&  s    r   Zstandard_gammac                    s   t |tjtjttgd ttt|\ t	|tj
r:|j}t|r\d tjf fdd	}|S t| d tjf fdd	}|S d S )Nshapec                    s    | j |S rv   rw   )rT   r   rA   r6   ry   r;   r<   rY   J  s    z5NumPyRandomGeneratorType_standard_gamma.<locals>.implc                    s8   t j||d}|j}t|jD ]} | j|||< q|S r{   r}   )rT   r   rA   r6   r   r   rm   r   r;   r<   rY   P  s
    )rJ   r   Floatr?   r\   floatr=   r   r   r1   r2   r3   r	   r5   r8   rB   )rT   r   rA   r6   rY   r;   ry   r<   'NumPyRandomGeneratorType_standard_gamma?  s    r   normal              ?c                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nlocscaler   r   c                 S   s   t | j||S rv   )r   rR   rT   r   r   rA   r;   r;   r<   rY   c  s    z-NumPyRandomGeneratorType_normal.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S r{   )r5   r~   r8   r   ri   rA   r   rR   rT   r   r   rA   r   r   rm   r;   r;   r<   rY   i  s
    )r   r   N)r   r   NrJ   r   r   r?   r\   r   r1   r2   r3   r	   rB   rT   r   r   rA   rY   r;   r;   r<   NumPyRandomGeneratorType_normalZ  s    

r   uniformc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
NrK   rL   r   r   c                 S   s   t | j||| S rv   )r   rR   )rT   rK   rL   rA   r;   r;   r<   rY   |  s    z.NumPyRandomGeneratorType_uniform.<locals>.implc                 S   s@   t j|t jd}|j}t|jD ]}t| j||| ||< q |S r{   )r5   r~   r8   r   ri   rA   r   rR   )rT   rK   rL   rA   r   r   rm   r;   r;   r<   rY     s
    )r   r   N)r   r   Nr   )rT   rK   rL   rA   rY   r;   r;   r<    NumPyRandomGeneratorType_uniforms  s    

r   Zexponentialc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   r   c                 S   s   t | j|S rv   )r   rR   rT   r   rA   r;   r;   r<   rY     s    z2NumPyRandomGeneratorType_exponential.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r{   )r5   r~   r8   r   ri   rA   r   rR   rT   r   rA   r   r   rm   r;   r;   r<   rY     s
    )r   N)r   Nr   rT   r   rA   rY   r;   r;   r<   $NumPyRandomGeneratorType_exponential  s    

r   gammac                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )	Nr   r   r   c                 S   s   t | j||S rv   )r   rR   )rT   r   r   rA   r;   r;   r<   rY     s    z,NumPyRandomGeneratorType_gamma.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S r{   )r5   r~   r8   r   ri   rA   r   rR   )rT   r   r   rA   r   r   rm   r;   r;   r<   rY     s
    )r   N)r   Nr   )rT   r   r   rA   rY   r;   r;   r<   NumPyRandomGeneratorType_gamma  s    

r   betac                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Nabc                 S   s   t | j||S rv   )r   rR   )rT   r   r   rA   r;   r;   r<   rY     s    z+NumPyRandomGeneratorType_beta.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S rv   )r5   r~   r   ri   rA   r   rR   )rT   r   r   rA   r   r   rm   r;   r;   r<   rY     s
    
)N)Nr   )rT   r   r   rA   rY   r;   r;   r<   NumPyRandomGeneratorType_beta  s    

r   fc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Ndfnumdfdenc                 S   s   t | j||S rv   )r   rR   )rT   r   r   rA   r;   r;   r<   rY     s    z(NumPyRandomGeneratorType_f.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S rv   )r5   r~   r   ri   rA   r   rR   )rT   r   r   rA   r   r   rm   r;   r;   r<   rY     s
    
)N)Nr   )rT   r   r   rA   rY   r;   r;   r<   NumPyRandomGeneratorType_f  s    

r   Z	chisquarec                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Ndfc                 S   s   t | j|S rv   )r   rR   rT   r   rA   r;   r;   r<   rY     s    z0NumPyRandomGeneratorType_chisquare.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S rv   )r5   r~   r   ri   rA   r   rR   rT   r   rA   r   r   rm   r;   r;   r<   rY     s
    
)N)Nr   rT   r   rA   rY   r;   r;   r<   "NumPyRandomGeneratorType_chisquare  s    

r   Zstandard_cauchyc                 C   sB   t |tjr|j}t|r(ddd}|S t| ddd}|S d S )Nc                 S   s
   t | jS rv   )r   rR   )rT   rA   r;   r;   r<   rY     s    z6NumPyRandomGeneratorType_standard_cauchy.<locals>.implc                 S   s2   t |}|j}t|jD ]}t| j||< q|S rv   )r5   r~   r   ri   rA   r   rR   )rT   rA   r   r   rm   r;   r;   r<   rY     s
    
)N)N)r1   r   r2   r3   r	   rB   )rT   rA   rY   r;   r;   r<   (NumPyRandomGeneratorType_standard_cauchy  s    

r   Zparetoc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S rv   )r   rR   rT   r   rA   r;   r;   r<   rY     s    z-NumPyRandomGeneratorType_pareto.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S rv   )r5   r~   r   ri   rA   r   rR   rT   r   rA   r   r   rm   r;   r;   r<   rY   $  s
    
)N)Nr   rT   r   rA   rY   r;   r;   r<   NumPyRandomGeneratorType_pareto  s    

r   Zweibullc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S rv   )r   rR   r   r;   r;   r<   rY   4  s    z.NumPyRandomGeneratorType_weibull.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S rv   )r5   r~   r   ri   rA   r   rR   r   r;   r;   r<   rY   :  s
    
)N)Nr   r   r;   r;   r<    NumPyRandomGeneratorType_weibull-  s    

r   powerc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S rv   )r   rR   r   r;   r;   r<   rY   J  s    z,NumPyRandomGeneratorType_power.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S rv   )r5   r~   r   ri   rA   r   rR   r   r;   r;   r<   rY   P  s
    
)N)Nr   r   r;   r;   r<   NumPyRandomGeneratorType_powerC  s    

r   Zlaplacec                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nr   r   r   r   c                 S   s   t | j||S rv   )r    rR   r   r;   r;   r<   rY   a  s    z.NumPyRandomGeneratorType_laplace.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S rv   )r5   r~   r   ri   rA   r    rR   r   r;   r;   r<   rY   g  s
    
)r   r   N)r   r   Nr   r   r;   r;   r<    NumPyRandomGeneratorType_laplaceY  s    

r   Zlogisticc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nr   r   r   r   c                 S   s   t | j||S rv   )r!   rR   r   r;   r;   r<   rY   x  s    z/NumPyRandomGeneratorType_logistic.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S rv   )r5   r~   r   ri   rA   r!   rR   r   r;   r;   r<   rY   ~  s
    
)r   r   N)r   r   Nr   r   r;   r;   r<   !NumPyRandomGeneratorType_logisticp  s    

r   Z	lognormalc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| d	dd}|S d S )
Nmeansigmar   r   c                 S   s   t | j||S rv   )r"   rR   )rT   r   r   rA   r;   r;   r<   rY     s    z0NumPyRandomGeneratorType_lognormal.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S rv   )r5   r~   r   ri   rA   r"   rR   )rT   r   r   rA   r   r   rm   r;   r;   r<   rY     s
    
)r   r   N)r   r   Nr   )rT   r   r   rA   rY   r;   r;   r<   "NumPyRandomGeneratorType_lognormal  s    

r   Zrayleighc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   r   c                 S   s   t | j|S rv   )r#   rR   r   r;   r;   r<   rY     s    z/NumPyRandomGeneratorType_rayleigh.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S rv   )r5   r~   r   ri   rA   r#   rR   r   r;   r;   r<   rY     s
    
)r   N)r   Nr   r   r;   r;   r<   !NumPyRandomGeneratorType_rayleigh  s    

r   Z
standard_tc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t | j|S rv   )r$   rR   r   r;   r;   r<   rY     s    z1NumPyRandomGeneratorType_standard_t.<locals>.implc                 S   s4   t |}|j}t|jD ]}t| j|||< q|S rv   )r5   r~   r   ri   rA   r$   rR   r   r;   r;   r<   rY     s
    
)N)Nr   r   r;   r;   r<   #NumPyRandomGeneratorType_standard_t  s    

r   Zwaldc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Nr   r   c                 S   s   t | j||S rv   )r%   rR   )rT   r   r   rA   r;   r;   r<   rY     s    z+NumPyRandomGeneratorType_wald.<locals>.implc                 S   s6   t |}|j}t|jD ]}t| j||||< q|S rv   )r5   r~   r   ri   rA   r%   rR   )rT   r   r   rA   r   r   rm   r;   r;   r<   rY     s
    
)N)Nr   )rT   r   r   rA   rY   r;   r;   r<   NumPyRandomGeneratorType_wald  s    

r   Z	geometricc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Npc                 S   s   t t| j|S rv   )r5   rb   r&   rR   rT   r   rA   r;   r;   r<   rY     s    z0NumPyRandomGeneratorType_geometric.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r{   )r5   r~   rb   r   ri   rA   r&   rR   rT   r   rA   r   r   rm   r;   r;   r<   rY     s
    )N)Nr   rT   r   rA   rY   r;   r;   r<   "NumPyRandomGeneratorType_geometric  s    

r   Zzipfc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nr   c                 S   s   t t| j|S rv   )r5   rb   r'   rR   r   r;   r;   r<   rY     s    z+NumPyRandomGeneratorType_zipf.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r{   )r5   r~   rb   r   ri   rA   r'   rR   r   r;   r;   r<   rY     s
    )N)Nr   r   r;   r;   r<   NumPyRandomGeneratorType_zipf  s    

r   
triangularc                 C   s   t |tjtjttgd t |tjtjttgd t |tjtjttgd t|tjrZ|j}t	|rpddd}|S t
| ddd}|S d S )	Nleftmoderightc                 S   s   t | j|||S rv   )r(   rR   )rT   r   r   r   rA   r;   r;   r<   rY     s    z1NumPyRandomGeneratorType_triangular.<locals>.implc                 S   s8   t |}|j}t|jD ]}t| j|||||< q|S rv   )r5   r~   r   ri   rA   r(   rR   )rT   r   r   r   rA   r   r   rm   r;   r;   r<   rY     s    
  
)N)Nr   )rT   r   r   r   rA   rY   r;   r;   r<   #NumPyRandomGeneratorType_triangular  s    

r   Zpoissonc                 C   sZ   t |tjtjttgd t|tjr*|j}t	|r@ddd}|S t
| ddd}|S d S )Nlamc                 S   s   t t| j|S rv   )r5   rb   r)   rR   )rT   r   rA   r;   r;   r<   rY   -  s    z.NumPyRandomGeneratorType_poisson.<locals>.implc                 S   s:   t j|t jd}|j}t|jD ]}t| j|||< q |S r{   )r5   r~   rb   r   ri   rA   r)   rR   )rT   r   rA   r   r   rm   r;   r;   r<   rY   3  s
    )N)Nr   )rT   r   rA   rY   r;   r;   r<    NumPyRandomGeneratorType_poisson&  s    

r   Znegative_binomialc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Nnr   c                 S   s   t t| j||S rv   )r5   rb   r*   rR   rT   r   r   rA   r;   r;   r<   rY   D  s    z8NumPyRandomGeneratorType_negative_binomial.<locals>.implc                 S   s<   t j|t jd}|j}t|jD ]}t| j||||< q |S r{   )r5   r~   rb   r   ri   rA   r*   rR   )rT   r   r   rA   r   r   rm   r;   r;   r<   rY   J  s
    )N)Nr   rT   r   r   rA   rY   r;   r;   r<   *NumPyRandomGeneratorType_negative_binomial<  s    

r   Znoncentral_chisquarec                    s   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	dd  t
|rhd fdd	}|S t| d	 fdd	}|S d S )
Nr   noncc                 S   s$   | dkrt d|dk r t dd S )Nr   zdf <= 0nonc < 0r]   )r   r   r;   r;   r<   check_arg_boundsZ  s    zGNumPyRandomGeneratorType_noncentral_chisquare.<locals>.check_arg_boundsc                    s    || t t| j||S rv   )r5   r8   r,   rR   )rT   r   r   rA   r   r;   r<   rY   b  s
    

 z;NumPyRandomGeneratorType_noncentral_chisquare.<locals>.implc                    sF    || t j|t jd}|j}t|jD ]}t| j||||< q*|S r{   )r5   r~   r8   r   ri   rA   r,   rR   )rT   r   r   rA   r   r   rm   r   r;   r<   rY   j  s    
 
)N)NrJ   r   r   r?   r\   r   r1   r2   r3   r   r	   rB   )rT   r   r   rA   rY   r;   r   r<   -NumPyRandomGeneratorType_noncentral_chisquareS  s    
r   Znoncentral_fc                    s   t |tjtjttgd t |tjtjttgd t |tjtjttgd t|tjrZ|j}t	dd  t
|rd	 fdd	}|S t| d
 fdd	}|S d S )Nr   r   r   c                 S   s4   | dkrt d|dkr t d|dk r0t dd S )Nr   z
dfnum <= 0z
dfden <= 0r   r   )r   r   r   r;   r;   r<   r   }  s    z?NumPyRandomGeneratorType_noncentral_f.<locals>.check_arg_boundsc                    s"    ||| t t| j|||S rv   )r5   r8   r-   rR   )rT   r   r   r   rA   r   r;   r<   rY     s    
  z3NumPyRandomGeneratorType_noncentral_f.<locals>.implc                    sJ    ||| t j|t jd}|j}t|jD ]}t| j|||||< q,|S r{   )r5   r~   r8   r   ri   rA   r-   rR   )rT   r   r   r   rA   r   r   rm   r   r;   r<   rY     s      
)N)Nr   )rT   r   r   r   rA   rY   r;   r   r<   %NumPyRandomGeneratorType_noncentral_fu  s    
r   Z	logseriesc                    sn   t |tjtjttgd t|tjr*|j}t	dd  t
|rPd fdd	}|S t| d fdd	}|S d S )	Nr   c                 S   s&   | dk s| dkst | r"tdd S )Nr   rP   zp < 0, p >= 1 or p is NaN)r5   isnanr]   )r   r;   r;   r<   r     s    z<NumPyRandomGeneratorType_logseries.<locals>.check_arg_boundsc                    s    | t t| j|S rv   )r5   rb   r+   rR   r   r   r;   r<   rY     s    z0NumPyRandomGeneratorType_logseries.<locals>.implc                    sB    | t j|t jd}|j}t|jD ]}t| j|||< q(|S r{   )r5   r~   rb   r   ri   rA   r+   rR   r   r   r;   r<   rY     s    )N)Nr   r   r;   r   r<   "NumPyRandomGeneratorType_logseries  s    
r   Zbinomialc                 C   sr   t |tjtjttgd t |tjtjttgd t|tjrB|j}t	|rXddd}|S t
| ddd}|S d S )Nr   r   c                 S   s   t t| j||S rv   )r5   rb   r.   rR   r   r;   r;   r<   rY     s    z/NumPyRandomGeneratorType_binomial.<locals>.implc                 S   s6   t j|t jd}t |D ]}t| j||||< q|S r{   )r5   r~   rb   Zndindexr.   rR   )rT   r   r   rA   r   rm   r;   r;   r<   rY     s    )N)Nr   r   r;   r;   r<   !NumPyRandomGeneratorType_binomial  s    

r   )r0   )r   )r   )r   r   N)r   r   N)r   N)r   N)N)N)N)N)N)N)N)r   r   N)r   r   N)r   r   N)r   N)N)N)N)N)N)N)N)N)N)N)N)`__doc__numpyr5   Z
numba.corer   Znumba.core.extendingr   r   Znumba.np.numpy_supportr   r   Znumba.np.random.generator_corer   r   r	   Znumba.core.errorsr
   Znumba.core.types.containersr   r   Znumba.np.random.distributionsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   Znumba.np.randomr/   r=   rB   rJ   ZNumPyRandomGeneratorTyperb   rc   rq   rt   r8   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r;   r;   r;   r<   <module>   s   


 W



-


  
  




















!
$

