o
    8ήc	                     @   s   d Z ddl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 ddlmZ ddlmZ dd	lmZmZ dddZeejddejfddZdS )z;
Implementation of method overloads for Generator objects.
    N)types)overload_method)as_dtype
from_dtype)
next_floatnext_double)is_nonelike)TypingError)TupleUniTuple	the givenc                 C   s   t |tjr	|j}t |tjst|}t|}|}n|}t|}t|}|tj	kr1| }||fS |tj
kr<|}||fS td| d| d)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.
    zUnsupported dtype z for z distribution)
isinstancer   OmittedvalueTypenpdtyper   r   float32float64r	   )func_32func_64r   	dist_namedtnb_dtnp_dt	next_func r   H/tmp/pip-target-vg8gfxp4/lib/python/numba/np/random/generator_methods.py_get_proper_func   s$   



r   randomc                    s   t tt|d\ t|tjr|j}t|r#d tj	f fdd	}|S t
t|to/t|jtjt|to8|jdkt|tjgsDJ dd tj	f fdd	}|S )Nr   c                    s    | j S )N)bit_generator)instsizer   	dist_funcr   r   r   impl9   s   z-NumPyRandomGeneratorType_random.<locals>.implr   zOSize argument either of None, an integer, an empty tuple or a tuple of integersc                    s0   t j||d}t |D ]	} | j||< q|S )N)r   )r   emptyndindexr    )r!   r"   r   outi)r$   r   r   r%   D   s   )r   r   r   r   r   r   r   r   r   r   anyr   r   Integerr
   count)r!   r"   r   r%   r   r#   r   NumPyRandomGeneratorType_random1   s"   
r-   )r   )__doc__numpyr   
numba.corer   numba.core.extendingr   numba.np.numpy_supportr   r   numba.np.random.generator_corer   r   r   numba.core.errorsr	   numba.core.types.containersr
   r   r   NumPyRandomGeneratorTyper   r-   r   r   r   r   <module>   s    

"