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 :  /Python312/Lib/site-packages/numpy/lib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python312/Lib/site-packages/numpy/lib/tests/__pycache__/test_arraypad.cpython-312.pyc
�

	�g�����dZddlZddlZddlmZmZmZddlm	Z	ejjdejjdzejjdzejjdzZd	diid
diddiddiddiddidd
idd
iiid�Z
Gd�d�ZGd�d�ZGd�d�ZGd�d�ZGd�d�ZGd�d�ZGd�d�ZGd�d�ZGd�d �ZGd!�d"�ZGd#�d$�Zd%�Zd&�Zej6j9d'gd(��d)��ZGd*�d+�Zej6j9d'e
j?��d,��Z d-�Z!ej6j9d'd.d/e"�dd0d1g�d2��Z#ej6j9d'e
j?��d3��Z$ej6j9d'e
j?��d4��Z%ej6j9d5e�ej6j9d'e
j?��d6���Z&y)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�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�TestAsPairsc��tjddggdz�}ddgdggfD]}t|d�}t||��t	�}tt|d�tj||ggdz��y)z Test casting for a single value.��
N��np�arrayrr�object��self�expected�x�result�objs     �?C:\Python312\Lib\site-packages\numpy/lib/tests/test_arraypad.py�test_single_valuezTestAsPairs.test_single_value!s}���8�8�a��V�H�r�M�*���a�S�A�3�%��	+�A��q�"�%�F����*�	+��h����c�2���H�H�s�C�j�\�B�&�'�	
�c���tjddggdz�}ddgddggfD]}t|d�}t||��t	�}ttd|gd�tjd|ggdz��ttdgdggd�tjddgddgg��ttdg|ggd�tjddg||gg��y)z-Test proper casting for two different values.r�r�a�Nr r$s     r*�test_two_valueszTestAsPairs.test_two_values.s����8�8�a��V�H�r�M�*���a�&�A�q�6�(�#�	+�A��q�"�%�F����*�	+��h����s�C�j�"�%��H�H�s�C�j�\�B�&�'�	
�	���s�Q�C�j�!�$��H�H�q�!�f�q�!�f�%�&�	
�
	���u�s�e�n�a�(��H�H�s�C�j�3��*�-�.�	
r,c�h�d}ttddd��|�ttddd��|�y)N)�NNr3r3rF��as_indexT)rr�r%r&s  r*�test_with_nonezTestAsPairs.test_with_noneGs7��=����d�A��.��	
�	��d�A��-��	
r,c�x�tjd�jd�}tt	|d�|�y)z?Test if `x` already matching desired output are passed through.�)�r0r:N)r!�arange�reshaperrr6s  r*�test_pass_throughzTestAsPairs.test_pass_throughRs/���9�9�R�=�(�(��0����h��"��	
r,c
���ttddgdd��tjddggdztj���ttddgdd��tjdd	ggdztj���d
d
gd
ggd
d	gddgd
d	ggd	d
ggdd
ggdzddggzfD]4}tjtd��5t|dd��ddd��6y#1swY�AxYw)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_indexZs�����s�C�j�"�t�4��H�H�q�!�f�X��]�"�'�'�2�	
�	��s�D�k�2��5��H�H�q�!�f�X��]�"�'�'�2�	
��r�d�b�T�F�R��G�a��W��A�w�i�1�b�'���q�6�(�Q�,�1�b�'��*�,�	0�A����z�1B�C�
0��!�R�$�/�
0�
0�	0�
0�
0�s�C"�"C+	c��tjtd��5tdgggd�ddd�tjtd��5tddgdd	ggd�ddd�tjtd��5tt	j
d
�d�ddd�y#1swY��xYw#1swY�YxYw#1swYyxYw)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�	#����u�g�r�"�	#�
�]�]�:�-E�
F�	+���1�v��1�v�&��*�	+�
�]�]�:�-E�
F�	*��b�g�g�f�o�q�)�	*�	*�		#�	#��	+�	+��	*�	*�s#�B.�B:� C�.B7�:C�CN)	�__name__�
__module__�__qualname__r+r1r7r=rLrP�r,r*rr s ��
�
�2	
�
�
0�*r,rc��eZdZejjdej��d��Zejjdgd��d��Z	ejjdgd��d��Z
y)�TestConditionalShortcuts�modec���tjd�jddd�}|jD�cgc]}d��}}t	|tj
|||���ycc}w)N�xr.�r:�rr�rW�r!r;r<�shaper�pad�r%rW�test�_�pad_amts     r*�test_zero_padding_shortcutsz4TestConditionalShortcuts.test_zero_padding_shortcutstsQ���y�y��~�%�%�a��A�.��#'�:�:�.�a�6�.��.��4�����g�D�!A�B��/s�	A#)rrrrc	��tjd�jddd�}|jD�cgc]}d��}}t	tj
||d��tj
|||d�	��ycc}w)
NrYr.rZr:�rCrCrr\rC�rWr
r]r`s     r*�test_shallow_statistic_rangez5TestConditionalShortcuts.test_shallow_statistic_rangezsd���y�y��~�%�%�a��A�.��#'�:�:�.�a�6�.��.��2�6�6�$��f�=��6�6�$��d��J�	L��/s�	A:c	��tjd�jdd�}|jD�cgc]}d��}}t	tj
|||��tj
|||d���ycc}w)N�rZr:)rrr\rgr]r`s     r*�test_clip_statistic_rangez2TestConditionalShortcuts.test_clip_statistic_range�sb���y�y��}�$�$�Q��*��#'�:�:�.�a�6�.��.��2�6�6�$��d�;��6�6�$��d��K�	M��/s�	A9N)rQrRrSrI�mark�parametrize�
_all_modes�keysrdrhrkrTr,r*rVrVss����[�[���V�Z�_�_�%6�7�C�8�C�
�[�[���V�%N�O�L�P�L��[�[���V�%N�O�M�P�Mr,rVc�:�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zej"j%dgd��d��Zej"j%dgd��ej"j%dgd��d���Zd�Zej"j-d�ej"j-d�ej"j%dddg�d����Zej"j%dddg�d��Zy)�
TestStatisticc���tjd�jd�}tj|ddd��}tjgd��}t||�y)N�d�f)���r)rN�r
)���?ryryryryryryryryryryryryryryryryryryryryryryryry���?�@�@�@�@�@�@� @�"@�$@�&@�(@�*@�,@�.@�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;�astyper_r"r�r%r/�bs   r*�test_check_mean_stat_lengthz)TestStatistic.test_check_mean_stat_length�sM���I�I�c�N�!�!�#�&���F�F�1�l�F�
�C���H�H�
�
��&	�1�a� r,c��tjd�}tj|dd�}tjgd��}t	||�y)Nrsrur)��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�
������rw����rv����rj�� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�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;r_r"rr�s   r*�test_check_maximum_1z"TestStatistic.test_check_maximum_1��@���I�I�c�N���F�F�1�h�	�*���H�H�
5�
��&	�1�a� r,c��tjd�dz}tj|dd�}tjgd��}t	||�y)NrsrCrur)�rsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsr;r�s   r*�test_check_maximum_2z"TestStatistic.test_check_maximum_2�sE���I�I�c�N�Q����F�F�1�h�	�*���H�H�
?�
��&	�1�a� r,c��tjd�dz}tj|ddd��}tjgd��}t	||�y)NrsrCrurrrx)�rrrrrrrrrrrrrrrrrrrrrrrrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsr;r�s   r*�test_check_maximum_stat_lengthz,TestStatistic.test_check_maximum_stat_length�sG���I�I�c�N�Q����F�F�1�h�	�r�:���H�H�
?�
��&	�1�a� r,c��tjd�}tj|dd�}tjgd��}t	||�y)Nrsrur��rrrrrrrrrrrrrrrrrrrrrrrrrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rrrrrrrrrrrrrrrrrrrrr;r�s   r*�test_check_minimum_1z"TestStatistic.test_check_minimum_1�s@���I�I�c�N���F�F�1�h�	�*���H�H�
+�
��&	�1�a� r,c��tjd�dz}tj|dd�}tjgd��}t	||�y)Nrsr0rur)�r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rs�er0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r0r;r�s   r*�test_check_minimum_2z"TestStatistic.test_check_minimum_2sE���I�I�c�N�Q����F�F�1�h�	�*���H�H�
+�
��&	�1�a� r,c��tjd�dz}tj|ddd��}tjgd��}t	||�y)NrsrCrurrrx)�rCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rsr3r3r3r3r3r3r3r3r3r3r3r3r3r3r3r3r3r3r3r3r;r�s   r*�test_check_minimum_stat_lengthz,TestStatistic.test_check_minimum_stat_lengthsG���I�I�c�N�Q����F�F�1�h�	�r�:���H�H�
5�
��&	�1�a� r,c��tjd�jd�}tj|dd�}tjgd��}t||�y)Nrsrtrur����H@rLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrzr{r|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�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLrLr�r�s   r*�test_check_medianzTestStatistic.test_check_median2sL���I�I�c�N�!�!�#�&���F�F�1�h��)���H�H�
I�
��&	�1�a� r,c���tjgd�gd�gd�g�}tj|dd�}tjgd�gd�gd�gd	�gd�g�}t||�y)
N�rrCr.�r.rZrD�rDr�r0rCr)r.r.rZr.r.�rrrCr.r�rZr.rZrDrZ�r�rDr�r0r�)r!r"r_rr�s   r*�test_check_median_01z"TestStatistic.test_check_median_01JsW���H�H�i��I�6�7���F�F�1�a��"���H�H�
�
�
�
�
�

