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_arraypad.cpython-311.pyc
�

���c������dZddlZddlZddlmZmZmZddlm	Z	ej
dej
dzej
dzej
dzZd	diid
diddiddiddiddidd
idd
iiid�ZGd�d��Z
Gd�d��ZGd�d��ZGd�d��ZGd�d��ZGd�d��ZGd�d��ZGd�d��ZGd�d ��ZGd!�d"��ZGd#�d$��Zd%�Zd&�Zej�d'gd(���d)���ZGd*�d+��Zej�d'e�����d,���Zd-�Z ej�d'd.d/e!��dd0d1g��d2���Z"ej�d'e�����d3���Z#ej�d'e�����d4���Z$ej�d5e��ej�d'e�����d6�����Z%dS)7z(Tests for the array padding functions.

�N)�assert_array_equal�assert_allclose�assert_equal)�	_as_pairs�uint�int�float�complex�constant_values�
end_values�stat_length�reflect_type�even)�constant�edge�linear_ramp�maximum�mean�median�minimum�reflect�	symmetric�wrap�emptyc�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�TestAsPairsc��tjddggdz��}ddgdggfD]"}t|d��}t||���#t	��}tt|d��tj||ggdz����dS)z Test casting for a single value.��
N��np�arrayrr�object��self�expected�x�result�objs     �?/usr/lib/python3/dist-packages/numpy/lib/tests/test_arraypad.py�test_single_valuezTestAsPairs.test_single_value!s����8�a��V�H�r�M�*�*���a�S�A�3�%��	+�	+�A��q�"�%�%�F����*�*�*�*��h�h����c�2����H�s�C�j�\�B�&�'�'�	
�	
�	
�	
�	
�c��tjddggdz��}ddgddggfD]"}t|d��}t||���#t	��}ttd|gd��tjd|ggdz����ttdgdggd��tjddgddgg����ttdg|ggd��tjddg||gg����dS)z-Test proper casting for two different values.r�r�a�Nr r$s     r*�test_two_valueszTestAsPairs.test_two_values.s1���8�a��V�H�r�M�*�*���a�&�A�q�6�(�#�	+�	+�A��q�"�%�%�F����*�*�*�*��h�h����s�C�j�"�%�%��H�s�C�j�\�B�&�'�'�	
�	
�	
�	���s�Q�C�j�!�$�$��H�q�!�f�q�!�f�%�&�&�	
�	
�	
�
	���u�s�e�n�a�(�(��H�s�C�j�3��*�-�.�.�	
�	
�	
�	
�	
r,c��d}ttddd���|��ttddd���|��dS)N)�NNr3r3rF��as_indexT)rr�r%r&s  r*�test_with_nonezTestAsPairs.test_with_noneGsa��=����d�A��.�.�.��	
�	
�	
�	��d�A��-�-�-��	
�	
�	
�	
�	
r,c��tjd���d��}tt	|d��|��dS)z?Test if `x` already matching desired output are passed through.�)�r0r:N)r!�arange�reshaperrr6s  r*�test_pass_throughzTestAsPairs.test_pass_throughRsI���9�R�=�=�(�(��0�0����h��"�"��	
�	
�	
�	
�	
r,c
���ttddgdd���tjddggdztj�����ttddgdd���tjdd	ggdztj�����d
d
gd
ggd
d	gddgd
d	ggd	d
ggdd
ggdzddggzfD]G}tjtd���5t|dd���ddd��n#1swxYwY�HdS)z Test results if `as_index=True`.g������@gffffff
@rTr4r��dtypeg�(\��@r.�������r0�	���znegative values��matchN)rrr!r"�intp�pytest�raises�
ValueError)r%r's  r*�
test_as_indexzTestAsPairs.test_as_indexZso����s�C�j�"�t�4�4�4��H�q�!�f�X��]�"�'�2�2�2�	
�	
�	
�	��s�D�k�2��5�5�5��H�q�!�f�X��]�"�'�2�2�2�	
�	
�	
��r�d�b�T�F�R��G�a��W��A�w�i�1�b�'���q�6�(�Q�,�1�b�'��*�,�	0�	0�A���z�1B�C�C�C�
0�
0��!�R�$�/�/�/�/�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0����
0�
0�
0�
0��	0�	0s�
C,�,C0	�3C0	c���tjtd���5tdgggd��ddd��n#1swxYwYtjtd���5tddgdd	ggd��ddd��n#1swxYwYtjtd���5tt	jd
��d��ddd��dS#1swxYwYdS)z"Ensure faulty usage is discovered.zmore dimensions than allowedrFrrNzcould not be broadcastrCr0r.�r0r)rIrJrKrr!�ones)r%s r*�test_exceptionszTestAsPairs.test_exceptionsis���
�]�:�-K�
L�
L�
L�	#�	#����u�g�r�"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�
�]�:�-E�
F�
F�
F�	+�	+���1�v��1�v�&��*�*�*�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+����	+�	+�	+�	+�
�]�:�-E�
F�
F�
F�	*�	*��b�g�f�o�o�q�)�)�)�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*�	*����	*�	*�	*�	*�	*�	*s3�<�A�A�"B�B	�B	�+#C�C�"CN)	�__name__�
__module__�__qualname__r+r1r7r=rLrP�r,r*rr sn������
�
�
�
�
�
�2	
�	
�	
�
�
�
�
0�
0�
0�*�*�*�*�*r,rc��eZdZej�de�����d���Zej�dgd���d���Z	ej�dgd���d���Z
dS)�TestConditionalShortcuts�modec���tjd���ddd��}d�|jD��}t	|tj|||�����dS)N�xr.�r:c��g|]}d��S)�rrrT��.0�_s  r*�
<listcomp>zHTestConditionalShortcuts.test_zero_padding_shortcuts.<locals>.<listcomp>w���.�.�.�a�6�.�.�.r,�rW�r!r;r<�shaper�pad�r%rW�test�pad_amts    r*�test_zero_padding_shortcutsz4TestConditionalShortcuts.test_zero_padding_shortcutsts]���y��~�~�%�%�a��A�.�.��.�.�4�:�.�.�.���4����g�D�!A�!A�!A�B�B�B�B�Br,)rrrrc	���tjd���ddd��}d�|jD��}t	tj||d���tj|||d�	����dS)
NrYr.rZr:c��g|]}d��S)�rCrCrTr]s  r*r`zITestConditionalShortcuts.test_shallow_statistic_range.<locals>.<listcomp>}rar,rrbrC�rWr
rcrfs    r*�test_shallow_statistic_rangez5TestConditionalShortcuts.test_shallow_statistic_rangezs����y��~�~�%�%�a��A�.�.��.�.�4�:�.�.�.���2�6�$��f�=�=�=��6�$��d��J�J�J�	L�	L�	L�	L�	Lr,c	���tjd���dd��}d�|jD��}t	tj|||���tj|||d�����dS)N�rZr:c��g|]}d��S))rrrTr]s  r*r`zFTestConditionalShortcuts.test_clip_statistic_range.<locals>.<listcomp>�rar,rbrmrcrfs    r*�test_clip_statistic_rangez2TestConditionalShortcuts.test_clip_statistic_range�s~���y��}�}�$�$�Q��*�*��.�.�4�:�.�.�.���2�6�$��d�;�;�;��6�$��d��K�K�K�	M�	M�	M�	M�	Mr,N)rQrRrSrI�mark�parametrize�
_all_modes�keysrirnrrrTr,r*rVrVss��������[���V�Z�_�_�%6�%6�7�7�C�C�8�7�C�
�[���V�%N�%N�%N�O�O�L�L�P�O�L��[���V�%N�%N�%N�O�O�M�M�P�O�M�M�Mr,rVc�X�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zej�dgd���d���Zej�dgd���ej�dgd���d�����Zd�Zej�d��ej�d��ej�dddg��d�������Zej�dddg��d���ZdS)�
TestStatisticc���tjd���d��}tj|ddd���}tjgd���}t||��dS)N�d�f)���r)rN�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����?�@�@�@�@�@�@� @�"@�$@�&@�(@�*@�,@�.@�0@�1@�2@�3@�4@�5@�6@�7@�8@�9@�:@�;@�<@�=@�>@�?@�@@��@@�A@��A@�B@��B@�C@��C@�D@��D@�E@��E@�F@��F@�G@��G@�H@��H@�I@��I@�J@��J@�K@��K@�L@��L@�M@��M@�N@��N@�O@��O@�P@�@P@��P@��P@�Q@�@Q@��Q@��Q@�R@�@R@��R@��R@�S@�@S@��S@��S@�T@�@T@��T@��T@�U@�@U@��U@��U@�V@�@V@��V@��V@�W@�@W@��W@��W@�X@�@X@��X@��X@r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��r!r;�astyperer"r�r%r/�bs   r*�test_check_mean_stat_lengthz)TestStatistic.test_check_mean_stat_length�sm���I�c�N�N�!�!�#�&�&���F�1�l�F�
�C�C�C���H�
�
�
�
�
��&	�1�a� � � � � r,c��tjd��}tj|dd��}tjgd���}t	||��dS)Nrzr|r)��cr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrCr0rr.rZr:��rDr�r9�
������r~����r}����rp�� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�br�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��r!r;rer"rr�s   r*�test_check_maximum_1z"TestStatistic.test_check_maximum_1��Z���I�c�N�N���F�1�h�	�*�*���H�
5�
5�
5�
�
��&	�1�a� � � � � r,c��tjd��dz}tj|dd��}tjgd���}t	||��dS)NrzrCr|r)�rzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrBr�s   r*�test_check_maximum_2z"TestStatistic.test_check_maximum_2�s_���I�c�N�N�Q����F�1�h�	�*�*���H�
?�
?�
?�
�
��&	�1�a� � � � � r,c��tjd��dz}tj|ddd���}tjgd���}t	||��dS)NrzrCr|rrr)�rrrrrrrrrrrrrrrrrrrrrrrrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrzrBr�s   r*�test_check_maximum_stat_lengthz,TestStatistic.test_check_maximum_stat_length�sd���I�c�N�N�Q����F�1�h�	�r�:�:�:���H�
?�
?�
?�
�
��&	�1�a� � � � � r,c��tjd��}tj|dd��}tjgd���}t	||��dS)Nrzr|r��rrrrrrrrrrrrrrrrrrrrrrrrrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rrrrrrrrrrrrrrrrrrrrrBr�s   r*�test_check_minimum_1z"TestStatistic.test_check_minimum_1�sZ���I�c�N�N���F�1�h�	�*�*���H�
+�
+�
+�
�
��&	�1�a� � � � � r,c��tjd��dz}tj|dd��}tjgd���}t	||��dS)Nrzr0r|r)�r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rz�er0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0rBr�s   r*�test_check_minimum_2z"TestStatistic.test_check_minimum_2s_���I�c�N�N�Q����F�1�h�	�*�*���H�
+�
+�
+�
�
��&	�1�a� � � � � r,c��tjd��dz}tj|ddd���}tjgd���}t	||��dS)NrzrCr|rrr)�rCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rzr:r:r:r:r:r:r:r:r:r:r:r:r:r:r:r:r:r:r:r:rBr�s   r*�test_check_minimum_stat_lengthz,TestStatistic.test_check_minimum_stat_lengthsd���I�c�N�N�Q����F�1�h�	�r�:�:�:���H�
5�
5�
5�
�
��&	�1�a� � � � � r,c���tjd���d��}tj|dd��}tjgd���}t||��dS)Nrzr{r|r����H@rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�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�rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr�r�s   r*�test_check_medianzTestStatistic.test_check_median2sk���I�c�N�N�!�!�#�&�&���F�1�h��)�)���H�
I�
I�
I�
�
��&	�1�a� � � � � r,c���tjgd�gd�gd�g��}tj|dd��}tjgd�gd�gd�gd	�gd�g��}t||��dS)
N�rrCr.�r.rZrD�rDr�r0rCr)r.r.rZr.r.�rrrCr.r�rZr.rZrDrZ�r�rDr�r0r�)r!r"rerr�s   r*�test_check_median_01z"TestStatistic.test_check_median_01Js����H�i�i�i����I�I�I�6�7�7���F�1�a��"�"���H�
�_�_�
�_�_�
�_�_�
�_�_�
�_�_�

