
    xKg                     \   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 dSdZ9d Z:d Z; eejx                  d      dejz                  dfd       Z> eejx                  d      dTd       Z? eejx                  d      dTd       Z@ eejx                  d      dej                  fd       ZB eejx                  d      dej                  dfd       ZC eejx                  d      dej                  fd       ZD eejx                  d      dej                  fd       ZE eejx                  d      	 	 dUd        ZF eejx                  d!      	 	 dUd"       ZG eejx                  d#      dVd$       ZH eejx                  d%      dVd&       ZI eejx                  d'      dWd(       ZJ eejx                  d)      dWd*       ZK eejx                  d+      dWd,       ZL eejx                  d-      dWd.       ZM eejx                  d/      dWd0       ZN eejx                  d1      dWd2       ZO eejx                  d3      dWd4       ZP eejx                  d5      dUd6       ZQ eejx                  d7      dUd8       ZR eejx                  d9      dUd:       ZS eejx                  d;      dVd<       ZT eejx                  d=      dWd>       ZU eejx                  d?      dWd@       ZV eejx                  dA      dWdB       ZW eejx                  dC      dWdD       ZX eejx                  dE      dWdF       ZY eejx                  dG      dWdH       ZZ eejx                  dI      dWdJ       Z[ eejx                  dK      dWdL       Z\ eejx                  dM      dWdN       Z] eejx                  dO      dWdP       Z^ eejx                  dQ      dWdR       Z_y)Xz;
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_methodsc                    t        |t        j                        r|j                  }|}t        |t              rt        t        j                  |            }n't        |t        j                        r|}t        |      }|t        j                  t        j                  fvrt        d      |t        j                  k(  r| }|fS |}|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   float32float64r   )func_32func_64r7   	dist_namenp_dtnb_dt	next_funcs          e/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/np/random/generator_methods.py_get_proper_funcrB      s     %'E%288E?+	E5,,	-RZZ,, 6 7 	7 

	 e 	e    c                    t        t        | t              xr$ t        | j                  t        j
                        t        | t              xr | j                  dk(  t        | t        j
                        g      st        d      y )Nr   zdArgument size is not one of the expected type(s):  an integer, an empty tuple or a tuple of integers)	anyr2   r   r7   r   Integerr   countr   )sizes    rA   
check_sizerI   ;   sp    
4* 64::u}}54';DJJ!O4/1 2  O P 	P	2rC   c           	          t        | t        j                        r| j                  } t        |t        t
        f      s|g}t        |D cg c]  }t        | |       c}      st        d| dd| z         yc c}w )z\
    Check if given object is one of the provided types.
    If not raises an TypeError
    z	Argument z is not one of thez expected type(s): N)r2   r   r3   r4   listtuplerE   r   )obj	type_listarg_name_types       rA   check_typesrQ   E   s    
 #u}}%iii$/K	I>I5
3&I>?IhZ/AB/	{;< = 	= @>s   	A9integersFc                 .  
 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                        r|j                  }t        |t        j                        r|j                  }t        |t              r!t        t        j                  |            }|}n3t        |t        j                        r|}t        |      }nt        d      |t        j                   k(  rt"        j$                  
ddnL	 t        j&                  |      }t+        t"        d|j,                   d      
|j.                  |j0                  t3        |      rd t        j4                  d	f
fd
	}	|	S t7        |       d t        j4                  d	f
fd	}	|	S # t(        $ r t        d      w xY w)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_   random_bounded_uint_fillFc                    t        j                  |||	       |s9| |d      z  } ||      } ||      }||z
  } | j                  ||d|      d   S  ||      } ||      }||z
  } | j                  ||d|      d   S )N   r   r0   _randint_arg_checkbit_generator