�
��	�1�a� r,c��tjgd�gd�gd�g�}tj|jdd�j}tjgd�gd�gd�gd	�gd�g�}t	||�y)
NrOrPrQrCr)rZr.rZr.rZrRrSrT)r!r"r_�Trr�s   r*�test_check_median_02z"TestStatistic.test_check_median_02Xsa���H�H�i��I�6�7���F�F�1�3�3��8�$�&�&���H�H�
�
�
�
�
�

�
��	�1�a� r,c���tjd�jd�}d|d<d|d<tj|ddd	�
�}tjgd��}t||�y)Nrsrtr|rCr�r9rur�rrZrx)�r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|rzr|r|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�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�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�I�c�N�!�!�#�&����!����"���F�F�1�h��f�=���H�H�
?�
��&	�1�a� r,c���gd�g}tj|ddd��}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g
�}t||�y)N�r.rZr:�rZr�rr0rx)r.r.r.r.r.r.rZr:r:r:r:r:r:r:r:�r!r_r"rr�s   r*�test_check_mean_shape_onez'TestStatistic.test_check_mean_shape_one�sc��
�K���F�F�1�f�f�!�4���H�H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
��"	�1�a� r,c��tjd�jd�}tj|dd�}tjgd��}t||�y)NrsrtrurrKr�r�s   r*�test_check_mean_2zTestStatistic.test_check_mean_2�sL���I�I�c�N�!�!�#�&���F�F�1�h��'���H�H�
I�
��&	�1�a� r,rW)rrrrc���tjgd��tjgd�tj��z}tj|d|�}t	|d|d�y)z3 Test that appended and prepended values are equal )���r0rd)rg�-���q=rr?rfrrdN)r!r"�float64r_r)r%rWr/s   r*�test_same_prepend_appendz&TestStatistic.test_same_prepend_append�sJ��
�H�H�[�!�B�H�H�]�"�*�*�$M�M���F�F�1�f�d�#���Q�q�T�1�R�5�!r,r
�rE)rE)rrd))rZr0)rEr))rB�r0c���tjd�jd�}d}tjt
|��5tj|d||��ddd�y#1swYyxYw)Nrj�r:rZ�#index can't contain negative valuesrFr0rx�r!r;r<rIrJrKr_)r%rWr
�arrrGs     r*�test_check_negative_stat_lengthz-TestStatistic.test_check_negative_stat_length�sV��
�i�i��m�#�#�F�+��5��
�]�]�:�U�
3�	:��F�F�3��4�[�9�	:�	:�	:�s�A%�%A.c��tjd�}tj|d�}tj|ddd��}tjgd�gd�gd�gd�gd	�gd
�gd�gd�gd�gd�gd�g�}t||�y)
Nrjrj�rN�rr0r�rrg)
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�rwr�r�r�r�r�r�)
r�r�r�rvr�r�r�r�r�r��r!r;r<r_r"rr�s   r*�test_simple_stat_lengthz%TestStatistic.test_simple_stat_length�st���I�I�b�M���J�J�q�&�!���F�F�1�&�V��F���H�H�
+�
+�
+�
+�
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	||�y)Nr{r|�rCr0rrx)r!r_r"�nanr)r%rWrmr&s    r*�test_zero_stat_length_validz)TestStatistic.test_zero_stat_length_valid�sK���f�f�b�"�X�v�t��;���8�8�R�V�V�R��R�V�V�R�V�V�<�=���S�(�#r,rrc�`�d}tjt|��5tjddgd|d��ddd�tjt|��5tjddgd|d��ddd�tjt|��5tjddgd|d��ddd�tjt|��5tjddgd|d��ddd�y#1swY��xYw#1swY��xYw#1swY�axYw#1swYyxYw)	Nz,stat_length of 0 yields no value for paddingrFr{r|rrx)rCrrC)rIrJrKr!r_�r%rWrGs   r*�test_zero_stat_length_invalidz+TestStatistic.test_zero_stat_length_invalid�s���>��
�]�]�:�U�
3�	5��F�F�B��8�Q��!�4�	5�
�]�]�:�U�
3�	:��F�F�B��8�Q��&�9�	:�
�]�]�:�U�
3�	5��F�F�B��8�Q��!�4�	5�
�]�]�:�U�
3�	:��F�F�B��8�Q��&�9�	:�	:�
	5�	5��	:�	:��	5�	5��	:�	:�s/�D�D�D�D$�D	�D�D!�$D-N)rQrRrSr�r<r?rArDrGrIrMrUrXr[r`rbrIrlrmrfrnrt�filterwarningsrxr{rTr,r*rqrq�s?��!�0!�0!�0!�0!�0!�0!�0!�0!�!�!�4!�,!�0�[�[���V�&��"�
�"��[�[���V�%M�N��[�[����M��:��O�:�!�*�[�[��� K�L��[�[���M���[�[���V�f�h�%7�8�$�9��M�
$�
�[�[���V�i��%;�<�	:�=�	:r,rqc�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�TestConstantc��tjd�}tj|ddd��}tjgd��}t	||�y)Nrsrur)rrw�r)�rrrrrrrrrrrrrrrrrrrrrrrrrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrwr;r�s   r*�test_check_constantz TestConstant.test_check_constant�sB���I�I�c�N���F�F�1�h�
�H�E���H�H�
5�
��&	�1�a� r,c��tjd�}tj|dd�}tjgd��}t	||�y)NrsrurrCr;r�s   r*�test_check_constant_zerosz&TestConstant.test_check_constant_zeross@���I�I�c�N���F�F�1�h�
�+���H�H�
5�
��&	�1�a� r,c���tjd�jdd�}tj|ddd��}tjgd�gd	�gd
�gd�gd�gd
�gd�gd�g�}t||�y)NrjrZr:rvr皙�����?�rWr)	rCrCrCrCrCrCrCrCrC)	rCrrCr0rr.rZrCrC)	rCr:r�r�rDrr�rCrC)	rCr9r�r�r�r�r�rCrC)	rCr�r�rwr�r�r�rCrC)	rCr�rvr�r�r�r�rCrC�r!r;r<r_r"r�r%rmrar&s    r*�test_check_constant_floatz&TestConstant.test_check_constant_float#sl���i�i��m�#�#�A�q�)���v�v�c�6�
�#&�(���8�8�
1�
1�
1�
1�
1�
1�
1�
1�	
3���	��h�'r,c�0�tjd�jdd�}|jtj�}tj
|ddd��}tjgd�gd	�gd
�gd�gd�gd
�gd�gd�g�}t||�y)NrjrZr:�rvrvrr�r�)	r�r�r�r�r�r�r�r�r�)	r�rzr{r|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�rer_r"r)r%rm�	arr_floatrar&s     r*�test_check_constant_float2z'TestConstant.test_check_constant_float27s����i�i��m�#�#�A�q�)���J�J�r�z�z�*�	��v�v�i�!1�
�#&�(���8�8�
L�
L�
L�
L�
L�
L�
L�
L�	
N���	��h�'r,c��tjdt��}tj|ddd��}tjgd��}t||�y)Nrsr?rur)皙������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�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�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�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)r!r;r	r_r"rr�s   r*�test_check_constant_float3z'TestConstant.test_check_constant_float3LsF���I�I�c��'���F�F�1�h�
�L�I���H�H�
I�
��&	��1�r,c
���tjd�jdd�}tj|ddd��}tjgd�gd	�gd
�gd�gd�gd
�gd�g�}t||�y)NrjrZr:)�rCrhrrr�)
rrrrrrrrrr)
rrrrCr0rr.rZrr)
rrr:r�r�rDrr�rr)
rrr9r�r�r�r�r�rr)
rrr�r�rwr�r�r�rr)
rrr�rvr�r�r�r�rrr�r�s    r*�"test_check_constant_odd_pad_amountz/TestConstant.test_check_constant_odd_pad_amountdsg���i�i��m�#�#�A�q�)���v�v�c�<�j�#$�&���8�8�
5�
5�
5�
5�
5�
5�
5�
7�
��	��h�'r,c���tjd�jdd�}tj|ddd��}tjgd�gd�gd	�gd
�gd
�g�}t||�y)Nr.r0)rv�rCrr)rv�rr.r�)rrCrCr.r.r.)rrrCr.r.r.)rr0rr.r.r.)rr0r0r.r.r.r�r�s    r*�test_check_constant_pad_2dz'TestConstant.test_check_constant_pad_2dusb���i�i��l�"�"�1�a�(���v�v�c�+�*�*:�<���8�8�
�
�
�
�
�	
!�
��	��h�'r,c��d}tjd|tj��}tj|dd|j	���}tjd|tj��}t||�d}tjd|tj��}tj|dd|j	���}tjd|tj��}t||�y)	Nl����rZr?rCrr�r�l����)r!�full�uint64r_�minr�int64)r%�
uint64_maxrmrar&�	int64_maxs      r*�test_check_large_integersz&TestConstant.test_check_large_integers�s��� �
��g�g�a��2�9�9�5���v�v�c�1�:�s�w�w�y�I���7�7�1�j��	�	�:���4��*��	��g�g�a��"�(�(�3���v�v�c�1�:�s�w�w�y�I���7�7�1�i�r�x�x�8���4��*r,c�"�tjdt��}t�}||d<t�}t�}tj|dd||f��}tjdt��}||d<||d<||d<t	||�y)NrCr?rr)�	pad_widthrWrrrr0)r!rr#r_r)r%rm�obj_a�obj_b�obj_cr&s      r*�test_check_object_arrayz$TestConstant.test_check_object_array�s����h�h�q��'�������A���������f�f�S�A�J�&+�U�^�5���8�8�D��/���������������3��)r,c��tjd�}tj|gd�d��}|jdk(sJ�y)N�rrr0��rrhr�rr\�rr.r.�r!�zerosr_r^�r%rmr(s   r*�test_pad_empty_dimensionz%TestConstant.test_pad_empty_dimension�s5���h�h�y�!������/�j�A���|�|�y�(�(�(r,N)
rQrRrSr�r�r�r�r�r�r�r�r�r�rTr,r*r~r~�s4��!�0!�0(�((�*�0(�"(�+�*� )r,r~c��eZdZd�Zd�Zejjef��d��Z	d�Z
ejjde�d��Z
y)	�TestLinearRampc���tjd�jd�}tj|ddd��}tjgd��}t||dd�	�y)
Nrsrtrur)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�?rzr{r|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�r�r�r�r�r�r�r�r�r�r�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#@rg�h㈵��>)�rtol�atol)r!r;r�r_r"rr�s   r*�test_check_simplez TestLinearRamp.test_check_simple�sR���I�I�c�N�!�!�#�&���F�F�1�h�
�&�A���H�H�
F�
��&	��1�4�d�3r,c�,�tjd�jdd�jtj�}tj
|ddd��}tjgd�gd	�gd
�gd�gd�gd
�gd�gd�g�}t||�y)Nrwr.rZ)r0r0rr[�rWr)	rzrzrzrzrzrzrzrzrz)	rzrzrzryr{g�?r|r{rz)	rzrzrzr{r|r}r~r|rz)	rzg@rr�r�r�r�g@rz)	rzrr�r�r�r�r�r�rz)	rz�@r�r�r�r�r��#@rz)	rzg@r�r�g!@r�r�g@rzr�r�s    r*�
test_check_2dzTestLinearRamp.test_check_2d�sx���i�i��m�#�#�A�q�)�0�0����<���v�v�c�6�
�&�I���8�8�
B�
B�
B�
B�
B�
B�
B�
B�
D�E��	��h�'r,)�
exceptionsc�>�ddlm}tj|dd�|dd�g�}tj|ddd��}tj|dd	�|d
d	�|dd	�|dd	�|d
d	�|dd	�|dd	�g�}t||�y)Nr)�FractionrCr0rdrNrr�r9rr:���rBrE)�	fractionsr�r!r"r_r)r%r�rm�actualr&s     r*�test_object_arrayz TestLinearRamp.test_object_array�s���&��h�h���A����Q��8�9������V�-�A�F���8�8��a����a����a����R����R����R����R���
���	�V�X�&r,c��tjtjd�jdd�dd��}t	|dd�dfd	�t	|dd�d
fd	�t	|ddd�fd	�t	|d
dd�fd	�y)z!Ensure that end values are exact.rr0rZ)���{rr\Nrrzrd)r!r_rOr<r)r%r/s  r*�test_end_valueszTestLinearRamp.test_end_values�sq���F�F�2�7�7�2�;�&�&�q�!�,�j�}�M���Q�q�!�t�W�b�!��Q�q�"�u�X�r�"��Q�q�!�t�W�b�!��Q�r�1�u�X�r�"r,r@c�\�tjdg|��}tj|ddd��}tjgd�|��}t||�tjdg|��}tj|ddd��}tjgd�|��}t||�y)	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"r_r)r%r@r'r(r&s     r*�test_negative_differencez'TestLinearRamp.test_negative_difference�s���
�H�H�a�S��&������1�=�Q�?���8�8�1��?���V�X�&��H�H�a�S��&������1�=�Q�?���8�8�1��?���V�X�&r,N)rQrRrSr�r�rIrl�xfail�AssertionErrorr�r�rm�_numeric_dtypesr�rTr,r*r�r��s_��4�0(��[�[���>�"3��4�'�5�'�$#��[�[���W�o�6�'�7�'r,r�c�N�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
y)
�TestReflectc��tjd�}tj|dd�}tjgd��}t	||�y)Nrsrur)�rvr�r�r�r�rwr�r�r�r�r�r�r�r9r�rrDr�r�r:rZr.rr0rCrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�r:r9r8r7r6r5r4r3r2r1r0r/r.r-r,r+r*r)r(r'r;r�s   r*r�zTestReflect.test_check_simple�r=r,c��tjd�}tj|ddd��}tjgd��}t	||�y)Nrsrur�odd�r)�i���������������������������������������������������r����rBrArErdrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rsrF�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�wr;r�s   r*�test_check_odd_methodz!TestReflect.test_check_odd_methodsB���I�I�c�N���F�F�1�h�	��>���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||�y)Nr]�r:r�r�r^r)r�r:r�r�r�r:r�r�r�r:r�r�r�r:r��rZr.rZr:rZr.rZr:rZr.rZr:rZr.rZr_r�s   r*�test_check_large_padz TestReflect.test_check_large_pad+sg��
�	�"���F�F�1�f�i�(���H�H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
��$	�1�a� r,c���gd�g}tj|dd�}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�gd�g
�}t||�y)Nr]r^rr�r_r�s   r*�test_check_shapezTestReflect.test_check_shapeBsa��
�K���F�F�1�f�i�(���H�H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
��"	�1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)N�rCr0rr0r)rr0rCr0rr0rCr_r�s   r*�
test_check_01zTestReflect.test_check_01Xs-���F�F�9�a��+���H�H�*�+���1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)Nr�rr)	r0rr0rCr0rr0rCr0r_r�s   r*�
test_check_02zTestReflect.test_check_02]s-���F�F�9�a��+���H�H�0�1���1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)Nr�r.r)rCr0rr0rCr0rr0rCr0rr_r�s   r*�
test_check_03zTestReflect.test_check_03bs-���F�F�9�a��+���H�H�6�7���1�a� r,c��tjgd�ddgd�}tjgd��}t||�y)Nr�rCrr)r0rCr0rr0rCr0rr0rCr0rr0rCr_r�s   r*�
test_check_04zTestReflect.test_check_04gs1���F�F�9�q�"�g�y�1���H�H�?�@���1�a� r,c��tjgd�ddgd�}tjgd��}t||�y)N�rCr0rr.rrr);r.rr0rCr0rr.rr0rCr0rr.rr0rCr0rr.rr0rCr0rr.rr0rCr0rr.rr0rCr0rr.rr0rCr0rr.rr0rCr0rr.rr0rCr0rr.rr0rCr0r_r�s   r*�
test_check_05zTestReflect.test_check_05ls7���F�F�<�"�b��9�5���H�H�
(�
)��	�1�a� r,c��tjgd�ddgd�}tjgd��}t||�y)Nrr�r0r)r0rr.r.rr0rCrCr0rr.r.rr0rCrCr0rr.r.rr_r�s   r*�
test_check_06zTestReflect.test_check_06ws7���F�F�<�"�a��+�6���H�H�
�
��
	�1�a� r,c��tjgd�ddgd�}tjgd��}t||�y)N)rCr0rr.rZr:rrr)6r.rZr:r:rZr.rr0rCrCr0rr.rZr:r:rZr.rr0rCrCr0rr.rZr:r:rZr.rr0rCrCr0rr.rZr:r:rZr.rr0rCrCr0rr.rZr:r:rZr.r_r�s   r*�
test_check_07zTestReflect.test_check_07�s8���F�F�%��A�w��<���H�H�
�
��	�1�a� r,N)rQrRrSr�r�r�r�rrrrr	rr
rTr,r*r�r��s9��!�0!�0!�.!�,!�
!�
!�
!�
	!�!�	!r,r�c���eZdZdZej
j
deej�ddhz
��d��Z
ej
j
dej��d��Zy)�TestEmptyArrayz<Check how padding behaves on arrays with an empty dimension.rWrrc��d}tjt|��5tjgd|��ddd�tjt|��5tjtj
d�d|��ddd�tjt|��5tjtjd�d|��ddd�y#1swY��xYw#1swY�exYw#1swYyxYw)NzFcan't extend empty axis 0 using modes other than 'constant' or 'empty'rFr.r\r)rr)r�r�)rIrJrKr!r_�ndarrayr�rzs   r*r�z'TestEmptyArray.test_pad_empty_dimension�s�����
�]�]�:�U�
3�	%��F�F�2�q�t�$�	%�
�]�]�:�U�
3�	0��F�F�2�:�:�a�=�!�$�/�	0�
�]�]�:�U�
3�	>��F�F�2�8�8�F�#�\��=�	>�	>�		%�	%��	0�	0��	>�	>�s#�C�,C*�),C6�C'�*C3�6C?c�|�tjtjd�d|��}|jdk(sJ�y)N)r0rr0)rrr�r�r\)r�rr.)r!r_rOr^)r%rWr(s   r*�test_pad_non_empty_dimensionz+TestEmptyArray.test_pad_non_empty_dimension�s0��������	�*�,>�T�J���|�|�y�(�(�(r,N)rQrRrS�__doc__rIrlrm�sortedrnror�rrTr,r*rr�so��F��[�[���	��z���(�J��+@�@�A��
>��
>��[�[���V�Z�_�_�%6�7�)�8�)r,rc�<�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�
TestSymmetricc��tjd�}tj|dd�}tjgd��}t	||�y)Nrsrur)�r�r�r�r�rwr�r�r�r�r�r�r�r9r�rrDr�r�r:rZr.rr0rCrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�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:r9r8r7r6r5r4r3r2r1r0r/r.r-r,r+r*r)r(r;r�s   r*r�zTestSymmetric.test_check_simple�s@���I�I�c�N���F�F�1�h��,���H�H�
5�
��&	�1�a� r,c��tjd�}tj|ddd��}tjgd��}t	||�y)Nrsrurr�r�)�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rBrArErdrrrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�r�rsrFr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r;r�s   r*r�z#TestSymmetric.test_check_odd_method�sB���I�I�c�N���F�F�1�h��%�@���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||�y)Nr]r�r^r�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�r_r�s   r*r�z"TestSymmetric.test_check_large_pad�sg��
�	�"���F�F�1�f�k�*���H�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||�y)Nr]r�r^rr�r�)rArErErdrrrCr0r0rr.r.rZr:r:)rdrrrCr0r0rr.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�r_r�s   r*�test_check_large_pad_oddz&TestSymmetric.test_check_large_pad_odd�sj��
�	�"���F�F�1�f�k��>���H�H�
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||�y)Nr]r^rrr_r�s   r*r�zTestSymmetric.test_check_shapesa��
�K���F�F�1�f�k�*���H�H�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
:�
<�
��"	�1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)Nr�r0r)r0rCrCr0rrr0r_r�s   r*rzTestSymmetric.test_check_01s-���F�F�9�a��-���H�H�*�+���1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)Nr�rr)	rr0rCrCr0rrr0rCr_r�s   r*rzTestSymmetric.test_check_02s-���F�F�9�a��-���H�H�0�1���1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)Nr�r:r)rCr0rrr0rCrCr0rrr0rCrCr0rr_r�s   r*rzTestSymmetric.test_check_03$s-���F�F�9�a��-���H�H�B�C���1�a� r,N)rQrRrSr�r�r�rr�rrrrTr,r*rr�s*��!�0!�0!�0!�.!�,!�
!�
!r,rc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�TestWrapc��tjd�}tj|dd�}tjgd��}t	||�y)Nrsrur)�r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�rwr�r�r�r�rvr�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r�rrCr0rr.rZr:r�r�rDrr�r9r�r�r�r�r�r�r�r;r�s   r*r�zTestWrap.test_check_simple+s@���I�I�c�N���F�F�1�h��'���H�H�
5�
��&	�1�a� r,c�`�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||�y)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�rsr�s   r*r�zTestWrap.test_check_large_padCs����I�I�b�M���J�J�q�&�!���F�F�1�h��'���H�H�.�)�)�.�)�)�.�)�)�.�)�)�.�)�)�.�)�)�.�)�)�.�)�)�.�e3
/�5
��l	�1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)Nr�rr)	rCr0rrCr0rrCr0rr_r�s   r*rzTestWrap.test_check_01s-���F�F�9�a��(���H�H�0�1���1�a� r,c�|�tjgd�dd�}tjgd��}t||�y)Nr�r.r)rrCr0rrCr0rrCr0rrCr_r�s   r*rzTestWrap.test_check_02�s-���F�F�9�a��(���H�H�6�7���1�a� r,c��tjd�}tj|dd��}t||dd�dd�f�y)NrZ)rrZrr\r�)r!rOr_rr�s   r*�test_pad_with_zerozTestWrap.test_pad_with_zero�s;���G�G�F�O���F�F�1�f�6�*���1�a����S�b�S��k�*r,c�H�tjd�}tj|dd��}ttj||||fdd|�tjd�}tj|dd��}ttj||||fdd|�y)	zy
        Check wrapping on each side individually if the wrapped area is longer
        than the original array.
        rZ)r9rrr\rN)rr9rA)r!r;r_r�r_r�s   r*�test_repeated_wrappingzTestWrap.test_repeated_wrapping�s���

�I�I�a�L���F�F�1�g�F�+���2�5�5��A�q�!��,�Q�R�0�!�4��I�I�a�L���F�F�1�g�F�+���2�5�5��A�q�!��,�S�b�1�1�5r,c	���tjd�jdd�}tj|ddgd��}tjgd�gd�gd�gd�gd�gd�g�}t||�y	)
z�
        Assert that 'wrap' pads only with multiples of the original area if
        the pad width is larger than the original array.
        r.r0r��rrCrr\)rr0rr0rr0)rCrrCrrCrNrsr�s   r*�&test_repeated_wrapping_multiple_originz/TestWrap.test_repeated_wrapping_multiple_origin�sf��

�I�I�a�L� � ��A�&���F�F�1�v�v�&�V�4���H�H�
�
�
�
�
�
�
!�
��	�1�a� r,N)
rQrRrSr�r�rrr)r,r/rTr,r*r#r#*s&��!�0:!�x!�
!�
+�
6�!r,r#c��eZdZd�Zd�Zy)�TestEdgec��tjd�}tj|d�}tj|dd�}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�g	�}t||�y�	Nr9�r.rrpr)rrrrrCr0r0r0)rrrrr.rZrZrZ)r:r:r:r:r�r�r�r�)rDrDrDrDrr�r�r�rsr�s   r*r�zTestEdge.test_check_simple�sl���I�I�b�M���J�J�q�&�!���F�F�1�&��/���H�H�
%�
%�
%�
%�
%�
)�
)�
)�
)�

+�
��	�1�a� r,c��tjgd��}tj|dd�}tjgd��}t||�tjgd�gd�g�}tj|dd�}tj|dd�}t||�tjd�jdd	d
�}tj|dd�}tj|dd�}t||�y)Nr�)rvr)rCrCr0rrrr]r�r�r0rr.)rvrvrv)r!r"r_rr;r<)r%r/�paddedr&s    r*�test_check_width_shape_1_2z#TestEdge.test_check_width_shape_1_2�s���
�H�H�Y�������9�f�-���8�8�.�/���6�8�,��H�H�i��+�,������9�f�-���6�6�!�-�v�6���6�8�,��I�I�b�M�!�!�!�Q��*������9�f�-���6�6�!�5�v�>���6�8�,r,N)rQrRrSr�r7rTr,r*r1r1�s��!�&-r,r1c��eZdZd�Zd�Zy)�	TestEmptyc���tjd�jdd�}tj|ddgd��}|jdk(sJ�t||d	d
�dd�f�y)
Nr�r.r:rNr.rr\)rDrr0rArrd�r!r;r<r_r^rr�s   r*�test_simplezTestEmpty.test_simple�s`���i�i��m�#�#�A�q�)������f�f�-�G�<���|�|�w�&�&�&��S�&��2��q��t��,�-r,c��tjd�}tj|gd�d��}|jdk(sJ�y)Nr�r�rr\r�r�r�s   r*r�z"TestEmpty.test_pad_empty_dimension�s5���h�h�y�!������/�g�>���|�|�y�(�(�(r,N)rQrRrSr<r�rTr,r*r9r9�s��.�)r,r9c	���d�}tjd�jdd�}tj|d|�}tjgd�gd�gd�gd�gd�gd�g�}t||�y)Nc�&�d|d|dd||ddy)NrrrCrT)�vectorr��iaxis�kwargss    r*�_padwithtensz6test_legacy_vector_functionality.<locals>._padwithtens�s$�� "��}�	�!���!#��	�!��}�~�r,r:r0r)rrrrrrr)rrrrCr0rr)rrrr.rZrrrs)rCr/r�s   r*� test_legacy_vector_functionalityrD�sf��$�	�	�	�!����Q��"�A�
���q�!�\�"�A�
���	%�	%�	%�	%�	%�	%�	'�		
�A��q�!�r,c�|�tjdgdd��}tjgd��}t||�y)NrCr0rr\)rrrCrrr_)r/r�s  r*�test_unicode_moderF�s.��
����s�A�J�'�A�
����!�A��q�!�r,rW)rrrrc��tjdd��}d}tjdd��}ttj|||��|�y)Nr4)�
fill_valuerp)rDr�r\)r!r�rr_)rWr/rcr�s    r*�test_object_inputrI�s@��	����4�(�A��G�
����4�(�A��r�v�v�a��t�4�a�8r,c
�*�eZdZejjdgd��ejjdej��d���Zejjdej��d��Z	ejjdgd��ejjdej��d���Z
ejjdd	d
de�dfd
defedd�dfdg�ejjdej��d���Z
d�Zejjdgd��ejjdej��d���Zy)�TestPadWidthr�))r.rZr:r�)r�rhrr)rvr�)rZr:))rr.rZ)rrCr0rWc���tjd�jd�}d}tjt
|��5tj|||�ddd�y#1swYyxYw)Nrjrjz(operands could not be broadcast togetherrFrl�r%r�rWrmrGs     r*�test_misshaped_pad_widthz%TestPadWidth.test_misshaped_pad_widthsT���i�i��m�#�#�F�+��:��
�]�]�:�U�
3�	)��F�F�3�	�4�(�	)�	)�	)���A#�#A,c���tjd�jd�}d}tjt
|��5tj|d|�ddd�y#1swYyxYw)NrjrjzDinput operand has more dimensions than allowed by the axis remappingrF))rr)r.)rZ)r�r�rhrl)r%rWrmrGs    r*�test_misshaped_pad_width_2z'TestPadWidth.test_misshaped_pad_width_2sY���i�i��m�#�#�F�+����
�]�]�:�U�
3�	H��F�F�3�@�$�G�	H�	H�	H�rOrgc���tjd�jd�}d}tjt
|��5tj|||�ddd�y#1swYyxYw)NrjrjrkrFrlrMs     r*�test_negative_pad_widthz$TestPadWidth.test_negative_pad_widthsT���i�i��m�#�#�F�+��5��
�]�]�:�U�
3�	)��F�F�3�	�4�(�	)�	)�	)�rOzpad_width, dtype)�3N)�wordNr3N)g333333@N))r0rr.rqrCrd)))g�������rrqNc�P�tjd�jd�}d}|�Qtjt
|��5tj|tj||��|�ddd�ytjt
|��5tj|||�ddd�tjt
|��5tj|tj|�|�ddd�y#1swYyxYw#1swY�dxYw#1swYyxYw)Nrjrjz%`pad_width` must be of integral type.rFr?)r!r;r<rIrJ�	TypeErrorr_r")r%r�r@rWrmrGs      r*�
test_bad_typezTestPadWidth.test_bad_type#s����i�i��m�#�#�F�+��7�������y��6�
D����s�B�H�H�Y�e�<�d�C�
D�
D����y��6�
-����s�I�t�,�
-����y��6�
7����s�B�H�H�Y�/��6�
7�
7�
D�
D��
-�
-��
7�
7�s$�-D�D�+D�D
�D�D%c�&�tjd�}tj|d�}tj|tjd�d�}tjgd�gd�gd�gd�gd�gd�gd�gd�gd�g	�}t||�yr3rsr�s   r*�test_pad_width_as_ndarrayz&TestPadWidth.test_pad_width_as_ndarray;su���I�I�b�M���J�J�q�&�!���F�F�1�b�h�h�/�0�&�9���H�H�
0�
0�
0�
0�
0�
0�
0�
0�
0�

2�
��	�1�a� r,)rr[)r[r[c��tjd�jdd�}t|tj|||���y)Nrjr:rZr\)r!r;r<rr_)r%r�rWrms    r*�test_zero_pad_widthz TestPadWidth.test_zero_pad_widthNs5���i�i��m�#�#�A�q�)���3����s�I�D� A�Br,)rQrRrSrIrlrmrnrorNrQrSr#r
rXrZr\rTr,r*rKrKs����[�[���[�+���[�[���V�Z�_�_�%6�7�)�8�
�)��[�[���V�Z�_�_�%6�7�H�8�H��[�[����K�M��[�[���V�Z�_�_�%6�7�)�8�M�)��[�[���/����	��4���	�f�%�	��B����#�	2�	��[�[���V�Z�_�_�%6�7�7�8�	�7�!�&�[�[���[�*G�H��[�[���V�Z�_�_�%6�7�C�8�I�Cr,rKc��t|}i}tj�D]}||k7s�	|j|��tjgd�d|fi|��|j�D]V\}}dj
|�}tjt|��5tjgd�d|fi||i��ddd��Xy#1swY�cxYw)z1Test behavior of pad's kwargs for the given mode.r�rCz+unsupported keyword arguments for mode '{}'rFN)
rn�values�updater!r_�items�formatrIrJrK)rW�allowed�not_allowedrB�key�valuerGs       r*�test_kwargsrfUs������G��K��#�#�%�'���W�����v�&�'��F�F�9�a��)��)�!�'�'�)�7�
��U�=�D�D�T�J��
�]�]�:�U�
3�	7��F�F�9�a��6�#�u��6�	7�	7�7�	7�	7�s�C�C		c�v�tjddg�}ttj|d�gd��y)NrCr0)rrrCrCrr)r!r"rr_)rms r*�test_constant_zero_defaultrhfs)��
�(�(�A�q�6�
�C��r�v�v�c�1�~�'9�:r,rC�constTFc��dj|�}tjt|��5t	j
gd�d|��ddd�y#1swYyxYw)Nzmode '{}' is not supportedrFr�r.r\)rarIrJrKr!r_)rWrGs  r*�test_unsupported_moderkksE��'�.�.�t�4�E�	���z��	/�(�
���y�!�$�'�(�(�(�s�A�Ac���tjd�jdd�ddd�ddd�f}tj|d|�}|jdk(sJ�t|dd�dd�f|�y)Nr�r.r:r0rN)r�r�rAr;)rWrmr(s   r*�test_non_contiguous_arrayrmrsl��
�)�)�B�-�
�
��1�
%�c��c�3�Q�3�h�
/�C�
�V�V�C���
&�F��<�<�6�!�!�!����"��a��d�
�#�S�)r,c��tjdd��}tj|d|�jdsJ�tjdd��}tj|d|�jdsJ�y)	z5Test if C and F order is preserved for all pad modes.)rZr�C)�orderrZ�C_CONTIGUOUS�F�F_CONTIGUOUSN)r!rOr_�flags)rWr's  r*�test_memory_layout_persistenceruzsf��	����s�#�A�
�6�6�!�Q���#�#�N�3�3�3�
����s�#�A�
�6�6�!�Q���#�#�N�3�3�3r,r@c��tjd|��}tj|d|��}|j|k(sJ�y)N)rr0rCr?rCr\)r!r�r_r@)r@rWrmr(s    r*�test_dtype_persistencerw�s8��
�(�(�9�E�
*�C�
�V�V�C���
&�F��<�<�5� � � r,)'rrI�numpyr!�
numpy.testingrrr�numpy.lib._arraypad_implr�_core�sctypesr�rnrrVrqr~r�r�rrr#r1r9rDrFrlrmrIrKrorfrhr#rkrmrurwrTr,r*�<module>r}s������K�K�.��H�H���V���h�h���u����h�h���w�� �	�h�h���y�!�"��#�A�&�� �!�$��t�$�
�D�!��d�#��t�$���'� �&�)��
��
�P*�P*�fM�M�,f:�f:�Rp)�p)�fR'�R'�jO!�O!�d)�)�0C!�C!�L@!�@!�F$-�$-�N
)�
)��(�������!I�J�9�K�9�NC�NC�b���������!2�3�
7�4�
7� ;�
������!�W�f�h��d�E�!J�K�(�L�(����������!2�3�*�4�*����������!2�3�4�4�4�������/�2����������!2�3�!�4�3�!r,

Youez - 2016 - github.com/yon3zu
LinuXploit