�
�
��	�1�a� � � � � r,c���tjgd�gd�gd�g��}tj|jdd��j}tjgd�gd�gd�gd	�gd�g��}t	||��dS)
NrVrWrXrCr)rZr.rZr.rZrYrZr[)r!r"re�Trr�s   r*�test_check_median_02z"TestStatistic.test_check_median_02Xs����H�i�i�i����I�I�I�6�7�7���F�1�3��8�$�$�&���H�
�_�_�
�_�_�
�_�_�
�_�_�
�_�_�

�
�
��	�1�a� � � � � r,c���tjd���d��}d|d<d|d<tj|ddd	�
��}tjgd���}t||��dS)Nrzr{r�rCr�r@r|r�rrZr)�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s   r*�test_check_median_stat_lengthz+TestStatistic.test_check_median_stat_lengthfs���I�c�N�N�!�!�#�&�&����!����"���F�1�h��f�=�=�=���H�
?�
?�
?�
�
��&	�1�a� � � � � r,c���gd�g}tj|ddd���}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g
��}t||��dS)N�r.rZr:�rZr�rr0r)r.r.r.r.r.r.rZr:r:r:r:r:r:r:r:�r!rer"rr�s   r*�test_check_mean_shape_onez'TestStatistic.test_check_mean_shape_one�s���
�Y�Y�K���F�1�f�f�!�4�4�4���H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
�
��"	�1�a� � � � � r,c���tjd���d��}tj|dd��}tjgd���}t||��dS)Nrzr{r|rrRr�r�s   r*�test_check_mean_2zTestStatistic.test_check_mean_2�sk���I�c�N�N�!�!�#�&�&���F�1�h��'�'���H�
I�
I�
I�
�
��&	�1�a� � � � � r,rW)rrrrc���tjgd���tjgd�tj���z}tj|d|��}t	|d|d��dS)z3 Test that appended and prepended values are equal )���r0rk)rg�-���q=rr?rlrrkN)r!r"�float64rer)r%rWr/s   r*�test_same_prepend_appendz&TestStatistic.test_same_prepend_append�sb��
�H�[�[�[�!�!�B�H�]�]�]�"�*�$M�$M�$M�M���F�1�f�d�#�#���Q�q�T�1�R�5�!�!�!�!�!r,r
�rE)rE)rrk))rZr0)rEr))rB�r0c���tjd���d��}d}tjt
|���5tj|d||���ddd��dS#1swxYwYdS)Nrp�r:rZ�#index can't contain negative valuesrFr0r�r!r;r<rIrJrKre)r%rWr
�arrrGs     r*�test_check_negative_stat_lengthz-TestStatistic.test_check_negative_stat_length�s���
�i��m�m�#�#�F�+�+��5��
�]�:�U�
3�
3�
3�	:�	:��F�3��4�[�9�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:s�A+�+A/�2A/c��tjd��}tj|d��}tj|ddd���}tjgd�gd�gd�gd�gd	�gd
�gd�gd�gd�gd�gd�g��}t||��dS)
Nrprq�rN�rr0r�rrm)
r:r:r:rZr:r�r�rDr�r�)
rCrCrCrrCr0rr.rr)
r�r�r�rr�r9r�r�r�r�)
r�r�r�r�r�r�r�r�r�r�)
r�r�r�r~r�r�r�r�r�r�)
r�r�r�r}r�r�r�r�r�r��r!r;r<rer"rr�s   r*�test_simple_stat_lengthz%TestStatistic.test_simple_stat_length�s����I�b�M�M���J�q�&�!�!���F�1�&�V��F�F�F���H�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
+�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
7�
�
��	�1�a� � � � � r,z)ignore:Mean of empty slice:RuntimeWarningzCignore:invalid value encountered in( scalar)? divide:RuntimeWarningrrc���tjddgd|d���}tjtjddtjtjg��}t	||��dS)Nr�r��rCr0rr)r!rer"�nanr)r%rWrtr&s    r*�test_zero_stat_length_validz)TestStatistic.test_zero_stat_length_valid�sV���f�b�"�X�v�t��;�;�;���8�R�V�R��R�V�R�V�<�=�=���S�(�#�#�#�#�#r,rrc�t�d}tjt|���5tjddgd|d���ddd��n#1swxYwYtjt|���5tjddgd|d���ddd��n#1swxYwYtjt|���5tjddgd|d���ddd��n#1swxYwYtjt|���5tjddgd|d���ddd��dS#1swxYwYdS)	Nz,stat_length of 0 yields no value for paddingrFr�r�rr)rCrrC)rIrJrKr!re�r%rWrGs   r*�test_zero_stat_length_invalidz+TestStatistic.test_zero_stat_length_invalid�s2��>��
�]�:�U�
3�
3�
3�	5�	5��F�B��8�Q��!�4�4�4�4�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5����	5�	5�	5�	5�
�]�:�U�
3�
3�
3�	:�	:��F�B��8�Q��&�9�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�
�]�:�U�
3�
3�
3�	5�	5��F�B��8�Q��!�4�4�4�4�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5�	5����	5�	5�	5�	5�
�]�:�U�
3�
3�
3�	:�	:��F�B��8�Q��&�9�9�9�9�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:�	:����	:�	:�	:�	:�	:�	:sG�A�A	�A	�+B�B�B�8C�C#�&C#�D-�-D1�4D1N)rQrRrSr�rCrFrHrKrNrPrTr\r_rbrgrirIrsrtrmrur{�filterwarningsrr�rTr,r*rxrx�s/������!�!�!�0!�!�!�0!�!�!�0!�!�!�0!�!�!�0!�!�!�0!�!�!�0!�!�!�0!�!�!�!�!�!�!�!�!�4!�!�!�,!�!�!�0�[���V�&�&�&���"�"�
��"��[���V�%M�%M�%M�N�N��[����M�M�M���:�:���O�N�:�!�!�!�*�[��� K�L�L��[���M����[���V�f�h�%7�8�8�$�$�9�8���M�L�
$�
�[���V�i��%;�<�<�	:�	:�=�<�	:�	:�	:r,rxc�J�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)�TestConstantc��tjd��}tj|ddd���}tjgd���}t	||��dS)Nrzr|r)rr~�r)�rrrrrrrrrrrrrrrrrrrrrrrrrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�r~r~r~r~r~r~r~r~r~r~r~r~r~r~r~r~r~r~r~r~rBr�s   r*�test_check_constantz TestConstant.test_check_constant�s_���I�c�N�N���F�1�h�
�H�E�E�E���H�
5�
5�
5�
�
��&	�1�a� � � � � r,c��tjd��}tj|dd��}tjgd���}t	||��dS)Nrzr|rrJrBr�s   r*�test_check_constant_zerosz&TestConstant.test_check_constant_zerossZ���I�c�N�N���F�1�h�
�+�+���H�
5�
5�
5�
�
��&	�1�a� � � � � r,c��tjd���dd��}tj|ddd���}tjgd�gd	�gd
�gd�gd�gd
�gd�gd�g��}t||��dS)NrprZr:r}r皙�����?�rWr)	rCrCrCrCrCrCrCrCrC)	rCrrCr0rr.rZrCrC)	rCr:r�r�rDrr�rCrC)	rCr9r�r�r�r�r�rCrC)	rCr�r�r~r�r�r�rCrC)	rCr�r}r�r�r�r�rCrC�r!r;r<rer"r�r%rtrgr&s    r*�test_check_constant_floatz&TestConstant.test_check_constant_float#s����i��m�m�#�#�A�q�)�)���v�c�6�
�#&�(�(�(���8�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�	
3����	��h�'�'�'�'�'r,c�<�tjd���dd��}|�tj��}tj|ddd���}tjgd�gd	�gd
�gd�gd�gd
�gd�gd�g��}t||��dS)NrprZr:�r}r}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�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�rlrer"r)r%rt�	arr_floatrgr&s     r*�test_check_constant_float2z'TestConstant.test_check_constant_float27s����i��m�m�#�#�A�q�)�)���J�J�r�z�*�*�	��v�i�!1�
�#&�(�(�(���8�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�	
N����	��h�'�'�'�'�'r,c��tjdt���}tj|ddd���}tjgd���}t||��dS)Nrzr?r|r)皙������333333�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�rrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)r!r;r	rer"rr�s   r*�test_check_constant_float3z'TestConstant.test_check_constant_float3Lsi���I�c��'�'�'���F�1�h�
�L�I�I�I���H�
I�
I�
I�
�
��&	��1�����r,c
��tjd���dd��}tj|ddd���}tjgd�gd	�gd
�gd�gd�gd
�gd�g��}t||��dS)NrprZr:)�rCrorrr�)
rrrrrrrrrr)
rrrrCr0rr.rZrr)
rrr:r�r�rDrr�rr)
rrr9r�r�r�r�r�rr)
rrr�r�r~r�r�r�rr)
rrr�r}r�r�r�r�rrr�r�s    r*�"test_check_constant_odd_pad_amountz/TestConstant.test_check_constant_odd_pad_amountds����i��m�m�#�#�A�q�)�)���v�c�<�j�#$�&�&�&���8�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
7�
�
��	��h�'�'�'�'�'r,c��tjd���dd��}tj�|ddd���}tjgd�gd�gd	�gd
�gd
�g��}t
||��dS)Nr.r0)r})rCrr)r}�rr.r�)rrCrCr.r.r.)rrrCr.r.r.)rr0rr.r.r.)rr0r0r.r.r.)r!r;r<�librer"rr�s    r*�test_check_constant_pad_2dz'TestConstant.test_check_constant_pad_2dus����i��l�l�"�"�1�a�(�(���v�z�z�#�/�j�*:��<�<���8�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�	
!�
�
��	��h�'�'�'�'�'r,c��d}tjd|tj���}tj|dd|������}tjd|tj���}t||��d}tjd|tj���}tj|dd|������}tjd|tj���}t||��dS)	Nl����rZr?rCrr�r�l����)r!�full�uint64re�minr�int64)r%�
uint64_maxrtrgr&�	int64_maxs      r*�test_check_large_integersz&TestConstant.test_check_large_integers�s��� �
��g�a��2�9�5�5�5���v�c�1�:�s�w�w�y�y�I�I�I���7�1�j��	�:�:�:���4��*�*�*��	��g�a��"�(�3�3�3���v�c�1�:�s�w�w�y�y�I�I�I���7�1�i�r�x�8�8�8���4��*�*�*�*�*r,c�B�tjdt���}t��}||d<t��}t��}tj|dd||f���}tjdt���}||d<||d<||d<t	||��dS)NrCr?rr)�	pad_widthrWrryr0)r!rr#rer)r%rt�obj_a�obj_b�obj_cr&s      r*�test_check_object_arrayz$TestConstant.test_check_object_array�s����h�q��'�'�'��������A�����������f�S�A�J�&+�U�^�5�5�5���8�D��/�/�/���������������3��)�)�)�)�)r,c�z�tjd��}tj|gd�d���}|jdksJ�dS)N�rrr0��rror�rrb�rr.r.�r!�zerosrerd�r%rtr(s   r*�test_pad_empty_dimensionz%TestConstant.test_pad_empty_dimension�sG���h�y�!�!�����/�/�/�j�A�A�A���|�y�(�(�(�(�(�(r,N)
rQrRrSr�r�r�r�r�r�r�r�r�r�rTr,r*r�r��s�������!�!�!�0!�!�!�0(�(�(�((�(�(�*���0(�(�(�"(�(�(�+�+�+�*�*�*� )�)�)�)�)r,r�c��eZdZd�Zd�Zej�ef���d���Z	d�Z
ej�de��d���Z
dS)	�TestLinearRampc���tjd���d��}tj|ddd���}tjgd���}t||dd�	��dS)
Nrzr{r|r)r.rZ)r)�r�g���Q�@gq=
ףp
@g)\��(@g�z�G�
@g������	@gR���Q@g
ףp=
@g�(\��@g{�G�z@g333333@g�Q���@g�p=
ף@g���Q��?g)\��(�?g�������?g
ףp=
�?g{�G�z�?g�Q����?g���Q��?g�������?g{�G�z�?g���Q��?g{�G�z�?g{�G�z�?r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�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�g33333�W@gffffffV@g�����9U@g�����T@g�R@g33333�Q@gfffff�P@g33333�N@g�����YL@r�gfffff�G@g�����LE@g33333�B@g������@@g�<@g������7@g�����3@g������,@gffffff#@r�g�h㈵��>)�rtol�atol)r!r;r�rer"rr�s   r*�test_check_simplez TestLinearRamp.test_check_simple�sw���I�c�N�N�!�!�#�&�&���F�1�h�
�&�A�A�A���H�
F�
F�
F�
�
��&	��1�4�d�3�3�3�3�3�3r,c�8�tjd���dd���tj��}tj|ddd���}tjgd�gd	�gd
�gd�gd�gd
�gd�gd�g��}t||��dS)Nr~r.rZ)r0r0rr\�rWr)	r�r�r�r�r�r�r�r�r�)	r�r�r�r�r�g�?r�r�r�)	r�r�r�r�r�r�r�r�r�)	r�g@r�r�r�r�r�g@r�)	r�r�r�r�r�r�r�r�r�)	r��@r�r�r�r�r��#@r�)	r�g@r�r�g!@r�r�g@r�r�r�s    r*�
test_check_2dzTestLinearRamp.test_check_2d�s����i��m�m�#�#�A�q�)�)�0�0���<�<���v�c�6�
�&�I�I�I���8�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
B�
D�E�E��	��h�'�'�'�'�'r,)�
exceptionsc�x�ddlm}tj|dd��|dd��g��}tj|ddd���}tj|dd	��|d
d	��|dd	��|dd	��|d
d	��|dd	��|dd	��g��}t||��dS)Nr)�FractionrCr0rkrNrr�r9rr:���rBrE)�	fractionsr�r!r"rer)r%r�rt�actualr&s     r*�test_object_arrayz TestLinearRamp.test_object_array�s���&�&�&�&�&�&��h����A������Q���8�9�9�����V�-�A�F�F�F���8��H�a�����H�a�����H�a�����H�R�����H�R�����H�R�����H�R����
����	�V�X�&�&�&�&�&r,c�P�tjtjd���dd��dd���}t	|dd�dfd	��t	|dd�d
fd	��t	|ddd�fd	��t	|d
dd�fd	��dS)z!Ensure that end values are exact.rr0rZ)���{rrbNrr�rk)r!rerOr<r)r%r/s  r*�test_end_valueszTestLinearRamp.test_end_values�s����F�2�7�2�;�;�&�&�q�!�,�,�j�}�M�M�M���Q�q�q�q�!�t�W�b�!�!�!��Q�q�q�q�"�u�X�r�"�"�"��Q�q�!�!�!�t�W�b�!�!�!��Q�r�1�1�1�u�X�r�"�"�"�"�"r,r@c�b�tjdg|���}tj|ddd���}tjgd�|���}t||��tjdg|���}tj|ddd���}tjgd�|���}t||��dS)	a<
        Check correct behavior of unsigned dtypes if there is a negative
        difference between the edge to pad and `end_values`. Check both cases
        to be independent of implementation. Test behavior for all other dtypes
        in case dtype casting interferes with complex dtypes. See gh-14191.
        rr?rrr�)rrCr0rr0rCr)rr0rCrrCr0rN)r!r"rer)r%r@r'r(r&s     r*�test_negative_differencez'TestLinearRamp.test_negative_difference�s���
