403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.170
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_backend_pdf.cpython-312.pyc
�

G8�cx5����ddlZddlZddlZddlZddlmZddlmZddlZ	ddl
Z
ddlZddlm
ZmZmZddlmZddlmZddlmZmZddlmZdd	lmZdd
lmZddlm Z m!Z!ddl"m#Z#e!d
g�d��Z$e
jJjMdddg�e
jJjMdddg�d���Z'd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-d�Z.d�Z/d�Z0e#d��Z1d �Z2e!d!g�d"��Z3e!d#g�d$��Z4ejjjmd%�e d&d'g�(�d)���Z7e#d*��Z8d+�Z9e!d,g�d-��Z:d.�Z;e!d/gd0�1�d2��Z<e!d3gd4�1�d5��Z=y)6�N)�Path)�NamedTemporaryFile)�pyplot�rcParams�font_manager)�_get_data_path)�FT2Font)�findfont�FontProperties)�get_glyphs_subset)�PdfPages)�	Rectangle)�check_figures_equal�image_comparison)�needs_usetexzpdf_use14corefonts.pdfc��dtd<dtd<dtd<dgtd<d	td
<d}tj�\}}|jd�|j	d
d
|ddd��|jd
d
��y)NTzpdf.use14corefontsz
sans-serifzfont.family�z	font.size�	Helveticazfont.sans-serifrzpdf.compressionu�A three-line text positioned just above a blue line
and containing some French characters and the euro symbol:
"Merci pépé pour les 10 €"z0Test PDF backend with option use14corefonts=Trueg�?�center�bottom�)�horizontalalignment�verticalalignment�fontsize)�	linewidth)r�plt�subplots�	set_title�text�axhline)r�fig�axs   �C/usr/lib/python3/dist-packages/matplotlib/tests/test_backend_pdf.py�test_use14corefontsr$s���%)�H�
!�"�*�H�]���H�[��#.�-�H�
��"#�H�
��"�D��l�l�n�G�C���L�L�C�D��G�G�C��d��&�����J�J�s�c�J�"�zfontname, fontfile)�DejaVu SanszDejaVuSans.ttf)�WenQuanYi Zen Hei�wqy-zenhei.ttc�fonttype��*c�d�ttt|g����j|k7rt	j
d|�d��|td<tj�\}}|jgd��|jd|��|jtj�d�	�y)
N��familyzFont z may be missingzpdf.fonttype���r*z
Axes Title)�font�pdf��format)rr
r�name�pytest�skiprrr�plotr�savefig�io�BytesIO)�fontname�fontfiler)r!r"s     r#�test_embed_fontsr?-s����H�^�H�:�6�7�8�=�=��I����e�H�<��7�8�'�H�^���l�l�n�G�C���G�G�I���L�L��H�L�-��K�K��
�
��U�K�+r%c��ttj��5}|j�dk(sJ�t	j
�\}}|j
gd��|j|d��|j�dk(sJ�|j�|j�dk(sJ�	ddd�y#1swYyxYw)Nrr/r3r4r0r1)r
r;r<�
get_pagecountrrr9r:)r3r!r"s   r#�test_multipage_pagecountrB=s���	�"�*�*�,�	�(�3�� � �"�a�'�'�'��,�,�.���R�
���	�����C���&�� � �"�a�'�'�'����
�� � �"�a�'�'�'�(�(�(�s�B
B5�5B>c�p�tj�}t|�5}td�D]=}t	j
�\}}|j
d�|j|d���?	ddd�|j�}|jd�dk(sJ�t|�dksJ�y#1swY�@xYw)N�
zThis is a long titler3r4s	startxrefr0i@�)r;r<r
�rangerrrr:�getvalue�count�len)�pdfior3�ir!r"�ss      r#�test_multipage_properfinalizerLHs����J�J�L�E�	�%��+�C��r��	+�A��l�l�n�G�C���L�L�/�0��K�K��E�K�*�	+�+�
	����A��7�7�<� �A�%�%�%��q�6�E�>��>�+�+�s�AB,�,B5c��td��5}t|�5}|jjj}ddd�t
