403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/numpy/random/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/numpy/random/tests/__pycache__/test_random.cpython-312.pyc
�

	�g���P�ddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlZGd�d�ZGd�d�ZGd�d	�ZGd
�d�ZGd�d
�ZGd�d�ZGd�d�Zej.j1e
d��Gd�d��ZGd�d�Zy)�N)	�assert_�
assert_raises�assert_equal�assert_warns�assert_no_warnings�assert_array_equal�assert_array_almost_equal�suppress_warnings�IS_WASM)�randomc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�TestSeedc���tjjd�}t|j	d�d�tjjd�}t|j	d�d�y)Nr��i����i�)�npr�RandomStater�randint��self�ss  �@C:\Python312\Lib\site-packages\numpy/random/tests/test_random.py�test_scalarzTestSeed.test_scalarsN���I�I�!�!�!�$���Q�Y�Y�t�_�c�*��I�I�!�!�*�-���Q�Y�Y�t�_�c�*�c��tjjtd��}t	|jd�d�tjjtjd��}t	|jd�d�tjjdg�}t	|jd�d�tjjdg�}t	|jd�d�y)N�
ri�ri�ri	)rrr�rangerr�arangers  r�
test_arrayzTestSeed.test_arrays����I�I�!�!�%��)�,���Q�Y�Y�t�_�c�*��I�I�!�!�"�)�)�B�-�0���Q�Y�Y�t�_�c�*��I�I�!�!�1�#�&���Q�Y�Y�t�_�c�*��I�I�!�!�:�,�/���Q�Y�Y�t�_�c�*rc��tttjjd�tt
tjjd�y)N������r�	TypeErrorrrr�
ValueError�rs r�test_invalid_scalarzTestSeed.test_invalid_scalar s.���i����!6�!6��=��j�"�)�)�"7�"7��<rc��tttjjdg�tt
tjjdg�tt
tjjdg�tt
tjjgd��tt
tjjgd��y)Nr!r"�)��r))r*���r)r#r&s r�test_invalid_arrayzTestSeed.test_invalid_array%sx���i����!6�!6���?��j�"�)�)�"7�"7�"��>��j�"�)�)�"7�"7�*��F��j�"�)�)�"7�"7�9K�L��j�"�)�)�"7�"7�9L�Mrc�R�tttjjtj
gtj���tttjjgd�g�tttjjgd�gd�g�y)N��dtype�r*r+�)���)rr%rrr�array�int64r&s r�test_invalid_array_shapez!TestSeed.test_invalid_array_shape-sd���j�"�)�)�"7�"7��h�h�r����2�	4��j�"�)�)�"7�"7�)��E��j�"�)�)�"7�"7�)�:C�:E�	FrN)�__name__�
__module__�__qualname__rrr'r-r8�rrrrs��+�+�=�
N�Frrc��eZdZd�Zd�Zy)�TestBinomialc���tjdd��}dD]D}ttjd|�dk(�ttj||�|��Fy)Nr+�intr/)r��?r*r)r�zerosrr�binomialr)rrB�ps   r�test_n_zerozTestBinomial.test_n_zero7sR������%�(���	A�A��F�O�O�A�q�)�Q�.�/��v���u�a�8�%�@�	Arc�`�tttjdtj
�y)Nr*)rr%rrCr�nanr&s r�
test_p_is_nanzTestBinomial.test_p_is_nan@s���j�&�/�/�1�b�f�f�=rN)r9r:r;rErHr<rrr>r>6s
��A�>rr>c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�TestMultinomialc�4�tjdddg�y)N�d皙�����?皙�����?�r�multinomialr&s r�
test_basiczTestMultinomial.test_basicFs�����3��c�
�+rc�4�tjdgd��y)NrL)rMrN�rSrSrOr&s r�test_zero_probabilityz%TestMultinomial.test_zero_probabilityIs�����3� 9�:rc��tdtjdd�cxkxrdknc�tjddd�}ttjd|k��ttj|dk��y)N���r"r4)rrrr�all)r�xs  r�test_int_negative_intervalz*TestMultinomial.test_int_negative_intervalLsY����f�n�n�R��,�1�r�1�2��N�N�2�r�1�%������r�Q�w�� �����q�2�v��rc	��ddg}ttjjd|tjd��j
d�ttjjd|tjd��j
d�ttjjd|tjd��j
d�ttjjd|ddg�j
d�ttjjd|d�j
d�ttjjd|tjd��j
d�tttjjd|td��y)NrAr*�r*r+r+�r+r+r+�r+r+)
rrrrP�uint32�shaper6rr$�float�rrDs  r�	test_sizezTestMultinomial.test_sizeRs(��
�#�J���R�Y�Y�*�*�1�a����1��>�D�D�f�M��R�Y�Y�*�*�1�a����1��>�D�D�f�M��R�Y�Y�*�*�1�a����1��>�D�D�f�M��R�Y�Y�*�*�1�a�!�Q��8�>�>�	�J��R�Y�Y�*�*�1�a��8�>�>�	�J��R�Y�Y�*�*�1�a����&�1A�B�H�H��	 �	�i����!6�!6��1��A�h�	 rc
��tttjjdddgg�tttjjddgdgg�tttjjddgdggdgdggg�tttjjdtj
ddgddgg��y)Nrrr*)rr%rrrPr6r&s r�test_multidimensional_pvalsz+TestMultinomial.test_multidimensional_pvals`s����j�"�)�)�"7�"7��q�!�f�X�F��j�"�)�)�"7�"7��q�c�A�3�Z�H��j�"�)�)�"7�"7���s�Q�C�j�A�3�QR�PS�*�=U�V��j�"�)�)�"7�"7��R�X�X��1�v�PQ�ST�v�FV�=W�XrN)r9r:r;rQrTrYrbrdr<rrrJrJEs��,�;� � �YrrJc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�TestSetStatec��d|_tj|j�|_|jj	�|_y�Ni��I)�seedrr�prng�	get_state�stater&s r�setup_methodzTestSetState.setup_methodhs3����	��&�&�t�y�y�1��	��Y�Y�(�(�*��
rc��|jjd�}|jj|j�|jjd�}t	tj||k(��y)N�)rj�tomaxint�	set_staterlrrrW�r�old�news   rrQzTestSetState.test_basicmsU���i�i� � ��$���	�	���D�J�J�'��i�i� � ��$������s�c�z�"�#rc��|jjd��}|jj|j�|jjd��}t	tj||k(��y�Nr2��size)rj�standard_normalrqrlrrrWrrs   r�test_gaussian_resetz TestSetState.test_gaussian_resetss[���i�i�'�'�Q�'�/���	�	���D�J�J�'��i�i�'�'�Q�'�/������s�c�z�"�#rc�T�|jj�|jj�}|jjd��}|jj|�|jjd��}t	tj||k(��yrv)rjryrkrqrrrW)rrlrsrts    r� test_gaussian_reset_in_media_resz-TestSetState.test_gaussian_reset_in_media_reszs{��	
�	�	�!�!�#��	�	�#�#�%���i�i�'�'�Q�'�/���	�	���E�"��i�i�'�'�Q�'�/������s�c�z�"�#rc���|jdd}|jjd��}|jj|�|jjd��}|jj|j�|jjd��}t	tj||k(��t	tj||k(��y)Nr,rorw)rlrjryrqrrrW)r�	old_state�x1�x2�x3s     r�test_backwards_compatibilityz)TestSetState.test_backwards_compatibility�s����J�J�s��O�	�
�Y�Y�
&�
&�B�
&�
/���	�	���I�&�
�Y�Y�
&�
&�B�
&�
/���	�	���D�J�J�'�
�Y�Y�
&�
&�B�
&�
/������r�R�x� �!�����r�R�x� �!rc�<�|jjdd�y�NrA)rj�negative_binomialr&s r�test_negative_binomialz#TestSetState.test_negative_binomial�s��	
�	�	�#�#�C��-rc��tjt�5|jj	d�ddd�y#1swYyxYw)Nr<)�pytest�raises�
IndexErrorrjrqr&s r�test_set_invalid_statez#TestSetState.test_set_invalid_state�s5��
�]�]�:�
&�	$��I�I����#�	$�	$�	$�s	�?�AN)
r9r:r;rmrQrzr|r�r�r�r<rrrfrfgs%��+�
$�$�	$�
"�.�
$rrfc	�2�eZdZejj
Zejejejejejejejejejg	Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy	)
�TestRandintc�F�tt|jdt��y�Nr*r/)rr$�rfuncr`r&s r�test_unsupported_typez!TestRandint.test_unsupported_type�s���i����Q�e�<rc���|jD]�}|tjurdntj|�j}|tjurdn!tj|�j
dz}t
t|j|dz
||��t
t|j||dz|��t
t|j|||��t
t|jdd|����y)Nrr+r*r/)	�ityper�bool�iinfo�min�maxrr%r�)r�dt�lbnd�ubnds    r�test_bounds_checkingz TestRandint.test_bounds_checking�s����*�*�	B�B��b�g�g�
�1�2�8�8�B�<�+;�+;�D��b�g�g�
�1�2�8�8�B�<�+;�+;�a�+?�D��*�d�j�j�$��(�D��K��*�d�j�j�$��q���K��*�d�j�j�$��B�G��*�d�j�j�!�Q�b�A�
	Brc	���|jD]�}|tjurdntj|�j}|tjurdn!tj|�j
dz}|dz
}t
|j||dzd|��|�|}t
|j||dzd|��|�||zdz}t
|j||dzd|��|���y)Nrr+r*r�rxr0)r�rr�r�r�r�rr�)rr�r�r��tgts     r�test_rng_zero_and_extremesz&TestRandint.test_rng_zero_and_extremes�s����*�*�	M�B��b�g�g�
�1�2�8�8�B�<�+;�+;�D��b�g�g�
�1�2�8�8�B�<�+;�+;�a�+?�D���(�C�����C��q��t�2��F��L��C�����C��q��t�2��F��L��$�;��"�C�����C��q��t�2��F��L�	Mrc�r�|jD]�}|tjurdntj|�j}|tjurdn!tj|�j
dz}	|j
|||����y#t$r}tdt|�z��d}~wwxYw)Nrr+r*r/zMNo error should have been raised, but one was with the following message:

%s)
r�rr�r�r�r�r��	Exception�AssertionError�str)rr�r�r��es     r�test_full_rangezTestRandint.test_full_range�s����*�*�		@�B��b�g�g�
�1�2�8�8�B�<�+;�+;�D��b�g�g�
�1�2�8�8�B�<�+;�+;�a�+?�D�
@��
�
�4��R�
�0�		@���
@�$�&6�8;�A��&?�@�@��
@�s�:B�	B6�B1�1B6c���tjj�|jddD]V}dD]O}|j	d|d|��}t|j
�|k�t|j�dk\��Q�X|j	dddtj��}t|j
�dk�t|j�dk\�y)Nr*)r3�ror+ir�r)	rrrir�r�rr�r�r�)rr�r��valss    r�test_in_bounds_fuzzzTestRandint.test_in_bounds_fuzz�s���
�	�	�����*�*�Q�R�.�	)�B�"�
)���z�z�!�T��R�z�@������
�T�)�*�����
�a��(�
)�	)��z�z�!�Q�U�"�'�'�z�:������
�Q�������
�a�� rc
�B�ddl}dddddddddd�	}|jddD]�}tjj	d	�t
jd
k(r|jddd|�
�}n#|jddd|�
�j�}|j|jtj��j�}t|tj|�j|k(���tjj	d	�|jdddt �
�jtj�}|j|�j�}t|tjt �j|k(�y)Nr�@509aea74d792fb931784c4b0135392c65aec64beee12b0cc167548a2c3d31e71�@7b07f1a920e46f6d0fe02314155a2330bcfd7635e708da50e536c5ebb631a7d4�@e577bfed6c935de944424667e3da285012e741892dcb7051a8f1ce68ab05c92f�@0fbead0b06759df2cfb55e43148822d4a1ff953c7eb19a5b08445a63bb64fa9e�@001aac3a5acb935a9b186cbe14a1ca064b8bb2dd0b045d48abeacf74d0203404)	r��int16�int32r7�int8�uint16r^�uint64�uint8r*i��littler5rr�r+)�hashlibr�rrri�sys�	byteorderr��byteswap�sha256�viewr��	hexdigestrr0�namer�)rr�r�r��val�ress      r�test_repeatabilityzTestRandint.test_repeatability�sK���Z�Z�Z�Z�Y�[�[�[�Z�\���*�*�Q�R�.�
	3�B��I�I�N�N�4� ��}�}��(��j�j��A�D��j�;���j�j��A�D��j�;�D�D�F���.�.����"�'�'�!2�3�=�=�?�C��C������)�)�*�c�1�2�
	3�	�	�	���t���j�j��A�D��j�5�:�:�2�7�7�C���n�n�S�!�+�+�-����B�H�H�T�N�'�'�(�C�/�0rc���tj}tjtj�j}tjtjtj�j�}tjtjtj�jdz�}tj
j
|||��}t||�yr�)rr7r�r�r�rrr)rr�r�r�r��actuals      r�test_int64_uint64_corner_casez)TestRandint.test_int64_uint64_corner_case�s����X�X���h�h�r�x�x� �$�$���x�x�������*�.�.�/���y�y����"�(�(�+�/�/�!�3�4�����"�"�4��R�"�8���V�S�!rc��|jD]�}|tjurdntj|�j}|tjurdn!tj|�j
dz}|j
|||��}t|jtj|����ttfD]�}|turdntjd�j}|turdn!tjd�j
dz}|j
|||��}tt|d��tt|�|���y)Nrr+r*r/�longr0)
r�rr�r�r�r�r�rr0r@r�hasattr�type)rr�r�r��samples     r�test_respect_dtype_singletonz(TestRandint.test_respect_dtype_singletons
���*�*�	5�B��b�g�g�
�1�2�8�8�B�<�+;�+;�D��b�g�g�
�1�2�8�8�B�<�+;�+;�a�+?�D��Z�Z��d�"�Z�5�F�����r�x�x��|�4�	5���+�	+�B��d�
�1�����(8�(<�(<�D��d�
�1�����(8�(<�(<�q�(@�D��Z�Z��d�"�Z�5�F�����0�0�1���f��r�*�	+rN)r9r:r;rrrr�r�r�r�r�r�r�r^r7r�r�r�r�r�r�r�r�r�r�r<rrr�r��s~���I�I���E��W�W�b�g�g�r�x�x����2�9�9�
�X�X�r�y�y�"�(�(�B�I�I�
7�E�=�B�M�@�
!�1�B"�.+rr�c�t�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zej.j1dej4ej4j7�ej4j9�g�d��Zej.j1dej4ej4j7�ej4j9�g�ej.j1dddg�d���Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d �Z%d!�Z&d"�Z'd#�Z(d$�Z)d%�Z*d&�Z+d'�Z,d(�Z-d)�Z.d*�Z/d+�Z0d,�Z1d-�Z2d.�Z3d/�Z4d0�Z5d1�Z6d2�Z7d3�Z8d4�Z9d5�Z:d6�Z;d7�Z<d8�Z=d9�Z>d:�Z?d;�Z@d<�ZAd=�ZBd>�ZCd?�ZDd@�ZEdA�ZFdB�ZGdC�ZHdD�ZIdE�ZJdF�ZKdG�ZLdH�ZMdI�ZNdJ�ZOdK�ZPdL�ZQdM�ZRyN)O�TestRandomDistc��d|_yrh�rir&s rrmzTestRandomDist.setup_method+s	����	rc���tjj|j�tjjdd�}tjddgddgddgg�}t||d	�
�y)Nr2r+�_�\�*��?琛�����?�<�p�?�,��o��?���H�?�Z������?���decimal)rrri�randr6r	�rr��desireds   r�	test_randzTestRandomDist.test_rand.sh��
�	�	���t�y�y�!�������1�%���(�(�0�2E�F�0�2E�F�/�1C�D�F�G��	"�&�'�2�>rc���tjj|j�tjjdd�}tjddgddgddgg�}t||d	�
�y)Nr2r+�!�<Oq�?�4�u,�?��3��?�L�I/DͿ��@��?@�HS�\@r�r�)rrri�randnr6r	r�s   r�
test_randnzTestRandomDist.test_randn6sh��
�	�	���t�y�y�!�������A�&���(�(�0�2E�F�-�/B�C�-�/B�C�E�F��	"�&�'�2�>rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||�y)N����c�r2r+rw�r2�����)�������)rrrirr6rr�s   r�test_randintzTestRandomDist.test_randint>sd��
�	�	���t�y�y�!����"�"�3���"�8���(�(�R��G� �"�I� �#�J�(�)��	�6�7�+rc��tjj|j�t�5}|j	t
�}tjj
ddd��}tt|�dk(�ddd�tjddgdd	gd
dgg�}t|�y#1swY�4xYw)Nr�r�r�rwr*r�r2r�r�r�r�)rrrir
�record�DeprecationWarning�random_integersr�lenr6r�r�sup�wr�r�s     r�test_random_integersz#TestRandomDist.test_random_integersFs���
�	�	���t�y�y�!�
�
 �	!�C��
�
�-�.�A��Y�Y�.�.�s�B�V�.�D�F��C��F�a�K� �	!��(�(�R��G� �"�I� �#�J�(�)��	�6�7�+�	!�	!�s�AB6�6B?c��t�5}|jt�}tjjtjd�jtjd�j�}tt|�dk(�ddd�tjd�j}t|�y#1swY�5xYw)N�lr*)r
r�r�rrr�r�r�rr�rr�s     r�test_random_integers_max_intz+TestRandomDist.test_random_integers_max_intQs����
 �	!�C��
�
�-�.�A��Y�Y�.�.�r�x�x��}�/@�/@�/1�x�x��}�/@�/@�B�F��C��F�a�K� �		!��(�(�3�-�#�#���V�W�%�	!�	!�s�BC�Cc	���tj�5tjdt�t	tt
jjtjd�j�t	tt
jjtjd�jtjd�j�ddd�y#1swYyxYw)N�errorr�)
�warnings�catch_warnings�simplefilterr�rrrr�r�r�r&s r�test_random_integers_deprecatedz.TestRandomDist.test_random_integers_deprecated`s���
�
$�
$�
&�	@��!�!�'�+=�>�
�,��)�)�3�3��(�(�3�-�+�+�
-�

�,��)�)�3�3��(�(�3�-�+�+�R�X�X�c�]�->�->�
@�	@�	@�	@�s�CC#�#C,c���tjj|j�tjjd�}tjddgddgddgg�}t	||d�	�y)
Nr�r�r�r�r�r�r�r�r�)rrrir6r	r�s   r�test_randomzTestRandomDist.test_randomnsh��
�	�	���t�y�y�!����!�!�&�)���(�(�0�2E�F�0�2E�F�/�1C�D�F�G��	"�&�'�2�>rc���tjj|j�tjjdd�}tjgd��}t||�y)Nr3)r+r2r+r2�rrri�choicer6rr�s   r�test_choice_uniform_replacez*TestRandomDist.test_choice_uniform_replacevsD��
�	�	���t�y�y�!����!�!�!�Q�'���(�(�<�(���6�7�+rc���tjj|j�tjjddgd���}tjgd��}t||�y)Nr3)皙�����?r	皙�����?r
�rD)r*r*r+r+rr�s   r�test_choice_nonuniform_replacez-TestRandomDist.test_choice_nonuniform_replace|sJ��
�	�	���t�y�y�!����!�!�!�Q�*>�!�?���(�(�<�(���6�7�+rc���tjj|j�tjjddd��}tjgd��}t||�y)Nr3r2F��replace)rr*r2rr�s   r�test_choice_uniform_noreplacez,TestRandomDist.test_choice_uniform_noreplace�sI��
�	�	���t�y�y�!����!�!�!�Q��!�6���(�(�9�%���6�7�+rc���tjj|j�tjjdddgd���}tjgd��}t||�y)Nr3r2F)r
g333333�?rAr
�rrD)r+r2r*rr�s   r� test_choice_nonuniform_noreplacez/TestRandomDist.test_choice_nonuniform_noreplace�sP��
�	�	���t�y�y�!����!�!�!�Q��$8�"�:���(�(�9�%���6�7�+rc���tjj|j�tjjgd�d�}tjgd��}t||�y)N)�a�b�c�dr3)rrrrrr�s   r�test_choice_nonintegerz%TestRandomDist.test_choice_noninteger�sF��
�	�	���t�y�y�!����!�!�"6��:���(�(�/�0���6�7�+rc	�~�tjj}tt|dd�tt|dd�tt|ddgddggd�tt|gd�tt|gd�dddgddgg�	�tt|ddgdgd
��	�tt|ddgdddg�	�tt|ddgdd
d
g�	�tt|gd�dd��tt|gd�dd��tt|gd�dd��tt|gd�dd��tt|gd�ddgd���y)Nr"r2g@r*r+r3)r*r+r2r3g�?r)r	r	rMg�������?g��������r	r1Frr,)r")r"r*)r*rrr)rrrrr%)rr�s  r�test_choice_exceptionsz%TestRandomDist.test_choice_exceptions�s�����!�!���j�&�"�a�0��j�&�"�a�0��j�&�A�q�6�A�q�6�*:�A�>��j�&�"�a�0��j�&�,������d�|�4�	6��j�&�1�a�&�!��G��j�&�1�a�&�!��T�{�C��j�&�1�a�&�!��S�z�B��j�&�)�Q��F��j�&�)�R��G��j�&�)�U�E�J��j�&�)�W�e�L��j�&�)�Q�#�y�	2rc
��ddg}ttjtjj	dd����ttjtjj	dd����ttjtjj	dd|����ttjtjj	dd|����ttjtjj	ddgd����ttjj	dgd��du�tj
ddg�}tjdt�	�}||d
<ttjj	|d��|u�t�}ttjtjj	d|d����ttjtjj	d|d����ttjtjj	d|d|����ttjtjj	d|d|����ttjtjj	ddg|d����ttjj	dg|d��jd
k(�tj
ddg�}tjdt�	�}||d
<ttjj	||d��j�|u�d}gd�}ttjj	d
|d��j|�ttjj	d
|d��j|�ttjj	d
|d|��j|�ttjj	d
|d|��j|�ttjj	tjd
�|d��j|�ttjjd
d
d��jd�ttjjd
dd
��jd�ttjjddd
��jd�ttjj	d
d
��jd�ttjj	gd��jd�ttjj	ddgd��jd�tt tjjgd�y)Nr
��������?r+TrFrr*r/r)r+r2)r
r
r
r
r	rMr5)r2rr3rwi����)rrrr)rr�isscalarrrr6�empty�object�tuple�ndim�itemrr_rrrr%)rrDr�arrrs     r�test_choice_return_shapez'TestRandomDist.test_choice_return_shape�su��
�#�J������B�I�I�,�,�Q��,�=�>�?�����B�I�I�,�,�Q��,�>�?�@�����B�I�I�,�,�Q���,�B�C�D�����B�I�I�,�,�Q���,�C�D�E�����B�I�I�,�,�a��V�T�,�B�C�D���	�	� � �$��� �6�$�>�?��H�H�a��V����h�h�q��'����A����	�	� � ��d� �3�q�8�9�
�G���B�K�K��	�	� 0� 0��A�t� 0� D�E�E�F��B�K�K��	�	� 0� 0��A�u� 0� E�F�F�G��B�K�K��	�	� 0� 0��A�t�q� 0� I�J�J�K��B�K�K��	�	� 0� 0��A�u�� 0� J�K�K�L��B�K�K��	�	� 0� 0�!�Q���D� 0� I�J�J�K���	�	� � �$���D� �9�>�>�!�C�D��H�H�a��V����h�h�q��'����A����	�	� � ��a�� �6�;�;�=��B�C�
��*���R�Y�Y�%�%�a��D�%�9�?�?��C��R�Y�Y�%�%�a��E�%�:�@�@�!�D��R�Y�Y�%�%�a��D�A�%�>�D�D�a�H��R�Y�Y�%�%�a��E�Q�%�?�E�E�q�I��R�Y�Y�%�%�b�i�i��l�A�t�%�D�J�J�A�N�	�R�Y�Y�&�&�q�!�)�&�<�B�B�I�N��R�Y�Y�&�&�q�#�A�&�6�<�<�d�C��R�Y�Y�&�&�r�2�A�&�6�<�<�d�C��R�Y�Y�%�%�a�a�%�0�6�6��=��R�Y�Y�%�%�b�t�%�4�:�:�D�A��R�Y�Y�%�%�s�C�j�y�%�A�G�G��	 ��j�"�)�)�"2�"2�B��;rc��tjgd��}gd�}tttjj
||��y)N)�*r*r+)NNNr)rr6rr%rr)rrrDs   r�test_choice_nan_probabilitiesz,TestRandomDist.test_choice_nan_probabilities�s-���H�H�Z� �����j�"�)�)�"2�"2�A��;rc��tjj|j�tjjd�}d}t	||�y)Nrs
�Ui���+Wf�)rrri�bytesrr�s   r�
test_byteszTestRandomDist.test_bytes�s7��
�	�	���t�y�y�!�������$��.���V�W�%rc��d�d�d�d�d�d�d�d�d	�d
�d�fD]l}tjj|j�|gd��}tjj|�|}|gd
��}t	||��ny)Nc�,�tjg�S�N)rr6�rXs r�<lambda>z-TestRandomDist.test_shuffle.<locals>.<lambda>�s��r�x�x��|�rc��|Sr.r<r/s rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s��q�rc�f�tj|�jtj�Sr.)r�asarray�astyper�r/s rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s��r�z�z�!�}�3�3�B�G�G�<�rc�f�tj|�jtj�Sr.)rr3r4�float32r/s rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s��r�z�z�!�}�3�3�B�J�J�?�rc�f�tj|�jtj�Sr.)rr3r4�	complex64r/s rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s��r�z�z�!�}�3�3�B�L�L�A�rc�R�tj|�jt�Sr.)rr3r4r r/s rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s��r�z�z�!�}�3�3�F�;�rc�0�|D�cgc]}||f��c}Scc}wr.r<�rX�is  rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s���2�1��A��2���2s�c�V�tj|D�cgc]}||g��c}�Scc}wr.)rr3r;s  rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s!��r�z�z�1�*=�a�A�q�6�*=�>���*=s�&c�D�tj||g�jSr.)r�vstack�Tr/s rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s��r�y�y�!�Q��0�2�2�rc��tj|D�cgc]}||f��c}dtfdtfg�jtj�Scc}w�Nrr)rr3r@r��recarrayr;s  rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�sE���
�
�A�+>�q�Q��F�+>�-0�#�J��c�
�+C�!E�!%��b�k�k�!2���+>s�Ac��tj|D�cgc]}||f��c}dtfdtjfg�Scc}wrB)rr3r r�r;s  rr0z-TestRandomDist.test_shuffle.<locals>.<lambda>�s8��r�z�z�1�*=�a�A�q�6�*=�,/��=�3����/�*J� L���*=s�?)
r*r+r2r3r4r5�r��	r)
rr*rFr5r+r3r4r�rEr2)rrri�shuffler)r�conv�alistr�r�s     r�test_shufflezTestRandomDist.test_shuffle�s���,� �<�?�A�;�2�>�2�4�L�M�	0�D� 
�I�I�N�N�4�9�9�%��7�8�E��I�I���e�$��F��9�:�G��v�w�/�+	0rc��tjjtjt	d�d�dzdz
d�}tjjtj
d�dzdz
d�}|j
�}|j
�}t	d�D]�}tjj|�tt|j|j�t|j|j��tjj|�tt|j|j�t|j|j����y)N�)r4r3r2r*r"�2)
r�ma�
masked_values�reshaperr�copyrrGr�sorted�data�mask)rrr�a_orig�b_origr<s      r�test_shuffle_maskedz"TestRandomDist.test_shuffle_masked�s���E�E����
�
�5��9�f� =�� A�A� E�r�J���E�E����	�	�"�
�� 1�A� 5�r�:�������������r��	L�A��I�I���a� ���q�v�v�q�v�v�g��'�����V�[�[�L�0I�)J�
L��I�I���a� ���q�v�v�q�v�v�g��'�����V�[�[�L�0I�)J�
L�	Lrrc���dddddddd�}tjtd	�
�5}|j|�ddd�ddjvsJ�y#1swY�xYw)Nrr*r+r2r3r4r5)rr*r+r2r3r4r5z!you are shuffling a 'dict' object��matchr)r��warns�UserWarningrG�filename)rr�values�recs    r�test_shuffle_untyped_warningz+TestRandomDist.test_shuffle_untyped_warning	sg���1��q�Q�1��;��
�\�\�+�9�;�	#�>A��F�N�N�6�"�	#���A����/�/�/�	#�	#�s�A�A�use_array_likeTFc����Gd�dtj�}dtjdg�tjd�tjd�tjd�g}tj|t��}|D�chc]
}t|���c}�|r|j
|�}t�fd�|D��sJ�|r[t|tjj�s7tjtd�	�5|j|�ddd�y|j|�t�fd
�|D��sJ�ycc}w#1swYyxYw)Nc��eZdZy)�>TestRandomDist.test_shuffle_no_object_unpacking.<locals>.MyArrN)r9r:r;r<rr�MyArrrds��rrer2rrEr/c3�8�K�|]}t|��v���y�wr.��id��.0r<�item_idss  �r�	<genexpr>zBTestRandomDist.test_shuffle_no_object_unpacking.<locals>.<genexpr>#s�����2��2�a�5�H�$�2���z#Shuffling a one dimensional array.*rYc3�8�K�|]}t|��v���y�wr.rgris  �rrlzBTestRandomDist.test_shuffle_no_object_unpacking.<locals>.<genexpr>,s�����6�Q�r�!�u��(�6�rm)r�ndarrayr6�float64r rhr�rW�
isinstancer�	Generatorr�r[r\rG)rrrare�itemsr$r<rks       @r� test_shuffle_no_object_unpackingz/TestRandomDist.test_shuffle_no_object_unpackings���	�B�J�J�	�
�"�(�(�A�3�-����A�������b�j�j��m�
���h�h�u�F�+��#(�)�a�B�q�E�)����(�(�5�/�C��2�c�2�2�2�2��*�V�R�Y�Y�5H�5H�"I����k�?�A�
$�����s�#�
$�
$�
�F�N�N�3���6�#�6�6�6�6��*�
$�
$�s�E�
E�E c��tjj|j�tjd�j}tjj|�t
tj|�gd��tjj|j�}|j|�t
tj|�gd��tjj|j�}|j|�t
tj|�gd��y)Nr4)rr*r3r2r+)rr*r+r2r3)r3r*rr2r+)
rrrirrSrGrr3r�default_rng)rr�rngs   r�test_shuffle_memoryviewz&TestRandomDist.test_shuffle_memoryview.s���	�	�	���t�y�y�!��I�I�a�L����
�	�	���!���R�Z�Z��]�O�4��i�i�#�#�D�I�I�.�����A���R�Z�Z��]�O�4��i�i�#�#�D�I�I�.�����A���R�Z�Z��]�O�4rc���tjd�}d|j_t	j
td��5tjj|�ddd�y#1swYyxYw)Nr2Fz	read-onlyrY)	rrB�flags�	writeabler�r�r%rrG)rrs  r�test_shuffle_not_writeablez)TestRandomDist.test_shuffle_not_writeable=sP���H�H�Q�K��!�����
�]�]�:�[�
9�	!��I�I���a� �	!�	!�	!�s� A+�+A4c���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr
rr�rwgA�Kč?g���hA?g �҇o�>gάXf�+q?gS��1�$?g'8zX� ?r�r�)rrri�betar6r	r�s   r�	test_betazTestRandomDist.test_betaCsl��
�	�	���t�y�y�!�������B�V��4���(�(�)�+B�C�)�+B�C�)�+B�C�E�F��	"�&�'�2�>rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||�y)NrLg�v��/�?r�rw�%�+r'�0�.�-)rrrirCr6rr�s   r�
test_binomialzTestRandomDist.test_binomialLsd��
�	�	���t�y�y�!����#�#�C��F�#�;���(�(�R��H���H���H�&�'��	�6�7�+rc���tjj|j�tjjdd��}tjddgddgdd	gg�}t||d
��y)NrMr�rwg+Q�]u�O@g����+Q@gY7`�ZqP@g�e�(f�G@g�v�t�R@gEIȋR@�
r�)rrri�	chisquarer6r	r�s   r�test_chisquarezTestRandomDist.test_chisquareTsm��
�	�	���t�y�y�!����$�$�R�f�$�5���(�(�1�3G�H�1�3G�H�0�2F�G�I�J��	"�&�'�2�>rc�J�tjj|j�tjddg�}tjjj|d��}tjddgddggd	d
gddggd
dgddggg�}t
||d��y)N���I<�I@��EZ�C@r�rwg�i{
�s�?gn,	�A�?g��]�^��?gpD�B�?gȧ#�y��?gr�����?g��1U��?g�Ѩ�UC�?g��^,%��?g��B���?gډOoX;�?gM�`!O��?r�r�)rrrir6�mtrand�	dirichletr	)r�alphar�r�s    r�test_dirichletzTestRandomDist.test_dirichlet\s���
�	�	���t�y�y�!����.�0D�E�F�����!�!�+�+�E��+�?���(�(�1�3F�G�1�3F�G�I�1�3F�G�1�3F�G�I�1�3F�G�1�3F�G�I�	J�K��	"�&�'�2�>rc��tjddg�}ttjj	|tj
d��jd�ttjj	|tj
d��jd�ttjj	|tj
d��jd�ttjj	|ddg�jd�ttjj	|d�jd�ttjj	|tjd��jd�tttjj|td��y)Nr�r�r*r[r+r\r])
rr6rrr�r^r_rr$r`ras  r�test_dirichlet_sizez"TestRandomDist.test_dirichlet_sizehs���H�H�*�,@�A�B���R�Y�Y�(�(��B�I�I�a�L�9�?�?��H��R�Y�Y�(�(��B�I�I�a�L�9�?�?��H��R�Y�Y�(�(��B�I�I�a�L�9�?�?��H��R�Y�Y�(�(��Q��F�3�9�9�9�E��R�Y�Y�(�(��F�3�9�9�9�E��R�Y�Y�(�(��B�H�H�V�,<�=�C�C�Y�O��i����!4�!4�a��q��Brc	���tjddg�}tttjj
j|�tttjddgg�tttjdgdgg�tttjdgdggdgdggg�tttjtjddgddgg��y)NgH�z�G�?g��ؗ�Ҝ�r4r*)rr6rr%rr�r�)rr�s  r�test_dirichlet_bad_alphaz'TestRandomDist.test_dirichlet_bad_alphats������'�8�,�-���j�"�)�)�"2�"2�"<�"<�e�D�	�j�&�"2�"2�a��V�H�=��j�&�"2�"2�a�S�1�#�J�?��j�&�"2�"2�q�c�A�3�Z�1�#��s��4L�M��j�&�"2�"2�B�H�H�q�!�f�q�!�f�=M�4N�Orc���tjj|j�tjjdd��}tjddgddgdd	gg�}t||d
��y)Ng�8EGr��?r�rwgN��U�?gbI0��?g�VU\��@g�:��3�@g��U��?g��"qo�?r�r�)rrri�exponentialr6r	r�s   r�test_exponentialzTestRandomDist.test_exponentialsm��
�	�	���t�y�y�!����&�&�v�F�&�;���(�(�0�2E�F�0�2E�F�0�2E�F�H�I��	"�&�'�2�>rc��ttjjd��d�t	t
tjjd��y�Nr��scale��)rrrr�rr%r&s r�test_exponential_0z!TestRandomDist.test_exponential_0�s4���R�Y�Y�*�*��*�3�Q�7��j�"�)�)�"7�"7�s�Crc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
N��Mr�rwg7���?g�`j���?g6�"+�?gܳ2>���?g�c�>+Y�?g�_}�S��?r�r�)rrri�fr6r	r�s   r�test_fzTestRandomDist.test_f�sl��
�	�	���t�y�y�!������R��&��1���(�(�0�2E�F�0�2E�F�0�2E�F�H�I��	"�&�'�2�>rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr4r2r�rwgԏGM�8@g���Ȍ<@g�	�":@g�v���#)@gZQ��?@gr��[��@@�r�)rrri�gammar6r	r�s   r�
test_gammazTestRandomDist.test_gamma�sl��
�	�	���t�y�y�!�������A�F��3���(�(�1�3G�H�1�3G�H�1�3G�H�J�K��	"�&�'�2�>rc��ttjjdd��d�t	t
tjjdd��y)Nr)r_r�r�)rrrr�rr%r&s r�test_gamma_0zTestRandomDist.test_gamma_0�s3���R�Y�Y�_�_�1�A�_�6��:��j�"�)�)�/�/��C�Hrc���tjj|j�tjjdd��}tjddgddgddgg�}t||�y)	N�_c97ݚ�?r�rwr�rE�r4r�)rrri�	geometricr6rr�s   r�test_geometriczTestRandomDist.test_geometric�sb��
�	�	���t�y�y�!����$�$�Z�f�$�=���(�(�Q��F���H���G�%�&��	�6�7�+rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr��@r���locr�rxg�ؕ��?g�s0��?g��#0��g�(�x���g-�K�D��?g�ůp`@�r�r�)rrri�gumbelr6r	r�s   r�test_gumbelzTestRandomDist.test_gumbel�so��
�	�	���t�y�y�!����!�!�j��&�!�I���(�(�0�2E�F�0�2F�G�0�2F�G�I�J��	"�&�'�2�>rc��ttjjd��d�t	t
tjjd��yr�)rrrr�rr%r&s r�
test_gumbel_0zTestRandomDist.test_gumbel_0��4���R�Y�Y�%�%�A�%�.��2��j�"�)�)�"2�"2�#�>rc� �tjj|j�tjjdddd��}tjddgddgddgg�}t||�tjjdddd	��}tjgd
��}t||�tjjdddd	��}tjgd
��}t||�tjjdddd	��}tjgd��}t||�tjjdddd	��}tjgd��}t||�y)Nrr4r�r�rwrFrr2r3)r2r2r2r2r�r�)r�r�r�r�)rrrr)rrri�hypergeometricr6rr�s   r�test_hypergeometricz"TestRandomDist.test_hypergeometric�s?��
�	�	���t�y�y�!����)�)�"�a��&�)�A���(�(�R��H���H���F�$�%��	�6�7�+����)�)�!�Q���)�:���(�(�<�(���6�7�+����)�)�"�a��!�)�<���(�(�+�,���6�7�+����)�)�!�Q���)�:���(�(�<�(���6�7�+����)�)�!�R��!�)�<���(�(�<�(���6�7�+rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr�r�r�r�g� b�O�?g�¸����?gpJm��	@g{K�*�t	@g�:^w-���g�Y~o���?r�r�)rrri�laplacer6r	r�s   r�test_laplacezTestRandomDist.test_laplace�so��
�	�	���t�y�y�!����"�"�z��6�"�J���(�(�0�2E�F�0�2E�F�1�3F�G�I�J��	"�&�'�2�>rc��ttjjd��d�t	t
tjjd��yr�)rrrr�rr%r&s r�test_laplace_0zTestRandomDist.test_laplace_0�s4���R�Y�Y�&�&�Q�&�/��3��j�"�)�)�"3�"3�3�?rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr�r�r�r�g#��K-z�?g��J���?g�92��@gر�[@g�#+^�˿g��-��@r�r�)rrri�logisticr6r	r�s   r�
test_logisticzTestRandomDist.test_logistic�so��
�	�	���t�y�y�!����#�#�
�#�F�#�K���(�(�0�2D�E�0�2E�F�1�3F�G�I�J��	"�&�'�2�>rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr�r�r�)�mean�sigmarxg����Ɂ0@go�,+4FB@g���)ʭ6@g��5���?gn�xN�nP@g��)���U@r�r�)rrri�	lognormalr6r	r�s   r�test_lognormalzTestRandomDist.test_lognormal�so��
�	�	���t�y�y�!����$�$�*�C�f�$�M���(�(�1�3G�H�1�3F�G�1�3G�H�J�K��	"�&�'�2�>rc��ttjjd��d�t	t
tjjd��y)Nr)r�r*r�)rrrr�rr%r&s r�test_lognormal_0zTestRandomDist.test_lognormal_0�s4���R�Y�Y�(�(�q�(�1�1�5��j�"�)�)�"5�"5�S�Arc���tjj|j�tjjdd��}tjddgddgddgg�}t||�y)Ngƀ@���?r�)rDrxr+r5r�r2)rrri�	logseriesr6rr�s   r�test_logserieszTestRandomDist.test_logseries�sb��
�	�	���t�y�y�!����$�$�z��$�?���(�(�Q��F���G���F�$�%��	�6�7�+rc��tjj|j�tjjddgdzd��}tjgd�gd�ggd�gd	�ggd
�gd�gg�}t||�y)NrL�UUUUUU�?r5r�rw)r3r2r4r3r+r+)r4r+r�r+r+r*)r2r3r2r5rr3)r+r*r3r2r5r3)r3r3r+r4r+r2)r3r2r3r+r2r3)rrrirPr6rr�s   r�test_multinomialzTestRandomDist.test_multinomial�sw��
�	�	���t�y�y�!����&�&�r�D�6�!�8�&�&�A���(�(�/�/�1�/�/�1�/�/�1�	2�3��	�6�7�+rc���tjj|j�d}ddgddgg}d}tjj|||�}tjddgddggd	d
gddggd
dgddggg�}t||d��tjj||�}tjddg�}t||d��ddg}ddgddgg}t
ttjj||�ttjj||d��tttjj||d��tjddgddggtj��}t�5}tjj||�|jt�}t|�dk(sJ�	ddd�y#1swYyxYw)N)r�rr*rr�g4�V�j�?g����y'@g�I1���?g�S�B�#@g���e<@g��4W(@g6�R¿��?g�9r
v"@g��с�?g{����#@g�4�x���g��"�f"@r�r�gN}�O6��?g��YM�W"@r+�ignore)�check_valid�raiser
r/)rrri�multivariate_normalr6r	r�RuntimeWarningrrr%r6r
r�r�)rr��covrxr�r�r�r�s        r�test_multivariate_normalz'TestRandomDist.test_multivariate_normals���
�	�	���t�y�y�!����1�v��1�v��������.�.�t�S�$�?���(�(�/�1B�C�/�1B�C�E�/�1C�D�/�1B�C�E�/�1B�C�0�2C�D�F�	G�H��	"�&�'�2�>����.�.�t�S�9���(�(�-�/?�@�A��!�&�'�2�>��1�v���1�v��1�v����^�R�Y�Y�%B�%B�D�#�N�	�2�9�9�8�8�$��'/�	1�	�j�"�)�)�"?�"?��s�")�	+��h�h��C��3��(�+�2�:�:�>��
�
 �	�C��I�I�)�)�$��4��
�
�>�*�A��q�6�Q�;��;�	�	�	�s
�AG"�"G+c���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||�y)NrLg|�Pk��?r�)�nrDrxiPiIi|icii�)rrrir�r6rr�s   rr�z%TestRandomDist.test_negative_binomial(sd��
�	�	���t�y�y�!����,�,�s�f�6�,�J���(�(�S�#�J� �#�J� �#�J�(�)��	�6�7�+rc�|�tjj|j�tjjddd��}tjddgddgdd	gg�}t||d
��tjjdd
d��}tjddgddgddgg�}t||d
��tjj|j�tjjddd��}tjddgddgddgg�}t||d
��y)Nr4r�)�df�noncrxg��G�7@g!��ܴ*@g�1}�z9?@g�+驸�0@g26E_r#@g��I�!�1@r�r�rArMg�����?g��T��D�?g��?T�?g�+�qnl�?g�~|�D�?g밬���?rg�{�0�1#@gp���rs'@g�~;���$@g"��dI�
@g����*@g�}�'�,@)rrri�noncentral_chisquarer6r	r�s   r�test_noncentral_chisquarez(TestRandomDist.test_noncentral_chisquare0s5��
�	�	���t�y�y�!����/�/�1�1�6�/�J���(�(�1�3G�H�1�3G�H�0�2F�G�I�J��	"�&�'�2�>����/�/�2�B�V�/�L���(�(�0�3F�G�0�3F�G�.�1D�E�G�H��	"�&�'�2�>�
�	�	���t�y�y�!����/�/�1�1�6�/�J���(�(�.�0B�C�/�1B�C�/�1C�D�F�G��	"�&�'�2�>rc���tjj|j�tjjdddd��}tjddgdd	gd
dgg�}t||d�
�y)Nr4r+r*r�)�dfnum�dfdenr�rxg�^���~�?g�/+c���?g"��.�@g������@g�7���?g��E���?r�r�)rrri�noncentral_fr6r	r�s   r�test_noncentral_fz TestRandomDist.test_noncentral_fEsv��
�	�	���t�y�y�!����'�'�a�q�q�-3�(�5���(�(�0�2E�F�0�2E�F�0�2D�E�G�H��	"�&�'�2�>rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr�r�r�r�g�&&n@gO�G_�@g�~w��@gt��w]տgm&�5��@g��$�>�@r�r�)rrri�normalr6r	r�s   r�test_normalzTestRandomDist.test_normalNso��
�	�	���t�y�y�!����!�!�j��&�!�I���(�(�0�2E�F�.�0D�E�0�2E�F�H�I��	"�&�'�2�>rc��ttjjd��d�t	t
tjjd��yr�)rrrr�rr%r&s r�
test_normal_0zTestRandomDist.test_normal_0Vr�rc��tjj|j�tjjdd��}tjddgddgdd	gg�}tj
j
||d
��y)Nr�r��rrxg�W�I�@g
�Ԩy�@gy��]�0�Ag1~��\�Ag����a@g�Y�
�7A�)�nulp)rrri�paretor6�testing�assert_array_almost_equal_nulpr�s   r�test_paretozTestRandomDist.test_paretoZsz��
�	�	���t�y�y�!����!�!�J�V�!�<���(�(�)�+B�C�)�+B�C�)�+B�C�E�F��	�
�
�1�1�&�'��1�Krc���tjj|j�tjjdd��}tjddgddgddgg�}t||�y)Nr�r�)�lamrxrr*)rrri�poissonr6rr�s   r�test_poissonzTestRandomDist.test_poissonisb��
�	�	���t�y�y�!����"�"�z��"�?���(�(�Q��F���F���F�$�%��	�6�7�+rc��tjd�j}d}tttj
j|�tttj
j|gdz�tttj
j|�tttj
j|gdz�y)Nr�r"r)rr�r�rr%rr�)r�lambig�lamnegs   r�test_poisson_exceptionsz&TestRandomDist.test_poisson_exceptionsqs~�����#��"�"�����j�"�)�)�"3�"3�V�<��j�"�)�)�"3�"3�f�X�b�[�A��j�"�)�)�"3�"3�V�<��j�"�)�)�"3�"3�f�X�b�[�Arc���tjj|j�tjjdd��}tjddgddgdd	gg�}t||d
��y)Nr�r�r�g�;�'��?gܴ�w�*�?g��5��?gF�G�?g��D]?g��$`��?r�r�)rrri�powerr6r	r�s   r�
test_powerzTestRandomDist.test_powerysj��
�	�	���t�y�y�!������:�F��;���(�(�0�2E�F�0�2E�F�0�2E�F�H�I��	"�&�'�2�>rc���tjj|j�tjjdd��}tjddgddgdd	gg�}t||d
��y)Nrr�)r�rxg"�u���+@g�N$MB�*@g7v8B�4@g���55@ge��&@g~�ӣ�Z1@r�r�)rrri�rayleighr6r	r�s   r�
test_rayleighzTestRandomDist.test_rayleigh�sm��
�	�	���t�y�y�!����#�#�"�6�#�:���(�(�0�2D�E�1�3G�H�1�3G�H�J�K��	"�&�'�2�>rc��ttjjd��d�t	t
tjjd��yr�)rrrr�rr%r&s r�test_rayleigh_0zTestRandomDist.test_rayleigh_0�s4���R�Y�Y�'�'�a�'�0�!�4��j�"�)�)�"4�"4�C�@rc���tjj|j�tjjd��}tjddgddgddgg�}t||d	�
�y)Nr�rwgMo�DL��?g6�([9�g�rF=��?g�M'	-��g�V���gVA:�Qy�?r�r�)rrri�standard_cauchyr6r	r�s   r�test_standard_cauchyz#TestRandomDist.test_standard_cauchy�sk��
�	�	���t�y�y�!����*�*��*�7���(�(�0�2F�G�0�2F�G�1�3F�G�I�J��	"�&�'�2�>rc���tjj|j�tjjd��}tjddgddgddgg�}t||d	�
�y)Nr�rwg���܁��?gc!z��?g&N��"�@g�NI��@gF��>���?g�~�ME�?r�r�)rrri�standard_exponentialr6r	r�s   r�test_standard_exponentialz(TestRandomDist.test_standard_exponential�sk��
�	�	���t�y�y�!����/�/�V�/�<���(�(�0�2E�F�/�1D�E�/�1D�E�G�H��	"�&�'�2�>rc���tjj|j�tjjdd��}tjddgddgdd	gg�}t||d
��y)Nr2r�)r_rxg)��@g��ľ��@gd]�,q�@gP�k�{@g9B#�1@g��v�� @r�r�)rrri�standard_gammar6r	r�s   r�test_standard_gammaz"TestRandomDist.test_standard_gamma�sm��
�	�	���t�y�y�!����)�)���)�?���(�(�0�2E�F�0�2E�F�0�2C�D�F�G��	"�&�'�2�>rc��ttjjd��d�t	t
tjjd��y)Nr)r_r�)rrrrrr%r&s r�test_standard_gamma_0z$TestRandomDist.test_standard_gamma_0�s4���R�Y�Y�-�-�A�-�6��:��j�"�)�)�":�":�#�Frc���tjj|j�tjjd��}tjddgddgddgg�}t||d	�
�y)Nr�rwr�r�r�r�r�r�r�r�)rrriryr6r	r�s   r�test_standard_normalz#TestRandomDist.test_standard_normal�sk��
�	�	���t�y�y�!����*�*��*�7���(�(�0�2E�F�.�0C�D�.�0C�D�F�G��	"�&�'�2�>rc���tjj|j�tjjdd��}tjddgddgdd	gg�}t||d
��y)Nrr�)r�rxg\V�H��?g�hU�%���g�H$�M�?g���L���gV�qdz�ǿg㖀���?r�r�)rrri�
standard_tr6r	r�s   r�test_standard_tzTestRandomDist.test_standard_t�sm��
�	�	���t�y�y�!����%�%��&�%�9���(�(�0�2F�G�0�2F�G�1�3F�G�I�J��	"�&�'�2�>rc���tjj|j�tjjdddd��}tjddgdd	gd
dgg�}t||d�
�y)Ng{�G�z@g�(\��u$@gףp=
W4@r�)�left�mode�rightrxg:�}��\)@ghرTj�(@g�ǨL�30@g6ڜ��A0@g6���sh&@g��<��,@r�r�)rrri�
triangularr6r	r�s   r�test_triangularzTestRandomDist.test_triangular�sv��
�	�	���t�y�y�!����%�%�4�e�5�+1�&�3���(�(�1�3F�G�1�3G�H�1�3F�G�I�J��	"�&�'�2�>rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
N�G�z��?g�G�z%@r�)�low�highrxg>#�H�@g��u��@g��#@g�}d]#@g���N��@g�w)*� @r�r�)rrri�uniformr6r	r�s   r�test_uniformzTestRandomDist.test_uniform�so��
�	�	���t�y�y�!����"�"�t�%�f�"�E���(�(�0�2E�F�0�2E�F�0�2E�F�H�I��	"�&�'�2�>rc�T�tjd�j}tjd�j}tjj
}t
t|tjd�t
t|dtj�t
t|||�t
t|tjgdg�t
t|dgtjg�tjjtj|d�|dz��y)Nr`rr*g�؅W4vC)rr)
r�finfor�r�rrr�
OverflowError�inf�	nextafter)r�fmin�fmax�funcs    r�test_uniform_range_boundsz(TestRandomDist.test_uniform_range_bounds�s����x�x�� �$�$���x�x�� �$�$���y�y� � ���m�T�B�F�F�7�A�6��m�T�A�B�F�F�;��m�T�D�D�9��m�T�R�V�V�G�9�q�c�:��m�T�A�3�����9�
	�	�	���b�l�l�4��3�$��+��Frc��Gd�dtj�}tjd�j|�}t	t
tjj||�Gd�dtj�}tjd�j|�}t	t
tjj|dd�y)Nc��eZdZd�Zy)�GTestRandomDist.test_scalar_exception_propagation.<locals>.ThrowingFloatc��t�r.�r$r&s r�	__float__zQTestRandomDist.test_scalar_exception_propagation.<locals>.ThrowingFloat.__float__�����rN)r9r:r;r+r<rr�
ThrowingFloatr(�s��
 rr-g�?c��eZdZd�ZeZy)�ITestRandomDist.test_scalar_exception_propagation.<locals>.ThrowingIntegerc��t�r.r*r&s r�__int__zQTestRandomDist.test_scalar_exception_propagation.<locals>.ThrowingInteger.__int__�r,rN)r9r:r;r1�	__index__r<rr�ThrowingIntegerr/�s��
 � �Irr3r*)	rror6r�rr$rrr�)rr-�throwing_floatr3�throwing_ints     r�!test_scalar_exception_propagationz0TestRandomDist.test_scalar_exception_propagation�s���	 �B�J�J�	 ����#��+�+�M�:���i����!2�!2�N�$�	&�	 �b�j�j�	 ��x�x��{�'�'��8���i����!9�!9�<��A�Nrc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nr�p=
ף�?r���mu�kapparxgL�ZI@g��'N"@g����kr�?g�k=m�@g��ډ�?g�^�=�\�?r�r�)rrri�vonmisesr6r	r�s   r�
test_vonmiseszTestRandomDist.test_vonmises�so��
�	�	���t�y�y�!����#�#�t�4�f�#�E���(�(�0�2E�F�0�2E�F�0�2E�F�H�I��	"�&�'�2�>rc��tjj|j�tjjddd��}tjjtj|�j��y)NrSgg5_P�G>i@Br9)rrrir<r�r�isfiniterW)r�rs  r�test_vonmises_smallz"TestRandomDist.test_vonmises_small�sT��
�	�	���t�y�y�!��I�I���"�F���?��
�
�
���2�;�;�q�>�-�-�/�0rc���tjj|j�tjjddd��}tjddgddgd	d
gg�}t||d��y)
Nrr8r�)r�r�rxg�Z���@g-�
g�@g�8
��m�?g��VP"�?g`V���?gx�^�&3�?r�r�)rrri�waldr6r	r�s   r�	test_waldzTestRandomDist.test_waldsl��
�	�	���t�y�y�!������T��F��C���(�(�0�2E�F�0�2E�F�0�2E�F�H�I��	"�&�'�2�>rc���tjj|j�tjjdd��}tjddgddgdd	gg�}t||d
��y)Nrr�r�g@��6�?g���]A�?g(�1ڥR�?g��U��?g��2�_u�?g^}-�Q�?r�r�)rrri�weibullr6r	r�s   r�test_weibullzTestRandomDist.test_weibullsm��
�	�	���t�y�y�!����"�"�T��"�7���(�(�0�2E�F�0�2E�F�0�2E�F�H�I��	"�&�'�2�>rc�&�tjj|j�ttjj	dd��tj
d��t
ttjjd��y)Nrr�r�r�)r)rrrirrFrBrr%r&s r�test_weibull_0zTestRandomDist.test_weibull_0sR��
�	�	���t�y�y�!��R�Y�Y�&�&���&�4�b�h�h�r�l�C��j�"�)�)�"3�"3�s�;rc���tjj|j�tjjdd��}tjddgddgddgg�}t||�y)	Nrr�r��B�r*r2r�)rrri�zipfr6rr�s   r�	test_zipfzTestRandomDist.test_zipfs_��
�	�	���t�y�y�!������$�V��4���(�(�R��H���F���G�%�&��	�6�7�+rN)Sr9r:r;rmr�r�r�r�r�rrrrrrrrr%r(r+rJrWr��mark�parametrizerrrrvr`rtrxr|rr�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�rrrr	rr
rrrr%r6r=rArDrGrIrNr<rrr�r�'s1���?�?�,�	,�
&�@�?�,�,�,�,�,�2�&,<�\<�
&�0�4L��[�[���X�
�Y�Y��	�	�-�-�/����1F�1F�1H�I�K�0�K�0��[�[���X�	���B�I�I�)�)�+�R�Y�Y�-B�-B�-D�E�G��[�[���-��e�}�=�7�>�G�7�0
5�!�?�,�?�
?�
C�	P�?�D�?�?�I�,�?�?�,�4?�@�?�?�B�,�	,�&�P,�?�*?�?�?�
L�,�B�?�?�A�?�?�?�G�?�?�?�?�G� O�0?�1�?�?�<�
,rr�c���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"y!)"�
TestBroadcastc��d|_y)Ni�[r�r&s rrmzTestBroadcast.setup_method!s	����	rc�V�tjj|j�yr.)rrrir&s r�setSeedzTestBroadcast.setSeed$s��
�	�	���t�y�y�!rc��dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��|j	�|||dz�}t||d��y)Nrr*�g�l���?g_x
���?g=�*BN�?r2r�r�)rrrr6rUr	)rrrrr�r�s      rrzTestBroadcast.test_uniform*s~���c���s���)�)�#�#���(�(�1�2��	
������q��$�'��!�&�'�2�>�������d�Q�h�'��!�&�'�2�>rc�t�dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�y)Nrr*r")g-r��@g�Y�l�@g-�`�w�?r2r�r�)rrr�r6rUr	rr%)rr�r��	bad_scaler�r�r�s       rr�zTestBroadcast.test_normal:s����c������D�	����!�!���(�(�0�1��	
������a���'��!�&�'�2�>��j�&�#��'�9�=�������U�Q�Y�'��!�&�'�2�>��j�&�#�y�1�}�=rc���dg}dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�t
t|||dz�y)	Nr*r+r"r,)gn�QVf�?gV���KB�?gv�`k��?r2r�r�)rrr~r6rUr	rr%)rrr�bad_a�bad_br~r�r�s        rrzTestBroadcast.test_betaMs���
�C��
�C���������y�y�~�~���(�(�1�2��	
�����a�!�e�Q���!�&�'�2�>��j�$���	�1�5��j�$��A��u�5������a��Q����!�&�'�2�>��j�$��q�1�u�5��j�$��5�1�9�5rc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�y�Nr*r")g�.Ug�Z�?giPr�q�?g��E
K��?r2r�r�)rrr�r6rUr	rr%)rr�rYr�r�r�s      rr�zTestBroadcast.test_exponentialcsg������D�	��i�i�+�+���(�(�1�2��	
�����U�Q�Y�'��!�&�'�2�>��j�+�y�1�}�=rc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�yr^)rrrr6rUr	rr%)rr_�	bad_shape�	std_gammar�r�s      rr	z!TestBroadcast.test_standard_gammapsg������D�	��I�I�,�,�	��(�(�1�2��	
�����5�1�9�%��!�&�'�2�>��j�)�Y��]�;rc���dg}dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�t
t|||dz�y)	Nr*r+r"r,)g�.Ug�Z�?giPr�q�?g��E
K�?r2r�r�)rrr�r6rUr	rr%)rr_r�r`rYr�r�r�s        rr�zTestBroadcast.test_gamma}s����������D�	��D�	��	�	�����(�(�0�1��	
�����u�q�y�%�(��!�&�'�2�>��j�%��Q���>��j�%����I�>������u�e�a�i�(��!�&�'�2�>��j�%��E�A�I�>��j�%��	�A�
�>rc���dg}dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�t
t|||dz�y)	Nr*r+r"r,)gb��yʜ�?g��o���?gT��7�@r2r�r�)rrr�r6rUr	rr%)rr�r��	bad_dfnum�	bad_dfdenr�r�r�s        rr�zTestBroadcast.test_f�s����������D�	��D�	��I�I�K�K���(�(�0�1��	
�����5�1�9�e�$��!�&�'�2�>��j�!�Y��]�E�:��j�!�U�Q�Y�	�:������5�%�!�)�$��!�&�'�2�>��j�!�Y���	�:��j�!�U�I��M�:rc��dg}dg}dg}dg}dg}dg}tjj}tjgd��}|j	�||dz||�}	t|	|d�	�t
t||dz||�t
t||dz||�t
t||dz||�|j	�|||dz|�}	t|	|d�	�t
t|||dz|�t
t|||dz|�t
t|||dz|�|j	�||||dz�}	t|	|d�	�t
t||||dz�t
t||||dz�t
t||||dz�y)
Nr+r2r3rr"r,)g�r�^G"@g/�
*@g���ц�!@r�r�)rrr�r6rUr	rr%)
rr�r�r�rdre�bad_nonc�nonc_fr�r�s
          rr�zTestBroadcast.test_noncentral_f�sy���������s���C�	��D�	��4�����'�'���(�(�0�1��	
�������	�5�$�/��!�&�'�2�>��j�&�)�a�-���E��j�&�%�!�)�Y��E��j�&�%�!�)�U�H�E�������u�q�y�$�/��!�&�'�2�>��j�&�)�U�Q�Y��E��j�&�%��Q���E��j�&�%����H�E�������u�d�Q�h�/��!�&�'�2�>��j�&�)�U�D�1�H�E��j�&�%��D�1�H�E��j�&�%���1��Erc��|j�tjddg�}tjj	dddd��}t||d��y)Ng��a��z@gn4M;�%�?rr+rwr�r�)rUrr6rr�r	)rr�r�s   r�test_noncentral_f_small_dfz(TestBroadcast.test_noncentral_f_small_df�sI�������(�(�-�/@�A�B�����'�'��S�!�!�'�<��!�&�'�2�>rc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�y)Nr*r")g~�}�N?�?g�$F���?g'rS��?r2r�r�)rrr�r6rUr	rr%)rr��bad_dfr�r�r�s      rr�zTestBroadcast.test_chisquare�sg���S������I�I�'�'�	��(�(�0�1��	
�����2��6�"��!�&�'�2�>��j�)�V�a�Z�8rc���dg}dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�t
t|||dz�y)	Nr*r+r"r,)g�� w�"@g2��WR@g���RY@r2r�r�)rrr�r6rUr	rr%)rr�r�rlrg�nonc_chir�r�s        rr�z'TestBroadcast.test_noncentral_chisquare�s����S���s������4���9�9�1�1���(�(�0�1��	
�����"�q�&�$�'��!�&�'�2�>��j�(�F�Q�J��=��j�(�B��F�H�=������"�d�Q�h�'��!�&�'�2�>��j�(�F�D�1�H�=��j�(�B��1��=rc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�y)Nr*r")gT
��@g~�F�l@gƚt��p�?r2r�r�)rrrr6rUr	rr%)rr�rl�tr�r�s      rrzTestBroadcast.test_standard_t�sf���S������I�I� � ���(�(�0�1��	
�����2��6���!�&�'�2�>��j�!�V�a�Z�0rc�t�dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�y)Nr+r*r")g��W!�@g��OB���g�}�?�r2r�r�)rrr<r6rUr	rr%)rr:r;�	bad_kappar<r�r�s       rr=zTestBroadcast.test_vonmisess����S������D�	��9�9�%�%���(�(�1�2��	
�����"�q�&�%�(��!�&�'�2�>��j�(�B��F�I�>������"�e�a�i�(��!�&�'�2�>��j�(�B�	�A�
�>rc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�y)Nr*r")g&�8�?�?g�e��FX�?g�Ջː��?r2r�r�)rrr�r6rUr	rr%)rrr[r�r�r�s      rr�zTestBroadcast.test_paretosf��
�C��������!�!���(�(�0�1��	
������A����!�&�'�2�>��j�&�%�!�)�4rc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�yr^)rrrFr6rUr	rr%)rrr[rFr�r�s      rrGzTestBroadcast.test_weibull sf��
�C������)�)�#�#���(�(�1�2��	
������Q����!�&�'�2�>��j�'�5�1�9�5rc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�y)Nr*r"rWr2r�r�)rrr�r6rUr	rr%)rrr[r�r�r�s      rr�zTestBroadcast.test_power-sd��
�C������	�	�����(�(�1�2��	
�����q�1�u���!�&�'�2�>��j�%����3rc�t�dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�y)Nrr*r")g:��BKc�?g�3��k�?g�~q���?r2r�r�)rrr�r6rUr	rr%)rr�r�rYr�r�r�s       rr�zTestBroadcast.test_laplace:s����c������D�	��)�)�#�#���(�(�2�3��	
������q��%�(��!�&�'�2�>��j�'�3��7�I�>�������e�a�i�(��!�&�'�2�>��j�'�3�	�A�
�>rc�t�dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�y)Nrr*r")g�'��Zy�?g�dSO=�?g�3L�1��?r2r�r�)rrr�r6rUr	rr%)rr�r�rYr�r�r�s       rr�zTestBroadcast.test_gumbelMs����c������D�	����!�!���(�(�1�2��	
������a���'��!�&�'�2�>��j�&�#��'�9�=�������U�Q�Y�'��!�&�'�2�>��j�&�#�y�1�}�=rc�t�dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�y)Nrr*r")g“y��?g��J�R��?g�
~�&��?r2r�r�)rrr�r6rUr	rr%)rr�r�rYr�r�r�s       rr�zTestBroadcast.test_logistic`s����c������D�	��9�9�%�%���(�(�2�3��	
�����#��'�5�)��!�&�'�2�>��j�(�C�!�G�Y�?������#�u�q�y�)��!�&�'�2�>��j�(�C��Q��?rc�t�dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�y)Nrr*r")g����H"@g��ܮ�� @gvv	��:@r2r�r�)rrr�r6rUr	rr%)rr�r��	bad_sigmar�r�r�s       rr�zTestBroadcast.test_lognormalss����s������D�	��I�I�'�'�	��(�(�0�1��	
�����4�!�8�U�+��!�&�'�2�>��j�)�T�A�X�y�A������4����+��!�&�'�2�>��j�)�T�9�q�=�Arc���dg}dg}tjj}tjgd��}|j	�||dz�}t||d��t
t||dz�y)Nr*r")gݱl�o��?g�/ӂ���?gz~�R�?r2r�r�)rrr�r6rUr	rr%)rr�rYr�r�r�s      rr�zTestBroadcast.test_rayleigh�sg������D�	��9�9�%�%���(�(�0�1��	
�����%�!�)�$��!�&�'�2�>��j�(�I��M�:rc��dg}dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||d��t
t||dz|�t
t||dz|�|j	�|||dz�}t||d��t
t|||dz�t
t|||dz�t
t|d	d�t
t|dd	�y)
NrAr*rr,)g@m� �e�?g��`�I߿?g��|2��?r2r�r�rS)rrrCr6rUr	rr%)rr�r��bad_meanrYrCr�r�s        rrDzTestBroadcast.test_wald�s����u������3���D�	��y�y�~�~���(�(�0�1��	
�����d�Q�h��&��!�&�'�2�>��j�$��1��e�<��j�$��q��)�<������d�E�A�I�&��!�&�'�2�>��j�$��%�!�)�<��j�$��i�!�m�<��j�$��Q�/��j�$��S�1rc�"�dg}dg}dg}dg}dg}|dz\}}tjj}tjgd��}	|j	�||dz||�}
t|
|	d��t
t||dz||�t
t||dz||�t
t||dz||�|j	�|||dz|�}
t|
|	d��t
t|||dz|�t
t|||dz|�t
t|||dz|�|j	�||||dz�}
t|
|	d��t
t||||dz�t
t||||dz�t
t||||dz�y)Nr*r2r+r3)g,�P;bD@g����%G@g,~S��@r�r�)rrrr6rUr	rr%)rrrr�bad_left_one�bad_mode_one�bad_left_two�bad_mode_tworr�r�s           rrzTestBroadcast.test_triangular�s����s������s���s���s��%*�Q�Y�"��l��Y�Y�)�)�
��(�(�0�1��	
�����D�1�H�d�E�2��!�&�'�2�>��j�*�l�Q�.>��e�L��j�*�d�Q�h��e�L��j�*�l�Q�.>���	�	
�����D�$��(�E�2��!�&�'�2�>��j�*�l�D�1�H�e�L��j�*�d�L�1�4D�e�L��j�*�l�L�1�<L��	�	
�����D�$���	�2��!�&�'�2�>��j�*�l�D�%�!�)�L��j�*�d�L�%�!�)�L��j�*�l�L��a�i�	!rc� �dg}dg}dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||�t
t||dz|�t
t||dz|�t
t||dz|�|j	�|||dz�}t||�t
t|||dz�t
t|||dz�t
t|||dz�y)Nr*rAr"��?�r*r*r*r2)rrrCr6rUrrr%)	rr�rD�bad_n�	bad_p_one�	bad_p_two�binomr�r�s	         rr�zTestBroadcast.test_binomial�s���
�C��
�E������D�	��E�	��	�	�"�"���(�(�9�%�������q�1�u�a����6�7�+��j�%����A�6��j�%��Q��	�:��j�%��Q��	�:������q�!�a�%����6�7�+��j�%���A��6��j�%��I��M�:��j�%��I��M�:rc� �dg}dg}dg}dg}dg}tjj}tjgd��}|j	�||dz|�}t||�t
t||dz|�t
t||dz|�t
t||dz|�|j	�|||dz�}t||�t
t|||dz�t
t|||dz�t
t|||dz�y)Nr*rAr"r�)r*rr*r2)rrr�r6rUrrr%)	rr�rDr�r�r��	neg_binomr�r�s	         rr�z$TestBroadcast.test_negative_binomial�s���
�C��
�E������D�	��E�	��I�I�/�/�	��(�(�9�%�������1�q�5�!�$���6�7�+��j�)�U�Q�Y��:��j�)�Q��U�I�>��j�)�Q��U�I�>������1�a�!�e�$���6�7�+��j�)�U�A��E�:��j�)�Q�	�A�
�>��j�)�Q�	�A�
�>rc�l�tjj�j}dg}dg}|dzg}tjj}tj
gd��}|j
�||dz�}t||�tt||dz�tt||dz�y)Nr*r"r+)r*r*rr2)
rrr�_poisson_lam_maxr�r6rUrrr%)r�max_lamr��bad_lam_one�bad_lam_twor�r�r�s        rr�zTestBroadcast.test_poisson�s����)�)�'�'�)�:�:���c���d����{�m���)�)�#�#���(�(�9�%��������q��!���6�7�+��j�'�;��?�;��j�'�;��?�;rc��dg}dg}tjj}tjgd��}|j	�||dz�}t||�t
t||dz�tjd��5t
t|tj�t
t|ddtjg�ddd�y#1swYyxYw)Nr+r)r+r+r*r2r�)�invalid)
rrrMr6rUrrr%�errstaterG)rrr[rMr�r�s      rrNzTestBroadcast.test_zipfs���
�C������y�y�~�~���(�(�9�%�������a�!�e����6�7�+��j�$���	�2�
�[�[��
*�	<��*�d�B�F�F�3��*�d�Q��2�6�6�N�;�	<�	<�	<�s
�	AC�Cc��dg}dg}dg}tjj}tjgd��}|j	�||dz�}t||�t
t||dz�t
t||dz�y)NrAr"r�r\r2)rrr�r6rUrrr%)rrDr�r��geomr�r�s       rr�zTestBroadcast.test_geometricst��
�E���D�	��E�	��y�y�"�"���(�(�9�%�������a�!�e����6�7�+��j�$�	�A�
�6��j�$�	�A�
�6rc��dg}dg}dg}dg}dg}dg}dg}tjj}tjgd��}	|j	�||dz||�}
t|
|	�t
t||dz||�t
t||dz||�t
t||dz||�t
t||dz||�|j	�|||dz|�}
t|
|	�t
t|||dz|�t
t|||dz|�t
t|||dz|�t
t|||dz|�|j	�||||dz�}
t|
|	�t
t||||dz�t
t||||dz�t
t||||dz�t
t||||dz�y)	Nr*r+r"r,rr3r�r2)rrr�r6rUrrr%)r�ngood�nbad�nsample�	bad_ngood�bad_nbad�bad_nsample_one�bad_nsample_two�	hypergeomr�r�s           rr�z!TestBroadcast.test_hypergeometric's�������s���#���D�	��4���#���#���I�I�,�,�	��(�(�9�%�������5�1�9�d�G�4���6�7�+��j�)�Y��]�D�'�J��j�)�U�Q�Y��'�J��j�)�U�Q�Y��o�N��j�)�U�Q�Y��o�N������5�$��(�G�4���6�7�+��j�)�Y��q��'�J��j�)�U�H�q�L�'�J��j�)�U�D�1�H�o�N��j�)�U�D�1�H�o�N������5�$��!��4���6�7�+��j�)�Y��g��k�J��j�)�U�H�g��k�J��j�)�U�D�/�A�:M�N��j�)�U�D�/�A�:M�Nrc��dg}dg}dg}tjj}tjgd��}|j	�||dz�}t||�t
t||dz�t
t||dz�y)NrAr+r"r�r2)rrr�r6rUrrr%)rrDr�r�r�r�r�s       rr�zTestBroadcast.test_logseriesJsu��
�E���C�	��D�	��I�I�'�'�	��(�(�9�%�������1�q�5�!���6�7�+��j�)�Y��]�;��j�)�Y��]�;rN)#r9r:r;rmrUrr�rr�r	r�r�r�rjr�r�rr=r�rGr�r�r�r�r�r�rDrr�r�r�rNr�r�r�r<rrrRrRs����"�?� >�&6�,>�<�?�,;�,F�B?�9�>�,1�?�&5�6�4�?�&>�&@�&B�&;�2�0"!�H;�.?�.
<�<�7�!O�F<rrRzcan't start thread)�reasonc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�
TestThreadc�$�td�|_y)Nr3)r�seedsr&s rrmzTestThread.setup_method[s
���1�X��
rc
�,�ddlm}tjt	|j
�f|z�}tjt	|j
�f|z�}t
|j
|�D��cgc].\}}||tjj|�|f����0}}}|D�	cgc]}	|	j���c}	|D�	cgc]}	|	j���c}	t
|j
|�D]+\}}|tjj|�|��-tj�jjdk(r tjdk(r
t!||�yt#||�ycc}}wcc}	wcc}	w)Nr)�Thread)�target�argsr3�win32)�	threadingr�rrr�r��ziprr�start�join�intpr0�itemsizer��platformr	r)
r�function�szr��out1�out2r�orprXs
          r�check_functionzTestThread.check_function^s/��$��x�x��T�Z�Z��*�R�/�0���x�x��T�Z�Z��*�R�/�0���T�Z�Z��.�
0���A��8�2�9�9�+@�+@��+C�Q�*G�
H�
0��
0���q��������a��������
�
�D�)�	2�D�A�q��R�Y�Y�*�*�1�-�q�1�	2��7�7�9�?�?�#�#�q�(�S�\�\�W�-D�%�d�D�1��t�T�*��
0����s�83F�2F�Fc�0�d�}|j|d��y)Nc�.�|jd��|d<y)N�'rw.)r��rl�outs  r�
gen_randomz*TestThread.test_normal.<locals>.gen_randomus���|�|��|�/�C��Hr)r��r��r��rr�s  rr�zTestThread.test_normalts��	0����J�8��4rc�0�d�}|j|d��y)Nc�T�|jtjd���|d<y)N�rLrr�.)r�r�onesr�s  rr�z'TestThread.test_exp.<locals>.gen_randomzs"���(�(�r�w�w�{�/C�(�D�C��Hrr�r�r�r�s  r�test_expzTestThread.test_expys��	E����J�;��7rc�0�d�}|j|d��y)Nc�:�|jddgdzd��|d<y)Nrr�r5r�rw.)rPr�s  rr�z/TestThread.test_multinomial.<locals>.gen_randoms#���(�(��d�V�A�X�E�(�B�C��Hr)r�r5r�r�r�s  rr�zTestThread.test_multinomial~s��	C����J�:��6rN)r9r:r;rmr�r�r�r�r<rrr�r�Xs���+�,5�
8�
7rr�c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�TestSingleEltArrayInputc��tjdg�|_tjdg�|_tjdg�|_d|_y)Nr+r2r3)r*)rr6�argOne�argTwo�argThree�tgtShaper&s rrmz$TestSingleEltArrayInput.setup_method�s<���h�h��s�m����h�h��s�m������!��
��
���
rc�|�tjjtjjtjjtjj
tjjtjjtjjtjjtjjtjjtjjtjjf}tjjtjjf}|D]U}||vr|tjdg��}n||j�}t!|j"|j$��Wyr�)rrr�rr�rr�rFr�r�r�rMr�r�r6r�rr_r�)r�funcs�	probfuncsr$r�s     r�test_one_arg_funcsz*TestSingleEltArrayInput.test_one_arg_funcs�s�����&�&��	�	�(@�(@����$�$�b�i�i�&:�&:����!�!�2�9�9�#4�#4������"�)�)�"4�"4����"�"�B�I�I�N�N����$�$�b�i�i�&9�&9�;���Y�Y�(�(�"�)�)�*=�*=�>�	��	3�D��y� ��2�8�8�S�E�?�+���4�;�;�'������D�M�M�2�	3rc���tjjtjjtjjtjj
tjjtjjtjjtjjtjjtjjtjjtjjtjjtjjf}tjjtjjf}|D]�}||vrtj dg�}n|j"}||j$|�}t'|j(|j*�||j$d|�}t'|j(|j*�||j$|d�}t'|j(|j*���y)NrAr)rrrr�r~r�r�r�r<r�r�r�r�rCrCr�r6r�r�rr_r�)rr�r�r$r�r�s      r�test_two_arg_funcsz*TestSingleEltArrayInput.test_two_arg_funcs�sp�����"�"�B�I�I�$4�$4����������������b�i�i�<�<����#�#�R�Y�Y�%6�%6����!�!�2�9�9�#5�#5����$�$�b�i�i�n�n����#�#�R�Y�Y�%@�%@�
B���Y�Y�'�'����)D�)D�E�	��	3�D��y� ����3�%��������t�{�{�F�+�C�����D�M�M�2��t�{�{�1�~�v�.�C�����D�M�M�2��t�{�{�F�1�I�.�C�����D�M�M�2�	3rc	��ttjtjtjtj
tjtjtjtjg	}tjj}tjdg�}tjdg�}|D]�}||||��}t|j|j�||d||��}t|j|j�|||d|��}t|j|j���y)Nr*rr/)r�rr�r�r�r�r�r^r7r�rrr6rr_r�)rr�r$rrr�r�s       rr�z$TestSingleEltArrayInput.test_randint�s����r�w�w����"�(�(�B�I�I����2�9�9�b�h�h��	�	�;���y�y� � ���x�x���}���h�h��s�m���	3�B��s�D��+�C�����D�M�M�2��s�1�v�t�2�.�C�����D�M�M�2��s�D��G�2�.�C�����D�M�M�2�	3rc�h�tjjtjjtjjg}|D]�}||j
|j|j�}t|j|j�||j
d|j|j�}t|j|j�||j
|jd|j�}t|j|j���y)Nr)rrr�rr�r�r�r�rr_r�)rr�r$r�s    r�test_three_arg_funcsz,TestSingleEltArrayInput.test_three_arg_funcs�s������'�'����)=�)=����)�)�+���	3�D��t�{�{�D�K�K����?�C�����D�M�M�2��t�{�{�1�~�t�{�{�D�M�M�B�C�����D�M�M�2��t�{�{�D�K�K��N�D�M�M�B�C�����D�M�M�2�	3rN)r9r:r;rmr�r�r�r�r<rrr�r��s���3�&3�63�"3rr�)r�r��numpyr�
numpy.testingrrrrrrr	r
rrr�rr>rJrfr�r�rRrO�skipifr�r�r<rr�<module>r�s����
��
�
�
�
�
�$F�$F�N>�>�Y�Y�D2$�2$�jH+�H+�Vt,�t,�nw<�w<�t�����G�$8��9�(7�(7�:�(7�XR3�R3r

Youez - 2016 - github.com/yon3zu
LinuXploit