instrT   rU   rH   r7   rV   rngint_funclower_boundupper_bounds
          rA   implz/NumPyRandomGeneratorType_integers.<locals>.impl   s    --c4.9;Ha CjT{Sj 2 2CaGJJCjT{Sj 2 2CaGJJrC   c                     t        j                  |||	       |s6| |d      z  } ||      } ||      }||z
  } | j                  ||||      S  ||      } ||      }||z
  } | j                  ||||      S )Nr\   r]   r`   s
          rA   rf   z/NumPyRandomGeneratorType_integers.<locals>.impl   s    --c4.9;Ha CjT{Sj 2 2CdEJJCjT{Sj 2 2CdEJJrC   )rQ   r   rF   Booleanboolintr2   r3   r4   r5   r   r6   r7   r8   r   r   bool_r0   random_bounded_bool_filliinfo
ValueErrorgetattrbitsminmaxr
   int64rI   )ra   rT   rU   rH   r7   rV   r?   _dtypei_inforf   rc   rd   re   s             @@@rA   !NumPyRandomGeneratorType_integersrv   V   s    emmmmT30168u}}emmS"#)+5==$/<$&zz%'%288E?+	E5,,	-% % & 	& !::	*XXf%F >0UCEjjjj4'+xx%	K 4'+xx%	K ]  	* ) * *	*s   (G? ?Hshufflec                     t        |t        j                  gd       t        |t        t        j                  gd       dd}|S )Nxaxisc                    |dk  r||j                   z   }||j                   dz
  kD  s|dk  rt        d      t        j                  |d|      }t        j                  |d         }t        t        |      dz
  dd      D ]X  }t        j                  t        j                  | j                  |            }||k(  r<||df   |d<   ||df   ||df<   |||df<   Z y )Nr   r\   z)Axis is out of bounds for the given array)r   .rW   .)ndim
IndexErrorr6   swapaxes
empty_likerangelenr   intpr0   random_intervalr_   )ra   ry   rz   zbufijs          rA   rf   z.NumPyRandomGeneratorType_shuffle.<locals>.impl   s    !8!&&=D!&&1*qHIIKK1d#mmAfI&s1vz1b)A

>99$:L:L:;= >AAvCyCH!S&	AafIAafI *rC   r   )rQ   r   Arrayrj   rF   )ra   ry   rz   rf   s       rA    NumPyRandomGeneratorType_shuffler      s5    EKK=#&sEMM*F3$ KrC   permutationc                     t        |t        j                  t        j                  gd       t        |t        t        j                  gd       t        |t        j                        dfd	}|S )Nry   rz   c                     r(t        j                  |      }| j                  |       |S |j                         }| j                  ||       |S )N)rz   )r6   arangerw   copy)ra   ry   rz   new_arrIS_INTs       rA   rf   z2NumPyRandomGeneratorType_permutation.<locals>.impl   sH    iilGLL!  ffhGLLtL,rC   r   )rQ   r   r   rF   rj   r2   )ra   ry   rz   rf   r   s       @rA   $NumPyRandomGeneratorType_permutationr      sM    EKK/5sEMM*F35==)F KrC   randomc                    t        t        t        |d      \  t        |t        j
                        r|j                  }t        |      rd t        j                  ffd	}|S t        |       d t        j                  ffd	}|S )Nr   c                 4      | j                               S Nr_   ra   rH   r7   	dist_funcr?   s      rA   rf   z-NumPyRandomGeneratorType_random.<locals>.impl       4#5#5677rC   c                     t        j                  ||      }|j                  }t        |j                        D ]  } | j
                        ||<    |S Nr7   r6   emptyflatr   rH   r_   ra   rH   r7   outout_fr   r   s         rA   rf   z-NumPyRandomGeneratorType_random.<locals>.impl   G    ((4u-CHHE388_$T%7%78a %JrC   )rB   r   r	   r2   r   r3   r4   r
   r6   r:   rI   ra   rH   r7   rf   r   r?   s       @@rA   NumPyRandomGeneratorType_randomr      sj    '
K(-x9Iu$&zz4 

 	84 

 	 rC   standard_exponentialzigc                    t        |t        j                  t        gd       t	        t
        t        |      \  t	        t        t        |      \  t        |t        j                        r|j                  }t        |      rd t        j                  dffd	}|S t        |       d t        j                  dffd	}|S )Nmethodr   c                     |dk(  r  | j                               S |dk(  r  | j                               S t        d      )Nr   inv$Method must be either 'zig' or 'inv')r_   rn   )ra   rH   r7   r   r   dist_func_invr?   s       rA   rf   z;NumPyRandomGeneratorType_standard_exponential.<locals>.impl  sI    Yt'9'9:;;5]4+=+=>?? !GHHrC   c                 8   t        j                  ||      }|j                  }|dk(  r1t        |j                        D ]  } | j
                        ||<    |S |dk(  r1t        |j                        D ]  } | j
                        ||<    |S t        d      )Nr   r   r   r   )r6   r   r   r   rH   r_   rn   )	ra   rH   r7   r   r   r   r   r   r   s	          rA   rf   z;NumPyRandomGeneratorType_standard_exponential.<locals>.impl  s    ((4u-CHHEsxxA(););<E!H ) J 5sxxA,T-?-?@E!H ) J !!GHHrC   )rQ   r   UnicodeTypestrrB   r   r   r   r   r2   r3   r4   r
   r6   r:   rI   )ra   rH   r7   r   rf   r   r   r?   s        @@@rA   -NumPyRandomGeneratorType_standard_exponentialr      s     **C0(;+)'M5 ((E(C(-/Iu $&zz4 

5 	I 4 

5 	 rC   standard_normalc                    t        t        t        |      \  t        |t        j
                        r|j                  }t        |      rd t        j                  ffd	}|S t        |       d t        j                  ffd	}|S )Nc                 4      | j                               S r   r   r   s      rA   rf   z6NumPyRandomGeneratorType_standard_normal.<locals>.impl/  r   rC   c                     t        j                  ||      }|j                  }t        |j                        D ]  } | j
                        ||<    |S r   r   r   s         rA   rf   z6NumPyRandomGeneratorType_standard_normal.<locals>.impl5  r   rC   )rB   r   r   r2   r   r3   r4   r
   r6   r:   rI   r   s       @@rA   (NumPyRandomGeneratorType_standard_normalr   &  sl    '(@(>(-/Iu $&zz4 

 	84 

 	 rC   standard_gammac                 z   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	}|S t        |       d t        j                  ffd	}|S )Nshapec                 6      | j                   |            S r   r   )ra   r   rH   r7   r   r?   s       rA   rf   z5NumPyRandomGeneratorType_standard_gamma.<locals>.implJ  s    4#5#5u=>>rC   c                     t        j                  ||      }|j                  }t        |j                        D ]  } | j
                  |      ||<    |S r   r   )ra   r   rH   r7   r   r   r   r   s          rA   rf   z5NumPyRandomGeneratorType_standard_gamma.<locals>.implP  sI    ((4u-CHHE388_$T%7%7?a %JrC   )rQ   r   FloatrF   rj   floatrB   r   r   r2   r3   r4   r
   r6   r:   rI   )ra   r   rH   r7   rf   r   r?   s        @@rA   'NumPyRandomGeneratorType_standard_gammar   ?  s     U]]C?I'(?(=(-/Iu $&zz4#'rzz 	?4#'rzz 	 rC   normalc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nlocscalec                 0    t        | j                  ||      S r   )r   r_   ra   r   r   rH   s       rA   rf   z-NumPyRandomGeneratorType_normal.<locals>.implc  s     !3!3S%@@rC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r:   r   r   rH   r   r_   ra   r   r   rH   r   r   r   s          rA   rf   z-NumPyRandomGeneratorType_normal.<locals>.impli  sN    ((4rzz2CHHE388_(););S%Ha %JrC   g              ?NrQ   r   r   rF   rj   r   r2   r3   r4   r
   rI   ra   r   r   rH   rf   s        rA   NumPyRandomGeneratorType_normalr   Z  s|     ekk5==#u=uEU]]C?I$&zz4	A4	 rC   uniformc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )NrT   rU   c                 6    t        | j                  |||z
        S r   )r   r_   )ra   rT   rU   rH   s       rA   rf   z.NumPyRandomGeneratorType_uniform.<locals>.impl|  s    !$"4"4c4#:FFrC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  |||z
        ||<   ! |S r   )r6   r   r:   r   r   rH   r   r_   )ra   rT   rU   rH   r   r   r   s          rA   rf   z.NumPyRandomGeneratorType_uniform.<locals>.impl  sR    ((4rzz2CHHE388_)$*<*<c4#:Na %JrC   r   r   )ra   rT   rU   rH   rf   s        rA    NumPyRandomGeneratorType_uniformr   s  s|     ekk5==#u=uEu{{EMM3>G$&zz4	G4	 rC   exponentialc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   c                 .    t        | j                  |      S r   )r   r_   ra   r   rH   s      rA   rf   z2NumPyRandomGeneratorType_exponential.<locals>.impl  s    %d&8&8%@@rC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  |      ||<    |S r   )r6   r   r:   r   r   rH   r   r_   ra   r   rH   r   r   r   s         rA   rf   z2NumPyRandomGeneratorType_exponential.<locals>.impl  sL    ((4rzz2CHHE388_-d.@.@%Ha %JrC   r   Nr   ra   r   rH   rf   s       rA   $NumPyRandomGeneratorType_exponentialr     s]    U]]C?I$&zz4	A4	 rC   gammac                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   r   c                 0    t        | j                  ||      S r   )r   r_   )ra   r   r   rH   s       rA   rf   z,NumPyRandomGeneratorType_gamma.<locals>.impl  s     2 2E5AArC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r:   r   r   rH   r   r_   )ra   r   r   rH   r   r   r   s          rA   rf   z,NumPyRandomGeneratorType_gamma.<locals>.impl  sN    ((4rzz2CHHE388_'(:(:E5Ia %JrC   r   r   )ra   r   r   rH   rf   s        rA   NumPyRandomGeneratorType_gammar     sz    U]]C?IU]]C?I$&zz4	B4	 rC   betac                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nabc                 0    t        | j                  ||      S r   )r   r_   )ra   r   r   rH   s       rA   rf   z+NumPyRandomGeneratorType_beta.<locals>.impl  s    t111a88rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r   r   rH   r   r_   )ra   r   r   rH   r   r   r   s          rA   rf   z+NumPyRandomGeneratorType_beta.<locals>.impl  sG    ((4.CHHE388_&t'9'91a@a %JrC   r   r   )ra   r   r   rH   rf   s        rA   NumPyRandomGeneratorType_betar     sy    EKKU;SAEKKU;SA$&zz4	94	 rC   fc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Ndfnumdfdenc                 0    t        | j                  ||      S r   )r   r_   )ra   r   r   rH   s       rA   rf   z(NumPyRandomGeneratorType_f.<locals>.impl  s    D..u==rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r   r   rH   r   r_   )ra   r   r   rH   r   r   r   s          rA   rf   z(NumPyRandomGeneratorType_f.<locals>.impl  sG    ((4.CHHE388_#D$6$6uEa %JrC   r   r   )ra   r   r   rH   rf   s        rA   NumPyRandomGeneratorType_fr     sy    U]]C?IU]]C?I$&zz4	>4	 rC   	chisquarec                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Ndfc                 .    t        | j                  |      S r   )r   r_   ra   r   rH   s      rA   rf   z0NumPyRandomGeneratorType_chisquare.<locals>.impl  s    #D$6$6;;rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  |      ||<    |S r   )r6   r   r   r   rH   r   r_   ra   r   rH   r   r   r   s         rA   rf   z0NumPyRandomGeneratorType_chisquare.<locals>.impl  sE    ((4.CHHE388_+D,>,>Ca %JrC   r   r   ra   r   rH   rf   s       rA   "NumPyRandomGeneratorType_chisquarer     s\    U[[%--e<dC$&zz4	<4	 rC   standard_cauchyc                     t        |t        j                        r|j                  }t	        |      rdd}|S t        |       dd}|S )Nc                 ,    t        | j                        S r   )r   r_   )ra   rH   s     rA   rf   z6NumPyRandomGeneratorType_standard_cauchy.<locals>.impl  s    )$*<*<==rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                        ||<    |S r   )r6   r   r   r   rH   r   r_   )ra   rH   r   r   r   s        rA   rf   z6NumPyRandomGeneratorType_standard_cauchy.<locals>.impl  sC    ((4.CHHE388_1$2D2DEa %JrC   r   )r2   r   r3   r4   r
   rI   )ra   rH   rf   s      rA   (NumPyRandomGeneratorType_standard_cauchyr     sA     $&zz4	>4	 rC   paretoc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   c                 .    t        | j                  |      S r   )r   r_   ra   r   rH   s      rA   rf   z-NumPyRandomGeneratorType_pareto.<locals>.impl  s     !3!3Q77rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  |      ||<    |S r   )r6   r   r   r   rH   r   r_   ra   r   rH   r   r   r   s         rA   rf   z-NumPyRandomGeneratorType_pareto.<locals>.impl$  sE    ((4.CHHE388_(););Q?a %JrC   r   r   ra   r   rH   rf   s       rA   NumPyRandomGeneratorType_paretor    s\    EKKU;SA$&zz4	84	 rC   weibullc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   c                 .    t        | j                  |      S r   )r    r_   r   s      rA   rf   z.NumPyRandomGeneratorType_weibull.<locals>.impl4  s    !$"4"4a88rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  |      ||<    |S r   )r6   r   r   r   rH   r    r_   r  s         rA   rf   z.NumPyRandomGeneratorType_weibull.<locals>.impl:  sE    ((4.CHHE388_)$*<*<a@a %JrC   r   r   r  s       rA    NumPyRandomGeneratorType_weibullr  -  s\    EKKU;SA$&zz4	94	 rC   powerc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   c                 .    t        | j                  |      S r   )r   r_   r   s      rA   rf   z,NumPyRandomGeneratorType_power.<locals>.implJ  s     2 2A66rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  |      ||<    |S r   )r6   r   r   r   rH   r   r_   r  s         rA   rf   z,NumPyRandomGeneratorType_power.<locals>.implP  sE    ((4.CHHE388_'(:(:A>a %JrC   r   r   r  s       rA   NumPyRandomGeneratorType_powerr  C  s\    EKKU;SA$&zz4	74	 rC   laplacec                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   r   c                 0    t        | j                  ||      S r   )r!   r_   r   s       rA   rf   z.NumPyRandomGeneratorType_laplace.<locals>.impla  s    !$"4"4c5AArC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r   r   rH   r!   r_   r   s          rA   rf   z.NumPyRandomGeneratorType_laplace.<locals>.implg  sG    ((4.CHHE388_)$*<*<c5Ia %JrC   r   r   r   s        rA    NumPyRandomGeneratorType_laplacer  Y  sz    ekk5==#u=uEU]]C?I$&zz4	B4	 rC   logisticc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   r   c                 0    t        | j                  ||      S r   )r"   r_   r   s       rA   rf   z/NumPyRandomGeneratorType_logistic.<locals>.implx  s    "4#5#5sEBBrC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r   r   rH   r"   r_   r   s          rA   rf   z/NumPyRandomGeneratorType_logistic.<locals>.impl~  sG    ((4.CHHE388_*4+=+=sEJa %JrC   r   r   r   s        rA   !NumPyRandomGeneratorType_logisticr  p  sz    ekk5==#u=uEU]]C?I$&zz4	C4	 rC   	lognormalc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nmeansigmac                 0    t        | j                  ||      S r   )r#   r_   )ra   r  r  rH   s       rA   rf   z0NumPyRandomGeneratorType_lognormal.<locals>.impl  s    #D$6$6eDDrC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r   r   rH   r#   r_   )ra   r  r  rH   r   r   r   s          rA   rf   z0NumPyRandomGeneratorType_lognormal.<locals>.impl  sG    ((4.CHHE388_+D,>,>eLa %JrC   r   r   )ra   r  r  rH   rf   s        rA   "NumPyRandomGeneratorType_lognormalr    sz    u{{EMM3>GU]]C?I$&zz4	E4	 rC   rayleighc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   c                 .    t        | j                  |      S r   )r$   r_   r   s      rA   rf   z/NumPyRandomGeneratorType_rayleigh.<locals>.impl  s    "4#5#5u==rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  |      ||<    |S r   )r6   r   r   r   rH   r$   r_   r   s         rA   rf   z/NumPyRandomGeneratorType_rayleigh.<locals>.impl  sE    ((4.CHHE388_*4+=+=uEa %JrC   r   r   r   s       rA   !NumPyRandomGeneratorType_rayleighr#    s\    U]]C?I$&zz4	>4	 rC   
standard_tc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   c                 .    t        | j                  |      S r   )r%   r_   r   s      rA   rf   z1NumPyRandomGeneratorType_standard_t.<locals>.impl  s    $T%7%7<<rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  |      ||<    |S r   )r6   r   r   r   rH   r%   r_   r   s         rA   rf   z1NumPyRandomGeneratorType_standard_t.<locals>.impl  sE    ((4.CHHE388_,T-?-?Da %JrC   r   r   r   s       rA   #NumPyRandomGeneratorType_standard_tr(    s\    U[[%--e<dC$&zz4	=4	 rC   waldc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr  r   c                 0    t        | j                  ||      S r   )r&   r_   )ra   r  r   rH   s       rA   rf   z+NumPyRandomGeneratorType_wald.<locals>.impl  s    t114??rC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r   r   rH   r&   r_   )ra   r  r   rH   r   r   r   s          rA   rf   z+NumPyRandomGeneratorType_wald.<locals>.impl  sG    ((4.CHHE388_&t'9'94Ga %JrC   r   r   )ra   r  r   rH   rf   s        rA   NumPyRandomGeneratorType_waldr-    sz    u{{EMM3>GU]]C?I$&zz4	@4	 rC   	geometricc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Npc                 T    t        j                  t        | j                  |            S r   )r6   rs   r'   r_   )ra   r0  rH   s      rA   rf   z0NumPyRandomGeneratorType_geometric.<locals>.impl  s    88,T-?-?CDDrC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  |      ||<    |S r   )r6   r   rs   r   r   rH   r'   r_   )ra   r0  rH   r   r   r   s         rA   rf   z0NumPyRandomGeneratorType_geometric.<locals>.impl  sL    ((4rxx0CHHE388_+D,>,>Ba %JrC   r   r   )ra   r0  rH   rf   s       rA   "NumPyRandomGeneratorType_geometricr3    s]    EKKU;SA$&zz4	E4	 rC   zipfc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nr   c                 T    t        j                  t        | j                  |            S r   )r6   rs   r(   r_   r   s      rA   rf   z+NumPyRandomGeneratorType_zipf.<locals>.impl  s    88K(:(:A>??rC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  |      ||<    |S r   )r6   r   rs   r   r   rH   r(   r_   r  s         rA   rf   z+NumPyRandomGeneratorType_zipf.<locals>.impl  sL    ((4rxx0CHHE388_&t'9'91=a %JrC   r   r   r  s       rA   NumPyRandomGeneratorType_zipfr8    s]    EKKU;SA$&zz4	@4	 rC   
triangularc                    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                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nleftmoderightc                 2    t        | j                  |||      S r   )r)   r_   )ra   r;  r<  r=  rH   s        rA   rf   z1NumPyRandomGeneratorType_triangular.<locals>.impl  s    $T%7%7tUKKrC   c                     t        j                  |      }|j                  }t        |j                        D ]  }t        | j                  |||      ||<    |S r   )r6   r   r   r   rH   r)   r_   )ra   r;  r<  r=  rH   r   r   r   s           rA   rf   z1NumPyRandomGeneratorType_triangular.<locals>.impl  sO    ((4.CHHE388_,T-?-?-14@a % JrC   r   r   )ra   r;  r<  r=  rH   rf   s         rA   #NumPyRandomGeneratorType_triangularr@    s    u{{EMM3>Gu{{EMM3>GU]]C?I$&zz4	L4	 rC   poissonc                     t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nlamc                 T    t        j                  t        | j                  |            S r   )r6   rs   r*   r_   )ra   rC  rH   s      rA   rf   z.NumPyRandomGeneratorType_poisson.<locals>.impl-  s    88N4+=+=sCDDrC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  |      ||<    |S r   )r6   r   rs   r   r   rH   r*   r_   )ra   rC  rH   r   r   r   s         rA   rf   z.NumPyRandomGeneratorType_poisson.<locals>.impl3  sL    ((4rxx0CHHE388_)$*<*<cBa %JrC   r   r   )ra   rC  rH   rf   s       rA    NumPyRandomGeneratorType_poissonrF  &  s]    ekk5==#u=uE$&zz4	E4	 rC   negative_binomialc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )Nnr0  c                 V    t        j                  t        | j                  ||            S r   )r6   rs   r+   r_   ra   rI  r0  rH   s       rA   rf   z8NumPyRandomGeneratorType_negative_binomial.<locals>.implD  s!    884T5G5GANOOrC   c                     t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   rs   r   r   rH   r+   r_   )ra   rI  r0  rH   r   r   r   s          rA   rf   z8NumPyRandomGeneratorType_negative_binomial.<locals>.implJ  sN    ((4rxx0CHHE388_3D4F4F1Ma %JrC   r   r   ra   rI  r0  rH   rf   s        rA   *NumPyRandomGeneratorType_negative_binomialrN  <  sz    EKKU;SAEKKU;SA$&zz4	P4	 rC   noncentral_chisquarec                    t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        d        t        |      rdfd	}|S t        |       dfd	}|S )Nr   noncc                 D    | dk  rt        d      |dk  rt        d      y )Nr   zdf <= 0nonc < 0rn   )r   rQ  s     rA   check_arg_boundszGNumPyRandomGeneratorType_noncentral_chisquare.<locals>.check_arg_boundsZ  s+    7Y''!8Z(( rC   c                 j     ||       t        j                  t        | j                  ||            S r   )r6   r:   r-   r_   )ra   r   rQ  rH   rU  s       rA   rf   z;NumPyRandomGeneratorType_noncentral_chisquare.<locals>.implb  s6    R&::9$:L:L:<dD E ErC   c                      ||       t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  ||      ||<    |S r   )r6   r   r:   r   r   rH   r-   r_   )ra   r   rQ  rH   r   r   r   rU  s          rA   rf   z;NumPyRandomGeneratorType_noncentral_chisquare.<locals>.implj  s_    R&((4rzz2CHHE388_6t7I7I794Aa % JrC   r   rQ   r   r   rF   rj   r   r2   r3   r4   r   r
   rI   )ra   r   rQ  rH   rf   rU  s        @rA   -NumPyRandomGeneratorType_noncentral_chisquarerY  S  s    U[[%--e<dCu{{EMM3>G$&zz) ) 4	E 4	 rC   noncentral_fc                    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                        r|j                  }t        d        t        |      rdfd	}|S t        |       dfd	}|S )Nr   r   rQ  c                 d    | dk  rt        d      |dk  rt        d      |dk  rt        d      y )Nr   z
dfnum <= 0z
dfden <= 0rS  rT  )r   r   rQ  s      rA   rU  z?NumPyRandomGeneratorType_noncentral_f.<locals>.check_arg_bounds}  s=    A:\**A:\**!8Z(( rC   c                 n     |||       t        j                  t        | j                  |||            S r   )r6   r:   r.   r_   )ra   r   r   rQ  rH   rU  s        rA   rf   z3NumPyRandomGeneratorType_noncentral_f.<locals>.impl  s:    UE40::1$2D2D27F G GrC   c                      |||       t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  |||      ||<    |S r   )r6   r   r:   r   r   rH   r.   r_   )	ra   r   r   rQ  rH   r   r   r   rU  s	           rA   rf   z3NumPyRandomGeneratorType_noncentral_f.<locals>.impl  sc    UE40((4rzz2CHHE388_.t/A/A/4eTCa % JrC   r   rX  )ra   r   r   rQ  rH   rf   rU  s         @rA   %NumPyRandomGeneratorType_noncentral_fr_  u  s    U]]C?IU]]C?Iu{{EMM3>G$&zz) ) 4	G 4	 rC   	logseriesc                    t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        d        t        |      rdfd	}|S t        |       dfd	}|S )Nr0  c                 X    | dk  s| dk\  st        j                  |       rt        d      y )Nr   r\   zp < 0, p >= 1 or p is NaN)r6   isnanrn   )r0  s    rA   rU  z<NumPyRandomGeneratorType_logseries.<locals>.check_arg_bounds  s*    q5AFbhhqk899 *rC   c                 f     |       t        j                  t        | j                  |            S r   )r6   rs   r,   r_   )ra   r0  rH   rU  s      rA   rf   z0NumPyRandomGeneratorType_logseries.<locals>.impl  s(    Q88,T-?-?CDDrC   c                      |       t        j                  |t         j                        }|j                  }t	        |j
                        D ]  }t        | j                  |      ||<    |S r   )r6   r   rs   r   r   rH   r,   r_   )ra   r0  rH   r   r   r   rU  s         rA   rf   z0NumPyRandomGeneratorType_logseries.<locals>.impl  sU    Q((4rxx0CHHE388_+D,>,>Ba %JrC   r   rX  )ra   r0  rH   rf   rU  s       @rA   "NumPyRandomGeneratorType_logseriesrf    st    EKKU;SA$&zz: : 4	E 4	 rC   binomialc                 f   t        |t        j                  t        j                  t        t
        gd       t        |t        j                  t        j                  t        t
        gd       t        |t        j                        r|j                  }t        |      rdd}|S t        |       dd}|S )NrI  r0  c                 V    t        j                  t        | j                  ||            S r   )r6   rs   r/   r_   rK  s       rA   rf   z/NumPyRandomGeneratorType_binomial.<locals>.impl  s     88OD,>,>1EFFrC   c                     t        j                  |t         j                        }t        j                  |      D ]  }t	        | j
                  ||      ||<    |S r   )r6   r   rs   ndindexr/   r_   )ra   rI  r0  rH   r   r   s         rA   rf   z/NumPyRandomGeneratorType_binomial.<locals>.impl  sF    ((4rxx0CZZ%(););QBA &JrC   r   r   rM  s        rA   !NumPyRandomGeneratorType_binomialrl    sz    EKKU;SAEKKU;SA$&zz4	G4	
 rC   )z	the givenr   r   r   r   )`__doc__numpyr6   
numba.corer   numba.core.extendingr   r   numba.np.numpy_supportr   r   numba.np.random.generator_corer   r	   r
   numba.core.errorsr   numba.core.types.containersr   r   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/   numba.np.randomr0   rB   rI   rQ   NumPyRandomGeneratorTypers   rv   r   r   r:   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r#  r(  r-  r3  r8  r@  rF  rN  rY  r_  rf  rl   rC   rA   <module>ry     s     B 7 B . ) 7H H H H H H H H H +>P=" //<<@,.HHuP =Pn //; <8 //? @( //:/32::  ;. //1GH=A8:

9>) I)Z //1BC8<BJJ  D0 //1AB>B24** C4 //:9<)- ;0 //;9<*. <0 //? @, //9 :. //8 9. //5 6. //= >* //1BC D* //: ;* //; <* //9 :* //; <, //< =, //= >, //< =* //> ?* //8 9, //= >* //8 9* //> ?0 //; <* //1DE F, //1GH IB //@! A!H //= >8 //< =rC   