jj�sJ�	ddd�tj�t|d��5}	ddd�t
jj|�rJ�tj�\}}|jgd��td��5}t|�5}|jjj}|j�ddd�t
jj|�sJ�	ddd�tj|�td��5}t|d��5}|jjj}|j�ddd�t
jj|�sJ�	ddd�tj|�y#1swY���xYw#1swY���xYw#1swY���xYw#1swY��xYw#1swY��xYw#1swY��xYw#1swY�kxYw)NF)�delete)�
keep_emptyr/)
rr
�_file�fhr6�os�path�exists�removerrr9r:)�tmpr3�filenamer!r"s     r#�test_multipage_keep_emptyrXTs���
�5�	)�(�S�
�c�]�	)�c��y�y�|�|�(�(�H�	)��w�w�~�~�h�'�'�'�(��I�I�h��	�(�u�	-�
���
��w�w�~�~�h�'�'�'��l�l�n�G�C���G�G�I��	�5�	)�(�S�
�c�]�	�c��y�y�|�|�(�(�H��K�K�M�	��w�w�~�~�h�'�'�'�	(�
�I�I�h��	�5�	)�(�S�
�c�e�
,�	���y�y�|�|�(�(�H��K�K�M�	��w�w�~�~�h�'�'�'�	(�
�I�I�h��1	)�	)��(�(��
�
��	�	��(�(��	�	��(�(�su�H�!H�)H�H �/H:�;1H-�,)H:�?I�
1I�>)I�H	�H�H� H*�-H7	�2H:�:I�I	�I�Ic�`�tjtjddd�tjddd��\}}tj|dz�}t	j
�\}}|j
dd�|j|gd���|j|ddd	�gd
���dtjd<ttj��5}|j|d
��t|jj�dk(sJ�	ddd�dtjd<ttj��5}|j|d
��t|jj�dk(sJ�	ddd�y#1swY�{xYw#1swYyxYw)N����r0r1rr*)rr0rr0)�extent���)r1r*rr0Tzimage.composite_imager3r4F)�np�meshgrid�arange�sinrr�set_xlim�imshowrr
r;r<r:rHrP�_images)�X�Y�Zr!r"r3s      r#�test_composite_imagerhssQ���;�;�r�y�y��Q��*�B�I�I�b�!�Q�,?�@�D�A�q�
���q�A�v��A��l�l�n�G�C���K�K��1���I�I�a��I�%��I�I�a��"��g�l�I�+�,0�C�L�L�(�)�	�"�*�*�,�	�+�3����C���&��3�9�9�$�$�%��*�*�*�+�-2�C�L�L�(�)�	�"�*�*�,�	�+�3����C���&��3�9�9�$�$�%��*�*�*�+�+�	+�+��+�+�s�%8F�8F$�F!�$F-c���tjd�}|jdd�tj�\}}|jt
d��ddddtjd	d
dtjtjd���
�dd�}tj�}|j||d��|jj|�5}|jj!�D��cic]\}}|t#|���}	}}ddd�	dddt$j&�d�dddt$j&��dddd�	k(sJ�ycc}}w#1swY�DxYw)N�pikepdf�SOURCE_DATE_EPOCH�0r[�me�
Multipage PDF�	Test page�test,pdf,multipage�rr0r��tzinfo�True��Author�Title�Subject�Keywords�ModDate�Trappedr3)�metadatar5�D:19700101000000Z�Matplotlib v�, https://matplotlib.org�D:19680801000000Z�Matplotlib pdf backend v�/True�	z/Authorz
/CreationDatez/Creatorz	/Keywordsz/ModDatez	/Producerz/Subjectz/Titlez/Trapped)r7�importorskip�setenvrrr9rE�datetime�timezone�	timedeltar;r<r:�Pdf�open�docinfo�items�str�mpl�__version__�
�monkeypatchrjr!r"�md�bufr3�k�v�infos
          r#�test_savefig_metadatar��sP���!�!�)�,�G����*�C�0��l�l�n�G�C���G�G�E�!�H��� ��(��$�$��!�Q�x�0�0��1C�1C�A�1F�G�I��
�B�
�*�*�,�C��K�K��b��K�/�	���	�	�#�	�;�#�&)�k�k�&7�&7�&9�:�d�a���3�q�6�	�:��:�;���,�"�3�?�?�"3�3K�L�)�'�/����/@�A��!��
�
�
�
��;�;�;�s�"E�E�E�E�E%c���tj�\}}tjtd��5|jt
j�dddi��ddd�tjtd��5|jt
j�ddd	i��ddd�tjtd
��5|jt
j�dddi��ddd�tjtd
��5|jt
j�dddi��ddd�y#1swY��xYw#1swY��xYw#1swY�nxYw#1swYyxYw)Nz#Unknown infodict keyword: 'foobar'.)�matchr3�foobar�invalid)r5r|z%not an instance of datetime.datetime.rzz
1968-08-01z'not one of {"True", "False", "Unknown"}r{�fooznot an instance of str.rwi�)rrr7�warns�UserWarningr:r;r<�r!r"s  r#�test_invalid_metadatar��s;���l�l�n�G�C��	���k�A�
C�P����B�J�J�L��(�I�9N��O�P�
���k�C�
E�8����B�J�J�L��'��6�	�	8�8�

���k�E�
G�M����B�J�J�L��)�U�9K��L�M�
���k�)B�	C�J����B�J�J�L��'�4���I�J�J�P�P��8�8��
M�M��J�J�s/�)E	�?)E�)E!�)E-�	E�E�!E*�-E6c�0�tjd�}|jdd�tj�\}}|jt
d��ddddtjd	d
dtjtjd���
�dd�}tj�}t||��5}|j|�|j|�ddd�|jj|�5}|j j#�D��cic]\}}|t%|���}	}}ddd�	dddt&j(�d�dddt&j(��dddd�	k(sJ�y#1swY��xYwcc}}w#1swY�PxYw)Nrjrkrlr[rmrnrorprqrr0rrrrtru)r|r}r~rr�r�r�r�)r7r�r�rrr9rEr�r�r�r;r<r
r:r�r�r�r�r�r�r�r�s
          r#�test_multipage_metadatar��sx���!�!�)�,�G����*�C�0��l�l�n�G�C���G�G�E�!�H��� ��(��$�$��!�Q�x�0�0��1C�1C�A�1F�G�I��
�B�
�*�*�,�C�	�#��	#��s����C�����C���
���	�	�#�	�;�#�&)�k�k�&7�&7�&9�:�d�a���3�q�6�	�:��:�;���,�"�3�?�?�"3�3K�L�)�'�/����/@�A��!��
�
�
�
����
;�;�;�s*�#E:�F�$F�:F�:F�F�Fc����tjd�}d�tjd��}|j	ddd��d���|j	dd	d
��d���tj�5}|j|d�
�|jj|�5}|jdj}dD]X\}�t��fd�|D�d�}|�J�t|dd��J�|jdtj |�dzk(r�XJ�	ddd�ddd�y#1swY�xYw#1swYyxYw)Nrj�&https://test_text_urls.matplotlib.org/�r1r0��figsize皙�����?ztest plain 123�plain)�urlg�������?ztest mathtext $123$�mathtextr3r4r))z0.1r�)z0.4r�c3�^�K�|]$}|jj�����k(s�!|���&y�w�N��A�URI)�.0�a�fragment�test_urls  ��r#�	<genexpr>z!test_text_urls.<locals>.<genexpr>�s)�����M�1�!�#�#�'�'��z�(��5L�*L�Q�M�s�"-�-�
QuadPointsr0�H)r7r�r�figurerr;r<r:r�r��pages�Annots�next�getattr�Rect�decimal�Decimal)	rjr!�fdr3�annots�y�annotr�r�s	       @@r#�test_text_urlsr��sL����!�!�)�,�G�7�H�

�*�*�V�
$�C��H�H�S�#�'��z��-?�H�@��H�H�S�#�,�X�J�h�2G�H�H�	����@�����B�u��%�
�[�[�
�
�b�
!�	@�S��Y�Y�q�\�(�(�F� G�
@���8��M��M�����(�(�(��u�l�D�9�A�A�A��z�z�!�}�����(:�R�(?�?�?�?�
@�	@�@�@�	@�	@��@�@�s+�4/D8�#A3D,�D,�D8�,D5	�1D8�8Ec�X��tjd�}d�tjd��}|j	dddd����tj�5}|j|d	�
�|jj|�5}|jdj}t�fd�|D�d�}|�J�t|d
d��J�|jd|jdt!j"d�z
k(sJ�	ddd�ddd�y#1swY�xYw#1swYyxYw)Nrjr�)r0r0r�r��N�-)�rotationr�r3r4rc3�X�K�|]!}|jj��k(s�|���#y�wr�r��r�r�r�s  �r#r�z)test_text_rotated_urls.<locals>.<genexpr>s"�����?�q�a�c�c�g�g�H�:�&>��?�s�*�*r��z0.00001)r7r�rr�rr;r<r:r�r�r�r�r�r�r�r�r�r��rjr!r�r3r�r�r�s      @r#�test_text_rotated_urlsr��s+����!�!�)�,�G�7�H�

�*�*�V�
$�C��H�H�S�#�s�R��z�H�;�	����@�����B�u��%�
�[�[�
�
�b�
!�	@�S��Y�Y�q�\�(�(�F��?�F�?���E��$�$�$��5�,��5�A�A�A��:�:�a�=�����"�W�_�_�Y�%?�?�@�
@�@�	@�@�@�	@�	@��@�@�s%�/D �	A9D�D �D	�D � D)c�$��tjd�}d�tjd��}|j	dddd��d	��
�tj�5}|j|d��|jj|�5}|jd
j}t�fd�|D�d�}|�J�|jdtjd�dzk(sJ�	ddd�ddd�y#1swY�xYw#1swYyxYw)Nrjr�r�r�r�gffffff�?ztest tex $123$T�tex)�usetexr�r3r4rc3�\�K�|]#}|jj��d�k(s� |���%y�w)r�Nr�r�s  �r#r�z%test_text_urls_tex.<locals>.<genexpr>)s'�����B�q�a�c�c�g�g�H�:�S�1A�&A��B�s�!,�,r0z0.7r�)r7r�rr�rr;r<r:r�r�r�r�r�r�r�r�r�s      @r#�test_text_urls_texr�s����!�!�)�,�G�7�H�

�*�*�V�
$�C��H�H�S�#�'��X�J�c�:J�H�K�	����
@�����B�u��%�
�[�[�
�
�b�
!�
	@�S��Y�Y�q�\�(�(�F��B�F�B���E��$�$�$��:�:�a�=�G�O�O�E�$:�R�$?�?�?�?�
	@�
@�
@�
	@�
	@��
@�
@�s%�/D�AC:�)D�:D	�?D�Dc��tttj��5}|j	tj��ddd�y#1swYyxYwr�)r
rrR�devnullr:rr�)r3s r#�test_pdfpages_fspathr�0s<��	�$�r�z�z�"�	#�"�s����C�J�J�L�!�"�"�"�s�$A�Azhatching_legend.pdfc��tjd��}tddgdddd��}tddgdddd��}|j||||ggd��y	)
z.Test for correct hatching on patches in legend)r0r1r�r�green�XXXX)�	facecolor�hatch�blue)�r�r�r�N)rr�r�legend)r!r��bs   r#�test_hatching_legendr�5sU���*�*�V�
$�C��1�a�&�!�Q�'��@�A��1�a�&�!�Q�&��?�A��J�J��1�a��|�-�.r%zgrayscale_alpha.pdfc�D�tjddd�ddd�f\}}tj|dz|dzz�}tj||dk<t	j
�\}}|j
|dd��|jg�|jg�y)z9Masking images with NaN did not work for grayscale images���r1r��none�gray_r)�
interpolation�cmapN)	r^�ogrid�exp�nanrrrc�
set_xticks�
set_yticks)�xr��ddr!r"s     r#�test_grayscale_alphar�@s����8�8�B�q��G�R��"�W�$�%�D�A�q�	���!�Q�$��A��+��	�B��&�&�B�r�B�w�K��l�l�n�G�C���I�I�b��X�I�6��M�M�"���M�M�"�r%�defaultr3�eps)�
extensionsc	��|j�}|j�|jtjtj
ddd��dd��|j�}|j�y)NrZr[�dr�r�)�c)�add_subplot�set_axis_offr9r^ra�linspace)�fig_test�fig_ref�ax_test�ax_refs    r#�'test_pdf_eps_savefig_when_color_is_noner�Ls`���"�"�$�G������L�L�������B��3�/�0�#��L�@�
�
 �
 �
"�F�
���r%c���tjdd��tjt�5tj
t
j�d��ddd�y#1swYyxYw)z"Test failing latex subprocess callz$22_2_2$T)r�r3r4N)r�xlabelr7�raises�RuntimeErrorr:r;r<�r%r#�test_failing_latexrVsG���J�J�z�$�'�	���|�	$�0����B�J�J�L��/�0�0�0�s�*A$�$A-c��tj�\}}|jggd��|jt	j
�d��y)NT)�
rasterizedr3r4)rrr9r:r;r<r�s  r#�test_empty_rasterizedr^s9���l�l�n�G�C���G�G�B��t�G�$��K�K��
�
��U�K�+r%zkerning.pdfc��tj�}d}|jdd|d��|jdd|d��y)NuAVAVAVAVAVAVAVAV€AAVVrg�?r[)�sizeg�?�)rr�r)r!rKs  r#�test_kerningres:��

�*�*�,�C�!�A��H�H�Q��Q�Q�H���H�H�Q��Q�R�H� r%c���ttd��}d}t|�}|j|�tt	||��}|j|�|j�}|j�}t
|�t
d�|j�D��k(sJ�t|�t|�ksJ�|j�|j�k(sJ�y)Nzfonts/ttf/DejaVuSerif.ttfz%these should be subsetted! 1234567890c3�2K�|]}t|����y�wr�)�chr)r��keys  r#r�z%test_glyphs_subset.<locals>.<genexpr>}s����@�#�S��X�@�s�)
r�rr	�set_textr�get_charmap�set�keysrH�get_num_glyphs)�fpath�chars�	nosubfont�subfont�	nosubcmap�subcmaps      r#�test_glyphs_subsetrms�����:�;�<�E�3�E����I�
���u���'��u�5�6�G����U���%�%�'�I��!�!�#�G��u�:��@�����@�@�@�@�@��w�<�#�i�.�(�(�(��!�!�#�y�'?�'?�'A�A�A�Ar%zmulti_font_type3.pdfgffffff@)�tolc�b�tjdg��}ttj|��jdk7rtjd�tjdddgd��tjd	d
��tj�}|jdd
d�y)Nr'r-r(�Font may be missingr2r&��r.rr3r*�r)�333333�?�ffffff�?�"There are 几个汉字 in between!��fmrrr
r6r7r8r�rcr�r��fpr!s  r#�test_multi_font_type3r'�s��	�	�	�#6�"7�	8�B��B�K�K��O��!�!�%5�5����)�*��F�F�6�=�*=�>�R�H��F�F�5�1��

�*�*�,�C��H�H�T�5�>�?r%zmulti_font_type42.pdfg������@c�b�tjdg��}ttj|��jdk7rtjd�tjdddgd��tjd	d
��tj�}|jdd
d�y)Nr'r-r(rr2r&rrr3r+rrr r!r"r%s  r#�test_multi_font_type42r)�s��	�	�	�#6�"7�	8�B��B�K�K��O��!�!�%5�5����)�*��F�F�6�=�*=�>�R�H��F�F�5�2��

�*�*�,�C��H�H�T�5�>�?r%)>r�r�r;rR�pathlibr�tempfiler�numpyr^r7�
matplotlibr�rrrrr#�matplotlib.cbookr�matplotlib.ft2fontr	�matplotlib.font_managerr
r�#matplotlib.backends._backend_pdf_psr�matplotlib.backends.backend_pdfr
�matplotlib.patchesr�matplotlib.testing.decoratorsrr�matplotlib.testing._markersrr$�mark�parametrizer?rBrLrXrhr�r�r�r�r�r�r�r�r��style�contextr�rrrrr'r)rr%r#�<module>r:s�����	�	��'��
����,�&�<�A�4�(�O�4��+�,�-�#�.�#�&�����-�%�+�0��������a��W�-�,�.�	�
,�(�	��>+�& �FJ�("�J@�6@�4�@��@�0"�
�(�)�*�/�+�/��(�)�*��+�������9������/��0����0��0�,��=�/�"�!�#�!�B�2�)�*��4�	@�5�	@��*�+��5�	@�6�	@r%

Youez - 2016 - github.com/yon3zu
LinuXploit