�H�a�S��&�&�&�����1�=�Q�?�?�?���8�1�1�1��?�?�?���V�X�&�&�&��H�a�S��&�&�&�����1�=�Q�?�?�?���8�1�1�1��?�?�?���V�X�&�&�&�&�&r,N)rQrRrSr�r�rIrs�xfail�AssertionErrorr�r�rt�_numeric_dtypesr�rTr,r*r�r��s�������4�4�4�0(�(�(��[���>�"3��4�4�'�'�5�4�'�$#�#�#��[���W�o�6�6�'�'�7�6�'�'�'r,r�c�8�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�TestReflectc��tjd��}tj|dd��}tjgd���}t	||��dS)Nrzr|r)�r}r�r�r�r�r~r�r�r�r�r�r�r�r9r�rrDr�r�r:rZr.rr0rCrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rAr@r?r>r=r<r;r:r9r8r7r6r5r4r3r2r1r0r/r.rBr�s   r*r�zTestReflect.test_check_simple�rDr,c��tjd��}tj|ddd���}tjgd���}t	||��dS)Nrzr|r�odd�r)�i���������������������������������������������������r����rBrArErkrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rzrM�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�wrBr�s   r*�test_check_odd_methodz!TestReflect.test_check_odd_methods_���I�c�N�N���F�1�h�	��>�>�>���H�
?�
?�
?�
�
��&	�1�a� � � � � r,c���gd�gd�g}tj|dd��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g��}t||��dS)Nrd�r:r�r�rer)r�r:r�r�r�r:r�r�r�r:r�r�r�r:r��rZr.rZr:rZr.rZr:rZr.rZr:rZr.rZrfr�s   r*�test_check_large_padz TestReflect.test_check_large_pad+s���
�Y�Y�	�	�	�"���F�1�f�i�(�(���H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
�
��$	�1�a� � � � � r,c���gd�g}tj|dd��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g
��}t||��dS)Nrdrerrrfr�s   r*�test_check_shapezTestReflect.test_check_shapeBs���
�Y�Y�K���F�1�f�i�(�(���H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
�
��"	�1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)N�rCr0rr0r)rr0rCr0rr0rCrfr�s   r*�
test_check_01zTestReflect.test_check_01XsE���F�9�9�9�a��+�+���H�*�*�*�+�+���1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)Nrrr)	r0rr0rCr0rr0rCr0rfr�s   r*�
test_check_02zTestReflect.test_check_02]sE���F�9�9�9�a��+�+���H�0�0�0�1�1���1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)Nrr.r)rCr0rr0rCr0rr0rCr0rrfr�s   r*�
test_check_03zTestReflect.test_check_03bsE���F�9�9�9�a��+�+���H�6�6�6�7�7���1�a� � � � � r,N)
rQrRrSr�r�rrrr	rrTr,r*r�r��s}������!�!�!�0!�!�!�0!�!�!�.!�!�!�,!�!�!�
!�!�!�
!�!�!�!�!r,r�c��eZdZdZej�dee�	��ddhz
����d���Z
ej�de�	����d���ZdS)�TestEmptyArrayz<Check how padding behaves on arrays with an empty dimension.rWrrc��d}tjt|���5tjgd|���ddd��n#1swxYwYtjt|���5tjtjd��d|���ddd��n#1swxYwYtjt|���5tjtjd��d|���ddd��dS#1swxYwYdS)NzFcan't extend empty axis 0 using modes other than 'constant' or 'empty'rFr.rbr)rr)r�r�)rIrJrKr!re�ndarrayr�r�s   r*r�z'TestEmptyArray.test_pad_empty_dimensionks�����
�]�:�U�
3�
3�
3�	%�	%��F�2�q�t�$�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�
�]�:�U�
3�
3�
3�	0�	0��F�2�:�a�=�=�!�$�/�/�/�/�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0����	0�	0�	0�	0�
�]�:�U�
3�
3�
3�	>�	>��F�2�8�F�#�#�\��=�=�=�=�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>����	>�	>�	>�	>�	>�	>s5�A�A�	A�(*B�B"�%B"�*C;�;C?�C?c�r�tjtjd��d|���}|jdksJ�dS)N)r0rr0)ryr�r�rb)r�rr.)r!rerOrd)r%rWr(s   r*�test_pad_non_empty_dimensionz+TestEmptyArray.test_pad_non_empty_dimensionzs<������	�*�*�,>�T�J�J�J���|�y�(�(�(�(�(�(r,N)rQrRrS�__doc__rIrsrt�sortedrurvr�rrTr,r*r
r
hs�������F�F��[���	���z���(�(�J��+@�@�A�A���
>�>���
>��[���V�Z�_�_�%6�%6�7�7�)�)�8�7�)�)�)r,r
c�>�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	S)
�
TestSymmetricc��tjd��}tj|dd��}tjgd���}t	||��dS)Nrzr|r)�r�r�r�r�r~r�r�r�r�r�r�r�r9r�rrDr�r�r:rZr.rr0rCrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�r�rAr@r?r>r=r<r;r:r9r8r7r6r5r4r3r2r1r0r/rBr�s   r*r�zTestSymmetric.test_check_simple�sZ���I�c�N�N���F�1�h��,�,���H�
5�
5�
5�
�
��&	�1�a� � � � � r,c��tjd��}tj|ddd���}tjgd���}t	||��dS)Nrzr|rr�r�)�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rBrArErkrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�r�rzrMr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rBr�s   r*r�z#TestSymmetric.test_check_odd_method�s_���I�c�N�N���F�1�h��%�@�@�@���H�
?�
?�
?�
�
��&	�1�a� � � � � r,c���gd�gd�g}tj|dd��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g��}t||��dS)Nrdrrer�rZr:r:rZr.r.rZr:r:rZr.r.rZr:r:)r�r�r�r�r:r:r�r�r�r�r:r:r�r�r�rfr�s   r*rz"TestSymmetric.test_check_large_pad�s���
�Y�Y�	�	�	�"���F�1�f�k�*�*���H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
�
��&	�1�a� � � � � r,c���gd�gd�g}tj|ddd���}tjgd�gd�gd�gd�gd	�gd	�gd
�gd
�gd�gd�gd�gd�gd
�gd
�g��}t||��dS)Nrdrrerr�r�)rArErErkrrrCr0r0rr.r.rZr:r:)rkrrrCr0r0rr.r.rZr:r:r�r�r�)rCr0r0rr.r.rZr:r:r�r�r�rDrr)rr.r.rZr:r:r�r�r�rDrrr�r9r9)rZr:r:r�r�r�rDrrr�r9r9r�r�r�)r�r�r�rDrrr�r9r9r�r�r�r�r�r�)rDrrr�r9r9r�r�r�r�r�r�r�r�r�rfr�s   r*�test_check_large_pad_oddz&TestSymmetric.test_check_large_pad_odd�s���
�Y�Y�	�	�	�"���F�1�f�k��>�>�>���H�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
I�
K�
�
��$	�1�a� � � � � r,c���gd�g}tj|dd��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g
��}t||��dS)Nrdrerrrfr�s   r*rzTestSymmetric.test_check_shape�s���
�Y�Y�K���F�1�f�k�*�*���H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
�
��"	�1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)Nrr0r)r0rCrCr0rrr0rfr�s   r*rzTestSymmetric.test_check_01�sE���F�9�9�9�a��-�-���H�*�*�*�+�+���1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)Nrrr)	rr0rCrCr0rrr0rCrfr�s   r*r	zTestSymmetric.test_check_02�sE���F�9�9�9�a��-�-���H�0�0�0�1�1���1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)Nrr:r)rCr0rrr0rCrCr0rrr0rCrCr0rrfr�s   r*rzTestSymmetric.test_check_03sE���F�9�9�9�a��-�-���H�B�B�B�C�C���1�a� � � � � r,N)rQrRrSr�r�rrrrr	rrTr,r*rr�s�������!�!�!�0!�!�!�0!�!�!�0!�!�!�.!�!�!�,!�!�!�
!�!�!�
!�!�!�!�!r,rc�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�TestWrapc��tjd��}tj|dd��}tjgd���}t	||��dS)Nrzr|r)�r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r~r�r�r�r�r}r�r�r�r�rpr�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rAr�rrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rBr�s   r*r�zTestWrap.test_check_simplesZ���I�c�N�N���F�1�h��'�'���H�
5�
5�
5�
�
��&	�1�a� � � � � r,c�b�tjd��}tj|d��}tj|dd��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g��}t||��dS)Nr9r�)rr9r)rr�r�rDrr�r�rDrr�r�rDrr�r�rDrr�r�rDrr�r�rDrr�)r0rrrCr0rrrCr0rrrCr0rrrCr0rrrCr0rrrCr0r)r:r�r.rZr:r�r.rZr:r�r.rZr:r�r.rZr:r�r.rZr:r�r.rZr:r�rzr�s   r*rzTestWrap.test_check_large_pads����I�b�M�M���J�q�&�!�!���F�1�h��'�'���H�.�.�.�)�)�)�)�)�)�.�.�.�)�)�)�)�)�)�.�.�.�)�)�)�)�)�)�.�.�.�)�)�)�)�)�)�.�.�.�)�)�)�)�)�)�.�.�.�)�)�)�)�)�)�.�.�.�)�)�)�)�)�)�.�.�.�)�)�)�)�)�)�.�.�.�e3
/�5
�5
��l	�1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)Nrrr)	rCr0rrCr0rrCr0rrfr�s   r*rzTestWrap.test_check_01[sE���F�9�9�9�a��(�(���H�0�0�0�1�1���1�a� � � � � r,c��tjgd�dd��}tjgd���}t||��dS)Nrr.r)rrCr0rrCr0rrCr0rrCrfr�s   r*r	zTestWrap.test_check_02`sE���F�9�9�9�a��(�(���H�6�6�6�7�7���1�a� � � � � r,c��tjd��}tj|dd���}t||dd�dd�f��dS)Nra)rrZrrbr�)r!rOrerr�s   r*�test_pad_with_zerozTestWrap.test_pad_with_zeroesK���G�F�O�O���F�1�f�6�*�*�*���1�a����S�b�S��k�*�*�*�*�*r,c�b�tjd��}tj|dd���}ttj||||fdd�|��tjd��}tj|dd���}ttj||||fdd�|��dS)	zy
        Check wrapping on each side individually if the wrapped area is longer
        than the original array.
        rZ)r9rrrbrN)rr9rA)r!r;rer�r_r�s   r*�test_repeated_wrappingzTestWrap.test_repeated_wrappingjs���

�I�a�L�L���F�1�g�F�+�+�+���2�5��A�q�!��,�Q�R�R�0�!�4�4�4��I�a�L�L���F�1�g�F�+�+�+���2�5��A�q�!��,�S�b�S�1�1�5�5�5�5�5r,N)	rQrRrSr�rrr	r'r*rTr,r*r!r!so������!�!�!�0:!�:!�:!�x!�!�!�
!�!�!�
+�+�+�
6�6�6�6�6r,r!c��eZdZd�Zd�ZdS)�TestEdgec��tjd��}tj|d��}tj|dd��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�g	��}t||��dS�	Nr9�r.rrwr)rrrrrCr0r0r0)rrrrr.rZrZrZ)r:r:r:r:r�r�r�r�)rDrDrDrDrr�r�r�rzr�s   r*r�zTestEdge.test_check_simpleys����I�b�M�M���J�q�&�!�!���F�1�&��/�/���H�
%�
%�
%�
%�
%�
%�
%�
%�
%�
%�
%�
%�
%�
%�
%�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�
)�

+�
�
��	�1�a� � � � � r,c� �tjgd���}tj|dd��}tjgd���}t||��tjgd�gd�g��}tj|dd��}tj|dd��}t||��tjd���dd	d
��}tj|dd��}tj|dd��}t||��dS)Nr)r}r)rCrCr0rrrrdr�r�r0rr.)r}r}r})r!r"rerr;r<)r%r/�paddedr&s    r*�test_check_width_shape_1_2z#TestEdge.test_check_width_shape_1_2�s���
�H�Y�Y�Y�������9�f�-�-���8�.�.�.�/�/���6�8�,�,�,��H�i�i�i����+�,�,�����9�f�-�-���6�!�-�v�6�6���6�8�,�,�,��I�b�M�M�!�!�!�Q��*�*�����9�f�-�-���6�!�5�v�>�>���6�8�,�,�,�,�,r,N)rQrRrSr�r2rTr,r*r,r,xs2������!�!�!�&-�-�-�-�-r,r,c��eZdZd�Zd�ZdS)�	TestEmptyc���tjd���dd��}tj|ddgd���}|jdksJ�t||d	d
�dd�f��dS)
Nr�r.r:rN)rrCrrb)rDrr0rArrk�r!r;r<rerdrr�s   r*�test_simplezTestEmpty.test_simple�st���i��m�m�#�#�A�q�)�)�����f�f�-�G�<�<�<���|�w�&�&�&�&��S�&��2��q��t��,�-�-�-�-�-r,c�z�tjd��}tj|gd�d���}|jdksJ�dS)Nr�r�rrbr�r�r�s   r*r�z"TestEmpty.test_pad_empty_dimension�sG���h�y�!�!�����/�/�/�g�>�>�>���|�y�(�(�(�(�(�(r,N)rQrRrSr7r�rTr,r*r4r4�s2������.�.�.�)�)�)�)�)r,r4c	���d�}tjd���dd��}tj|d|��}tjgd�gd�gd�gd�gd�gd�g��}t||��dS)Nc�<�d|d|d�<d||dd�<dS)NrrrCrT)�vectorr��iaxis�kwargss    r*�_padwithtensz6test_legacy_vector_functionality.<locals>._padwithtens�s.�� "��}�	�!��}��!#��	�!��}�~�~���r,r:r0r)rrrrrrr)rrrrCr0rr)rrrr.rZrrrz)r>r/r�s   r*� test_legacy_vector_functionalityr?�s���$�$�$�	�	�!�����Q��"�"�A�
��q�!�\�"�"�A�
��	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	'�		
�		
�A��q�!�����r,c��tjdgdd���}tjgd���}t||��dS)NrCr0rrb)rrrCrrrf)r/r�s  r*�test_unicode_moderA�sC��
���s�A�J�'�'�'�A�
�����!�!�A��q�!�����r,rW)rrrrc��tjdd���}d}tjdd���}ttj|||���|��dS)Nr/)�
fill_valuerw)rDr�rb)r!r�rre)rWr/rhr�s    r*�test_object_inputrD�sX��	���4�(�(�(�A��G�
���4�(�(�(�A��r�v�a��t�4�4�4�a�8�8�8�8�8r,c
��eZdZej�dgd���ej�de�����d�����Zej�de�����d���Z	ej�dgd���ej�de�����d�����Z
ej�dd	d
de��dfd
defedd��dfdg��ej�de�����d�����Z
d�Zej�dgd���ej�de�����d�����ZdS)�TestPadWidthr�))r.rZr:r�)r�rory)r}r�)rZr:))rr.rZ)rrCr0rWc���tjd���d��}d}tjt
|���5tj|||��ddd��dS#1swxYwYdS)Nrprqz(operands could not be broadcast togetherrFrs�r%r�rWrtrGs     r*�test_misshaped_pad_widthz%TestPadWidth.test_misshaped_pad_width�s����i��m�m�#�#�F�+�+��:��
�]�:�U�
3�
3�
3�	)�	)��F�3�	�4�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�	)�	)��A)�)A-�0A-c���tjd���d��}d}tjt
|���5tj|d|��ddd��dS#1swxYwYdS)NrprqzDinput operand has more dimensions than allowed by the axis remappingrF))ry)r.)rZ)r�r�rors)r%rWrtrGs    r*�test_misshaped_pad_width_2z'TestPadWidth.test_misshaped_pad_width_2�s����i��m�m�#�#�F�+�+����
�]�:�U�
3�
3�
3�	H�	H��F�3�@�$�G�G�G�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H�	H����	H�	H�	H�	H�	H�	HrJrnc���tjd���d��}d}tjt
|���5tj|||��ddd��dS#1swxYwYdS)NrprqrrrFrsrHs     r*�test_negative_pad_widthz$TestPadWidth.test_negative_pad_width�s����i��m�m�#�#�F�+�+��5��
�]�:�U�
3�
3�
3�	)�	)��F�3�	�4�(�(�(�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)�	)�	)rJzpad_width, dtype)�3N)�wordNr3N)g333333@N))r0rr.rxrCrk)))g�������rrxNc�f�tjd���d��}d}|�`tjt
|���5tj|tj||���|��ddd��dS#1swxYwYdStjt
|���5tj|||��ddd��n#1swxYwYtjt
|���5tj|tj|��|��ddd��dS#1swxYwYdS)Nrprqz%`pad_width` must be of integral type.rFr?)r!r;r<rIrJ�	TypeErrorrer")r%r�r@rWrtrGs      r*�
test_bad_typezTestPadWidth.test_bad_type�s����i��m�m�#�#�F�+�+��7������y��6�6�6�
D�
D���s�B�H�Y�e�<�<�<�d�C�C�C�
D�
D�
D�
D�
D�
D�
D�
D�
D�
D�
D�
D����
D�
D�
D�
D�
D�
D���y��6�6�6�
-�
-���s�I�t�,�,�,�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-�
-����
-�
-�
-�
-���y��6�6�6�
7�
7���s�B�H�Y�/�/��6�6�6�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7����
7�
7�
7�
7�
7�
7s6�+A?�?B�B�'C
�
C�C�0)D&�&D*�-D*c�&�tjd��}tj|d��}tj|tjd��d��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�g	��}t||��dSr.rzr�s   r*�test_pad_width_as_ndarrayz&TestPadWidth.test_pad_width_as_ndarrays����I�b�M�M���J�q�&�!�!���F�1�b�h�/�0�0�&�9�9���H�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�
0�

2�
�
��	�1�a� � � � � r,)rr\)r\r\c��tjd���dd��}t|tj|||�����dS)Nrpr:rZrb)r!r;r<rre)r%r�rWrts    r*�test_zero_pad_widthz TestPadWidth.test_zero_pad_widthsH���i��m�m�#�#�A�q�)�)���3���s�I�D� A� A� A�B�B�B�B�Br,)rQrRrSrIrsrtrurvrIrLrNr#r
rSrUrWrTr,r*rFrF�s'�������[���[�+�+�+����[���V�Z�_�_�%6�%6�7�7�)�)�8�7�
��)��[���V�Z�_�_�%6�%6�7�7�H�H�8�7�H��[����K�K�K�M�M��[���V�Z�_�_�%6�%6�7�7�)�)�8�7�M�M�)��[���/����	����4���	�f�%�	���B�����#�	2�	�	��[���V�Z�_�_�%6�%6�7�7�7�7�8�7�	�	�7�!�!�!�&�[���[�*G�*G�*G�H�H��[���V�Z�_�_�%6�%6�7�7�C�C�8�7�I�H�C�C�Cr,rFc��t|}i}t���D]}||kr|�|���tjgd�d|fi|��|���D]e\}}d�|��}tjt|���5tjgd�d|fi||i��ddd��n#1swxYwY�fdS)z1Test behavior of pad's kwargs for the given mode.rrCz+unsupported keyword arguments for mode '{}'rFN)
ru�values�updater!re�items�formatrIrJrK)rW�allowed�not_allowedr=�key�valuerGs       r*�test_kwargsra s9�����G��K��#�#�%�%�'�'���W������v�&�&�&���F�9�9�9�a��)�)��)�)�)�!�'�'�)�)�7�7�
��U�=�D�D�T�J�J��
�]�:�U�
3�
3�
3�	7�	7��F�9�9�9�a��6�6�#�u��6�6�6�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7����	7�	7�	7�	7��7�7s�&C�C	�C	c�|�tjddg��}ttj|d��gd���dS)NrCr0)rrrCrCrr)r!r"rre)rts r*�test_constant_zero_defaultrc1s<��
�(�A�q�6�
�
�C��r�v�c�1�~�~�'9�'9�'9�:�:�:�:�:r,rC�constTFc���d�|��}tjt|���5t	jgd�d|���ddd��dS#1swxYwYdS)Nzmode '{}' is not supportedrFrr.rb)r\rIrJrKr!re)rWrGs  r*�test_unsupported_moderf6s���'�.�.�t�4�4�E�	��z��	/�	/�	/�(�(�
��y�y�y�!�$�'�'�'�'�(�(�(�(�(�(�(�(�(�(�(�(����(�(�(�(�(�(s�A�A�Ac���tjd���dd��ddd�ddd�f}tj|d|��}|jdksJ�t|dd�dd�f|��dS)Nr�r.r:r0rN)r�r�rAr6)rWrtr(s   r*�test_non_contiguous_arrayrh=s���
�)�B�-�-�
�
��1�
%�
%�c�c��c�3�3�Q�3�h�
/�C�
�V�C���
&�
&�F��<�6�!�!�!�!����"��a��d�
�#�S�)�)�)�)�)r,c���tjdd���}tj|d|��jdsJ�tjdd���}tj|d|��jdsJ�dS)	z5Test if C and F order is preserved for all pad modes.)rZr�C)�orderrZ�C_CONTIGUOUS�F�F_CONTIGUOUSN)r!rOre�flags)rWr's  r*�test_memory_layout_persistencerpEsv��	���s�#�#�#�A�
�6�!�Q����#�N�3�3�3�3�
���s�#�#�#�A�
�6�!�Q����#�N�3�3�3�3�3�3r,r@c�z�tjd|���}tj|d|���}|j|ksJ�dS)N)rr0rCr?rCrb)r!r�rer@)r@rWrtr(s    r*�test_dtype_persistencerrNsG��
�(�9�E�
*�
*�
*�C�
�V�C���
&�
&�
&�F��<�5� � � � � � r,)&rrI�numpyr!�
numpy.testingrrr�numpy.lib.arraypadr�sctypesr�rurrVrxr�r�r�r
rr!r,r4r?rArsrtrDrFrvrarcr#rfrhrprrrTr,r*�<module>rws������
�
�
�����K�K�K�K�K�K�K�K�K�K�(�(�(�(�(�(��J�v���j�����j����	�j�����#�A�&�� �!�$��t�$�
�D�!��d�#��t�$���'� �&�)��
���
�P*�P*�P*�P*�P*�P*�P*�P*�fM�M�M�M�M�M�M�M�,f:�f:�f:�f:�f:�f:�f:�f:�Rp)�p)�p)�p)�p)�p)�p)�p)�fR'�R'�R'�R'�R'�R'�R'�R'�jk!�k!�k!�k!�k!�k!�k!�k!�\)�)�)�)�)�)�)�)�0C!�C!�C!�C!�C!�C!�C!�C!�Lo6�o6�o6�o6�o6�o6�o6�o6�d$-�$-�$-�$-�$-�$-�$-�$-�N
)�
)�
)�
)�
)�
)�
)�
)����(��������!I�!I�!I�J�J�9�9�K�J�9�NC�NC�NC�NC�NC�NC�NC�NC�b��������!2�!2�3�3�
7�
7�4�3�
7� ;�;�;�
�����!�W�f�f�h�h��d�E�!J�K�K�(�(�L�K�(���������!2�!2�3�3�*�*�4�3�*���������!2�!2�3�3�4�4�4�3�4������/�2�2���������!2�!2�3�3�!�!�4�3�3�2�!�!�!r,

Youez - 2016 - github.com/yon3zu
LinuXploit