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 :  C:/Python312/Lib/site-packages/pandas/tests/io/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/pandas/tests/io/__pycache__/test_html.cpython-312.pyc
�

0	�g��	�*�ddlmZddlmZddlmZmZddlZddlm	Z	ddl
Z
ddlZddlm
Z
ddlZddlZddlmZddlmcmZddlZddlmZmZmZmZmZmZmZm Z m!Z!ddl"m#Z$dd	l%m&Z&m'Z'dd
l(m)Z)ejTgd���d
��Z+d�Z,d�Z-d�Z.d�Z/ejTej`dejbd�ejbd�g��ej`dejbd���g��d��Z2Gd�d�Z3y)�)�Iterator)�partial)�BytesIO�StringION)�Path)�URLError)�is_platform_windows)	�NA�	DataFrame�
MultiIndex�Series�	Timestamp�
date_range�read_csv�	read_html�to_datetime)�ArrowStringArray�StringArray)�file_path_to_url)zchinese_utf-16.htmlzchinese_utf-32.htmlzchinese_utf-8.htmlzletz_latin1.html)�paramsc�,�|ddd|j�S)z6Parametrized fixture for HTML encoding test filenames.�io�data�
html_encoding)�param)�request�datapaths  �;C:\Python312\Lib\site-packages\pandas/tests/io/test_html.py�html_encoding_filer(s���D�&�/�7�=�=�A�A�c�6�t|�t|�k(sJdt|��dt|�����d}ttd�||��}|sJ|��t||�D]2\}}t	j
||g|��i|��|js�-Jd��y)Nz*lists are not of equal size len(list1) == z, len(list2) == z$not all list elements are DataFramesc�F�t|t�xrt|t�S�N��
isinstancer)�x�ys  r�<lambda>z(assert_framelist_equal.<locals>.<lambda>>s���A�y�1�N�j��I�6N�r zframes are both empty)�len�all�map�zip�tm�assert_frame_equal�empty)�list1�list2�args�kwargs�msg�both_frames�frame_i�frame_js        r�assert_framelist_equalr85s����u�:��U��#��	��U���%��U���	&��#�
1�C���N���	
��K�����;���u�-�:����
���g�w�@��@��@��=�=�9�"9�9� �:r c	�
�tjd�}tjd�|j|dd�tjtd��5t|ddd	d
�d��ddd�y#1swYyxYw)N�bs4�html5lib�__version__z4.2zPandas requires version��matchrr�html�	spam.html��flavor)�pytest�importorskip�setattr�raises�ImportErrorr)�monkeypatchrr:s   r�test_bs4_version_failsrIIso��
�
�
�e�
$�C�
���
�#�����]�E�2�	���{�*C�	D�M��(�4����=�e�L�M�M�M�s�A9�9Bc��d}d}d|zdz}tjt|��5tt	|�d|��ddd�y#1swYyxYw)Nz
google.comzinvalid flavorz\{z \} is not a valid set of flavorsr=�google�r>rB)rCrF�
ValueErrorrr)�urlrBr4s   r�test_invalid_flavorrORsR��
�C�
�F�
�&�.�>�
>�C�	���z��	-�@��(�3�-�x��?�@�@�@�s�A	�	Ac���tjd�tjd�tjd�|dddd�}t|ddg�	�}t|ddg�	�}t||�y)
Nr:�lxmlr;rrr?�valid_markup.htmlr)�	index_colrB)rCrDrr8)r�filename�dfs_lxml�dfs_bs4s    r�test_same_orderingrW[sg��
�����
�����
���
�#���f�f�.A�B�H���Q��x�@�H���A�u�g�>�G��8�W�-r r:r;)�marksrQc�8�tt|j��S)NrA)rrr)rs r�flavor_read_htmlrZfs���9�W�]�]�3�3r c	�h	�eZdZd�Zej
d��Zej
d��Zd�Zd�Z	ejjejjd���Z
ejjejjd���Zejjd��Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$ejjejjd���Z%ejjejjejjd����Z&ejjd��Z'ejjd ��Z(ejjd!��Z)ejjd"��Z*ejjd#��Z+ejjd$��Z,ejjd%��Z-ejjd&��Z.ejjd'��Z/d(�Z0ej
d)��Z1ejjejjd*���Z2ejjejjd+���Z3d,�Z4d-�Z5d.�Z6d/�Z7d0�Z8d1�Z9ejjd2��Z:ejjd3��Z;d4�Z<d5�Z=d6�Z>d7�Z?d8�Z@d9�ZAd:�ZBd;�ZCd<�ZDd=�ZEd>�ZFd?�ZGd@�ZHejj�dAdBdCg�dD��ZJdE�ZKdF�ZLdG�ZMdH�ZNdI�ZOdJ�ZPdK�ZQejjdL��ZRdM�ZSdN�ZTejj�dOdBeUdPg�dQfdCeUdRg�eUdPg�fg�dS��ZVejj�dTdBdCg�dU��ZWejj�dV�dW��ZYdX�ZZdY�Z[ejjejjdZ���Z\d[�Z]d\�Z^ejj�dAgd]��d^��Z_d_�Z`d`�Zada�Zbdb�ZcyQ)c�TestReadHtmlc�x�d}tjt|��5|d�ddd�y#1swYyxYw)Nz�Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.r=a<table>
                <thead>
                    <tr>
                        <th>A</th>
                        <th>B</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                    </tr>
                </tbody>
                <tbody>
                    <tr>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                </tbody>
            </table>)r-�assert_produces_warning�
FutureWarning)�selfrZr4s   r�test_literal_html_deprecationz*TestReadHtml.test_literal_html_deprecationqs@��
>�	��
'�
'�
�S�
A�	���
�	�	�	�s�	0�9c��|dddd�S)Nrrr?r@��r`rs  r�	spam_datazTestReadHtml.spam_data�s����f�f�k�:�:r c��|dddd�S)Nrrr?�
banklist.htmlrcrds  r�
banklist_datazTestReadHtml.banklist_data�s����f�f�o�>�>r c��ttjjd�jd�t	j
t
d�t����jdj�jt�}|j�}|t|�ddid	�
�d	}tj||�y)N�)���abc��dtype��columnsz{:.3f}�class�	dataframer)�attrsrS)r�np�random�default_rng�pd�Index�list�objectr+�format�astype�float�to_htmlrr-r.)r`rZ�df�out�ress     r�test_to_html_compatz TestReadHtml.test_to_html_compat�s�����	�	�%�%�a�(�/�/��7�����e��F�;�
�
�S����
!�&�&��-�
	��j�j�l����S�M�'�;�!7�1�
�
�
��	���c�2�&r c�v�ttdtjdgd��tgd�d��tdtjdgd��tgd	�d��gd
�gd�gd�gd
�d��}|dk(rft	tj
gd�tj���}t	tj
ddtgtj���}n�|dk(rNtjd�}ddl
m}||jgd���}||jgd
���}nMtjd�}t|jgd���}t|jgd
���}|jd��}	tjd|�5|t!|	�|��d}
ddd�ttdtjdgd��tgd�d��tdtjdgd��tgd	�d��tddtgd��tgd�d��||d��}|dk(rHddl}ddl
m}t|j$D�cic]}|||j||d�����!c}�}t'j(
|�y#1swY��xYwcc}w)N�rl�Int64rn)r�rjrl��?�@�Float64)r�g@r�)TFN)TFT��a�b�c)r�r�N)r�r�r��d�e�f�g�h�pythonr�r��pyarrowr)�ArrowExtensionArrayF��indexzmode.string_storage��
dtype_backendT�boolean)�from_pandas)rr
ru�nanr�array�object_r
rCrD�
pandas.arraysr�rrrx�option_contextrr�rqr-r.)
r`�string_storager�rZr��string_array�string_array_na�par�r��result�expected�cols
             r�test_dtype_backendzTestReadHtml.test_dtype_backend�s@��
��Q�����N�'�:��I�W�5��S�"�&�&�#�.�i�@��O�9�=�(�(�$�%�	
�
���X�%�&�r�x�x��r�z�z�'R�S�L�)�"�(�(�C��b�>����*T�U�O�
�i�
'��$�$�Y�/�B�9�.�r�x�x��/H�I�L�1�"�(�(�;K�2L�M�O��$�$�Y�/�B�+�B�H�H�_�,E�F�L�.�r�x�x�8H�/I�J�O��j�j�u�j�%��
�
�
�4�n�
E�	U�%�h�s�m�=�Q�RS�T�F�	U���Q�����N�'�:��I�W�5��S�"�&�&�#�.�i�@��O�9�=��T�5�"�-�Y�?��/�y�A�!�$�	
�
���I�%� �9� � (�/�/����,�R�X�X�h�s�m�QU�X�-V�W�W���H�	���f�h�/�9	U�	U��,s�"J*�($J6�*J3c���t|d��5}|j|j���||jd��}||jd��}ddd�t	�y#1swY�xYw)N�utf-8��encoding��content�First Federal Bank of Floridar=�Metcalf Bank��open�
serve_content�readrNr8)r`�
httpserverrhrZr��df1�df2s       r�test_banklist_urlzTestReadHtml.test_banklist_url�sr���-�'�
2�	�a��$�$�Q�V�V�X�$�6�"����5��C�#����$��C�	�	�s�C�(�	�	���A	A,�,A5c���t|d��5}|j|j���||jd��}||jd��}ddd�t	�y#1swY�xYw)Nr�r�r��	.*Water.*r=�Unitr�)r`r�rerZr�r�r�s       r�
test_spam_urlzTestReadHtml.test_spam_url�sl���)�g�
.�	A�!��$�$�Q�V�V�X�$�6�"�:�>�>��E�C�"�:�>�>��@�C�	A�
	�s�C�(�	A�	A�r�c�P�||dddi��}||dddi��}t||�y)Nz.*Florida.*�id�table�r>rtr��r8)r`rhrZr�r�s     r�
test_banklistzTestReadHtml.test_banklists:�����t�W�o�
������g��
��	�s�C�(r c��||d��}||d��}t||�|djddk(sJ�|djddk(sJ�y)Nr�r=r�r�rr�
Proximates�Nutrient)r8�ilocrq�r`rerZr�r�s     r�	test_spamzTestReadHtml.test_spamsZ���y��<���y��7���s�C�(��1�v�{�{�4� �L�0�0�0��1�v�~�~�a� �J�.�.�.r c�F�||�}|D]}t|t�r�J�yr#r$)r`rerZ�dfsr�s     r�test_spam_no_matchzTestReadHtml.test_spam_no_matchs+���y�)���	-�B��b�)�,�,�,�	-r c�N�||ddi��}|D]}t|t�r�J�y)Nr�r�)rtr$)r`rhrZr�r�s     r�test_banklist_no_matchz#TestReadHtml.test_banklist_no_matchs1���}�T�7�O�D���	-�B��b�)�,�,�,�	-r c�d�||dd��d}|jddk(sJ�|jrJ�y)Nr�rj�r>�headerrr�)rqr/)r`rerZr�s    r�test_spam_headerzTestReadHtml.test_spam_headers9��
�i�{�1�
E�a�
H���z�z�!�}��,�,�,��8�8��|�8r c�H�||dd��}||dd��}t||�y�Nr�r��r>�skiprowsr�r�r�s     r�test_skiprows_intzTestReadHtml.test_skiprows_int"�(���y��a�H���y���C���s�C�(r c�l�||dtd���}||dtd���}t||�y�Nr�rjr�r�)�ranger8r�s     r�test_skiprows_rangez TestReadHtml.test_skiprows_range(�0���y��e�A�h�O���y���q��J���s�C�(r c�P�||dddg��}||dddg��}t||�y�Nr�r�rjr�r�r�r�s     r�test_skiprows_listzTestReadHtml.test_skiprows_list.�0���y��q�!�f�M���y��!�Q��H���s�C�(r c�P�||dddh��}||dddh��}t||�yr�r�r�s     r�test_skiprows_setzTestReadHtml.test_skiprows_set4r�r c�H�||dd��}||dd��}t||�yr�r�r�s     r�test_skiprows_slicez TestReadHtml.test_skiprows_slice:r�r c�l�||dtd���}||dtd���}t||�yr���slicer8r�s     r�test_skiprows_slice_shortz&TestReadHtml.test_skiprows_slice_short@r�r c	�r�||dtdd���}||dtddd���}t||�y)	Nr�rj�r�r�rkr����r�r�s     r�test_skiprows_slice_longz%TestReadHtml.test_skiprows_slice_longFs6���y��e�A�q�k�R���y���q�!�R��Q���s�C�(r c��||dtjd���}||dtjd���}t||�yr�)ru�aranger8r�s     r�test_skiprows_ndarrayz"TestReadHtml.test_skiprows_ndarrayLs9���y��b�i�i�PQ�l�S���y�����1��N���s�C�(r c�z�tjtd��5||dd��ddd�y#1swYyxYw)Nz%is not a valid type for skipping rowsr=r��asdfr�)rCrF�	TypeError)r`rerZs   r�test_skiprows_invalidz"TestReadHtml.test_skiprows_invalidRs6��
�]�]�9�-T�
V�	L��Y�k�F�K�	L�	L�	L�s�1�:c�H�||dd��}||dd��}t||�y�Nr�r�r>rSr�r�r�s     r�
test_indexzTestReadHtml.test_indexVs(���y��q�I���y��!�D���s�C�(r c�L�||ddd��}||ddd��}t||�y�Nr�r�r)r>r�rSr�r�r�s     r�test_header_and_index_no_typesz+TestReadHtml.test_header_and_index_no_types[�-���y��A�QR�S���y��q�A�N���s�C�(r c�L�||ddd��}||ddd��}t||�yr�r�r�s     r� test_header_and_index_with_typesz-TestReadHtml.test_header_and_index_with_types`r�r c�H�||dd��}||dd��}t||�yr�r�r�s     r�test_infer_typeszTestReadHtml.test_infer_typeses(���y��q�I���y��!�D���s�C�(r c�0�t|d��5}t|j��}ddd�t|d��5}t|j��}ddd�|d��}|d��}t||�y#1swY�YxYw#1swY�6xYw�NzUTF-8r�r�r=r�)r�rr�r8)r`rerZr��data1�data2r�r�s        r�test_string_iozTestReadHtml.test_string_ioks���
�)�g�
.�	'�!��Q�V�V�X�&�E�	'��)�g�
.�	'�!��Q�V�V�X�&�E�	'��u�K�8���u�F�3���s�C�(�	'�	'��	'�	'�s�B�B�B	�Bc���t|d��5}|j�}ddd�|t�d��}|t|�d��}t||�y#1swY�<xYwr)r�r�rr8)r`rerZr�rr�r�s       r�test_stringzTestReadHtml.test_stringvsZ��
�)�g�
.�	�!��6�6�8�D�	��x��~�[�A���x��~�V�<���s�C�(�
	�	�s�A�A#c���t|d��5}||d��}ddd�t|d��5}||d��}ddd�t�y#1swY�6xYw#1swY�"xYwr)r�r8)r`rerZr�r�r�s      r�test_file_likezTestReadHtml.test_file_likesj��
�)�g�
.�	9�!�"�1�K�8�C�	9��)�g�
.�	4�!�"�1�F�3�C�	4�	�s�C�(�
	9�	9��	4�	4�s�A�A�A�A#c��|jdd��tjtd��5|dd��ddd�y#1swYyxYw)Nz#urlopen error unknown url type: git���coder=zgit://github.comr�)r�rCrFr�r`r�rZs   r�test_bad_url_protocolz"TestReadHtml.test_bad_url_protocol�sK��	� � �!F�S� �Q�
�]�]�8�+P�
Q�	D��/�{�C�	D�	D�	D�s�A�Ac��|jdd��tjttfd��5||j
d��ddd�y#1swYyxYw)NzName or service not knownrr
zHTTP Error 404: NOT FOUNDr=r�)r�rCrFrrMrNrs   r�test_invalid_urlzTestReadHtml.test_invalid_url�sS��	� � �!<�3� �G�
�]�]�H�j�1�9T�
U�	@��Z�^�^�;�?�	@�	@�	@�s�A�Ac���|}|ttjj|��dddi��}t	|t
�sJ�|D]}t	|t�r�J�y)N�Firstr�r�r�)r�os�path�abspathr%rzr�r`rhrZrNr�r�s      r�
test_file_urlzTestReadHtml.test_file_url�s`������R�W�W�_�_�S�1�2�'�$�PW��
���#�t�$�$�$��	-�B��b�)�,�,�,�	-r c��|}tjtd��5||dddi��ddd�y#1swYyxYw)NzNo tables foundr=r�r��	tasdfabler��rCrFrM)r`rhrZrNs    r�test_invalid_table_attrsz%TestReadHtml.test_invalid_table_attrs�s@����
�]�]�:�->�
?�	���:�4��BU�
�	�	�	���5�>c�b�||dddiddg��d}t|jt�sJ�y)N�Metcalfr�r�rr�)r>rtr��r%rqr�r`rhrZr�s    r�test_multiindex_headerz#TestReadHtml.test_multiindex_header�s;��
���4��/�1�a�&�
�
�
���"�*�*�j�1�1�1r c�b�||dddiddg��d}t|jt�sJ�y)Nr r�r�rr�)r>rtrS)r%r�rr"s    r�test_multiindex_indexz"TestReadHtml.test_multiindex_index�s<��
���4��/�a�QR�V�
�
�
���"�(�(�J�/�/�/r c��||dddiddgddg��d}t|jt�sJ�t|jt�sJ�y)Nr r�r�rr�)r>rtr�rS)r%rqrr�r"s    r�test_multiindex_header_indexz)TestReadHtml.test_multiindex_header_index�s[��
�����/��q�6��!�f�
��

���"�*�*�j�1�1�1��"�(�(�J�/�/�/r c�d�||dddiddgd��d}t|jt�sJ�y�Nr r�r�rr�)r>rtr�r�r!r"s    r�&test_multiindex_header_skiprows_tuplesz3TestReadHtml.test_multiindex_header_skiprows_tuples��C��
�����/��q�6��
��

���"�*�*�j�1�1�1r c�d�||dddiddgd��d}t|jt�sJ�yr)r!r"s    r�test_multiindex_header_skiprowsz,TestReadHtml.test_multiindex_header_skiprows�r+r c��||dddiddgddgd��d}t|jt�sJ�t|jt�sJ�y)Nr r�r�rr�)r>rtr�rSr�)r%r�rrqr"s    r�%test_multiindex_header_index_skiprowsz2TestReadHtml.test_multiindex_header_index_skiprows�s^��
�����/��q�6��!�f��

��
���"�(�(�J�/�/�/��"�*�*�j�1�1�1r c��|}|ttjj|��t	j
t	j
d��ddi��}t
|t�sJ�|D]}t
|t�r�J�y)N�Floridar�r�r�)	rrrr�re�compiler%rzrrs      r�test_regex_idempotencyz#TestReadHtml.test_regex_idempotency�ss������R�W�W�_�_�S�1�2��*�*�R�Z�Z�	�2�3���/�
��
�#�t�$�$�$��	-�B��b�)�,�,�,�	-r c�~�d}tjt|��5||dd��ddd�y#1swYyxYw)Nz\(you passed a negative value\)r=�Waterr�r�r)r`rerZr4s    r�test_negative_skiprowsz#TestReadHtml.test_negative_skiprows�s:��0��
�]�]�:�S�
1�	D��Y�g��C�	D�	D�	D�s�3�<c��y)Naf

          <table class="contentstable" align="center"><tr>
            <td width="50%">
            <p class="biglink"><a class="biglink" href="whatsnew/2.7.html">What's new in Python 2.7?</a><br/>
                <span class="linkdescr">or <a href="whatsnew/index.html">all "What's new" documents</a> since 2.0</span></p>
            <p class="biglink"><a class="biglink" href="tutorial/index.html">Tutorial</a><br/>
                <span class="linkdescr">start here</span></p>
            <p class="biglink"><a class="biglink" href="library/index.html">Library Reference</a><br/>
                <span class="linkdescr">keep this under your pillow</span></p>
            <p class="biglink"><a class="biglink" href="reference/index.html">Language Reference</a><br/>
                <span class="linkdescr">describes syntax and language elements</span></p>
            <p class="biglink"><a class="biglink" href="using/index.html">Python Setup and Usage</a><br/>
                <span class="linkdescr">how to use Python on different platforms</span></p>
            <p class="biglink"><a class="biglink" href="howto/index.html">Python HOWTOs</a><br/>
                <span class="linkdescr">in-depth documents on specific topics</span></p>
            </td><td width="50%">
            <p class="biglink"><a class="biglink" href="installing/index.html">Installing Python Modules</a><br/>
                <span class="linkdescr">installing from the Python Package Index &amp; other sources</span></p>
            <p class="biglink"><a class="biglink" href="distributing/index.html">Distributing Python Modules</a><br/>
                <span class="linkdescr">publishing modules for installation by others</span></p>
            <p class="biglink"><a class="biglink" href="extending/index.html">Extending and Embedding</a><br/>
                <span class="linkdescr">tutorial for C/C++ programmers</span></p>
            <p class="biglink"><a class="biglink" href="c-api/index.html">Python/C API</a><br/>
                <span class="linkdescr">reference for C/C++ programmers</span></p>
            <p class="biglink"><a class="biglink" href="faq/index.html">FAQs</a><br/>
                <span class="linkdescr">frequently asked questions (with answers!)</span></p>
            </td></tr>
        </table>

        <p><strong>Indices and tables:</strong></p>
        <table class="contentstable" align="center"><tr>
            <td width="50%">
            <p class="biglink"><a class="biglink" href="py-modindex.html">Python Global Module Index</a><br/>
                <span class="linkdescr">quick access to all modules</span></p>
            <p class="biglink"><a class="biglink" href="genindex.html">General Index</a><br/>
                <span class="linkdescr">all functions, classes, terms</span></p>
            <p class="biglink"><a class="biglink" href="glossary.html">Glossary</a><br/>
                <span class="linkdescr">the most important terms explained</span></p>
            </td><td width="50%">
            <p class="biglink"><a class="biglink" href="search.html">Search page</a><br/>
                <span class="linkdescr">search this documentation</span></p>
            <p class="biglink"><a class="biglink" href="contents.html">Complete Table of Contents</a><br/>
                <span class="linkdescr">lists all sections and subsections</span></p>
            </td></tr>
        </table>
        rc�r`s r�python_docszTestReadHtml.python_docs�s��-r c�p�|j|��||jd��}t|�dkDsJ�y)Nr��Pythonr=r�)r�rNr))r`r:r�rZr�s     r�test_multiple_matchesz"TestReadHtml.test_multiple_matches(s5��	� � �� �5��z�~�~�X�>���3�x�!�|��|r c��|j|��||jd��}|D�cgc]}|jddd��}}t|�ddgk(sJ�ycc}w)	Nr�r<r=r�rrk�Pyth�What)r�rNr��sorted)r`r:r�rZr�r��zzs       r�test_python_docs_tablez#TestReadHtml.test_python_docs_table/sc��	� � �� �5��z�~�~�X�>��+.�
/�R�b�g�g�d�m�A�a� �
/��
/��b�z�f�f�-�-�-�-��0s�Ac�J�d}|t|��}t|�dk(sJ�y)z@
        Make sure that read_html ignores empty tables.
        a�
            <table>
                <thead>
                    <tr>
                        <th>A</th>
                        <th>B</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                    </tr>
                </tbody>
            </table>
            <table>
                <tbody>
                </tbody>
            </table>
        r�N)rr))r`rZr?r�s    r�test_empty_tableszTestReadHtml.test_empty_tables7s+����("�(�4�.�1���6�{�a���r c��|td��d}tddgddggddg�	�}tj||�y)
Na�<table>
            <thead>
                <tr>
                    <th>A</th>
                    <th>B</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>1</td>
                    <td>2</td>
                </tr>
            </tbody>
            <tbody>
                <tr>
                    <td>3</td>
                    <td>4</td>
                </tr>
            </tbody>
        </table>rr�rjrlrk�A�B�rrq�rrr-r.�r`rZr�r�s    r�test_multiple_tbodyz TestReadHtml.test_multiple_tbodyRsT��"���
�
�.�/
��2�A�q�6�A�q�6�"2�S�#�J�G��
���f�h�/r c�x�|td��d}tddidg��}tj||�y)zt
        Don't fail with bs4 when there is a header and only one column
        as described in issue #9178
        a3<table>
                <thead>
                    <tr>
                        <th>Header</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>first</td>
                    </tr>
                </tbody>
            </table>r�Header�first�rr�NrJrKs    r�test_header_and_one_columnz'TestReadHtml.test_header_and_one_columnrsJ��
"���

�
��
��"�8�W�"5�a�S�A��
���f�h�/r c�|�|td��d}tgd�ggd���}tj||�y)zK
        Ensure parser adds <tr> within <thead> on malformed HTML.
        a�<table>
            <thead>
                <tr>
                    <th>Country</th>
                    <th>Municipality</th>
                    <th>Year</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Ukraine</td>
                    <th>Odessa</th>
                    <td>1944</td>
                </tr>
            </tbody>
        </table>r)�Ukraine�Odessa�)�Country�Municipality�YearrINrJrKs    r�test_thead_without_trz"TestReadHtml.test_thead_without_tr�sL��"���
�
�&�'
��*�-�.�7�
��
	���f�h�/r c�F�d}tddggddg��}tddgddggddg��}|jd	�
�}|jd�
�}|t|��d}|t|��d}tj||�tj||�y
)zh
        Make sure that read_html reads tfoot, containing td or th.
        Ignores empty tfoot
        a�<table>
            <thead>
                <tr>
                    <th>A</th>
                    <th>B</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>bodyA</td>
                    <td>bodyB</td>
                </tr>
            </tbody>
            <tfoot>
                {footer}
            </tfoot>
        </table>�bodyA�bodyBrGrHrI�footA�footB�)�footerz%<tr><td>footA</td><th>footB</th></tr>rN)rr|rr-r.)	r`rZ�
data_template�	expected1�	expected2rr�result1�result2s	         r�test_tfoot_readzTestReadHtml.test_tfoot_read�s���
�
�$�W�g�$6�#7�#�s��L�	���G�$�w��&8�9�C��:�
�	��$�$�B�$�/���$�$�,S�$�T��"�8�E�?�3�A�6��"�8�E�?�3�A�6��
���g�y�1�
���g�y�1r c�|�|td�d��d}tddggd��}tj||�y)Na

            <table>
                <tr>
                    <td>S</td>
                    <td>I</td>
                </tr>
                <tr>
                    <td>text</td>
                    <td>1944</td>
                </tr>
            </table>
        r�r��textrU)�S�IrprJrKs    r�&test_parse_header_of_non_string_columnz3TestReadHtml.test_parse_header_of_non_string_column�sO��"���

��
� �!
��$�v�t�n�-�z�B��
���f�h�/r c��
�ddlm�
�
fd�}||dddi��d}t|dd	d
d�ttd��
�}|j|jk(sJ�gd�}gd�}|j|�j
||�}	|j|�}
|	}ddg}||jt�||<tj||
�y)Nr)�_remove_whitespacec�8��	�|�S#t$r|cYSwxYwr#)�AttributeError)r&rns �r�
try_remove_wsz8TestReadHtml.test_banklist_header.<locals>.try_remove_ws�s'���
�)�!�,�,��!�
���
�s���r r�r�r�rr�csvzbanklist.csv)�Updated Date�Closing Date��
converters)
z,First Vietnamese American Bank In Vietnamesez"Westernbank Puerto Rico En Espanolz*R-G Premier Bank of Puerto Rico En EspanolzEurobank En EspanolzSanderson State Bank En EspanolzLWashington Mutual Bank (Including its subsidiary Washington Mutual Bank FSB)zSilver State Bank En Espanolz%AmTrade International Bank En EspanolzHamilton Bank, NA En Espanolz6The Citizens Savings Bank Pioneer Community Bank, Inc.)
zFirst Vietnamese American BankzWesternbank Puerto RicozR-G Premier Bank of Puerto Rico�EurobankzSanderson State BankzWashington Mutual BankzSilver State BankzAmTrade International BankzHamilton Bank, NAzThe Citizens Savings Bankrtrs)�pandas.io.htmlrnrr�shaper+�replace�applyrr-r.)r`rhrrZrqr��ground_truth�old�new�dfnew�gtnew�	converted�	date_colsrns             @r�test_banklist_headerz!TestReadHtml.test_banklist_header�s����5�	��m�9�T�7�O�
T�UV�
W����T�6�5�.�9�(1�9�M�
���x�x�<�-�-�-�-�-�
��
�����}�%�-�-�c�3�7��� � ��/���	�#�^�4�	�(��3�9�9�+�F�	�)��
���i��/r c��d}t|d��5}|j�}ddd�|vsJ�||dddi��d}||j�vsJ�y#1swY�4xYw)NzGold Canyonr�r�r�r�r�r)r�r��	to_string)r`rhrZ�gcr��raw_textr�s       r�test_gold_canyonzTestReadHtml.test_gold_canyonst��
��
�-�'�
2�	 �a��v�v�x�H�	 ��X�~��~�
���t�W�o�
�
�
���R�\�\�^�#�#�#�	 �	 �s�A�Ac��|td�d��d}|td�d��d}tj||�y)Na�<table>
                        <thead>
                            <tr style="text-align: right;">
                            <th></th>
                            <th>C_l0_g0</th>
                            <th>C_l0_g1</th>
                            <th>C_l0_g2</th>
                            <th>C_l0_g3</th>
                            <th>C_l0_g4</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                            <th>R_l0_g0</th>
                            <td> 0.763</td>
                            <td> 0.233</td>
                            <td> nan</td>
                            <td> nan</td>
                            <td> nan</td>
                            </tr>
                            <tr>
                            <th>R_l0_g1</th>
                            <td> 0.244</td>
                            <td> 0.285</td>
                            <td> 0.392</td>
                            <td> 0.137</td>
                            <td> 0.222</td>
                            </tr>
                        </tbody>
                    </table>r�rSa�<table>
                    <thead>
                        <tr style="text-align: right;">
                        <th></th>
                        <th>C_l0_g0</th>
                        <th>C_l0_g1</th>
                        <th>C_l0_g2</th>
                        <th>C_l0_g3</th>
                        <th>C_l0_g4</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                        <th>R_l0_g0</th>
                        <td> 0.763</td>
                        <td> 0.233</td>
                        </tr>
                        <tr>
                        <th>R_l0_g1</th>
                        <td> 0.244</td>
                        <td> 0.285</td>
                        <td> 0.392</td>
                        <td> 0.137</td>
                        <td> 0.222</td>
                        </tr>
                    </tbody>
                 </table>)rr-r.)r`rZr�r�s    r�test_different_number_of_colsz*TestReadHtml.test_different_number_of_cols'sh��#�� �
�@�C"
�D�E"
��H"���
�:�=
�>�?
��B	���f�h�/r c�|�|td��d}tgd�ggd���}tj||�y)NaZ
            <table>
                <tr>
                    <th>A</th>
                    <th colspan="1">B</th>
                    <th rowspan="1">C</th>
                </tr>
                <tr>
                    <td>a</td>
                    <td>b</td>
                    <td>c</td>
                </tr>
            </table>
        rr�)rGrH�CrprJrKs    r�test_colspan_rowspan_1z#TestReadHtml.test_colspan_rowspan_1osD��!��
�
�
�"�#
��&�o�.��H��
���f�h�/r c��|td�d��d}tgd�ggd���}tj||�y)Na�
            <table>
                <tr>
                    <td colspan="2">X</td>
                    <td>Y</td>
                    <td rowspan="2">Z</td>
                    <td>W</td>
                </tr>
                <tr>
                    <td>A</td>
                    <td colspan="2">B</td>
                    <td>C</td>
                </tr>
            </table>
        rrh)rGrHrH�Zr�)�XzX.1�Yr��WrIrJrKs    r� test_colspan_rowspan_copy_valuesz-TestReadHtml.test_colspan_rowspan_copy_values�sQ��"���
�"�%
�&�'
��*�+�,�6Q�
��	���f�h�/r c��|td�d��d}tgd�ggd���}tj||�y)Na(
            <table>
                <tr>
                    <td rowspan="2">A</td>
                    <td rowspan="2" colspan="3">B</td>
                    <td>C</td>
                </tr>
                <tr>
                    <td>D</td>
                </tr>
            </table>
        rrh)rGrHrHrH�D)rGrHzB.1zB.2r�rIrJrKs    r�test_colspan_rowspan_both_not_1z,TestReadHtml.test_colspan_rowspan_both_not_1�sQ��"���

��
� �!
��$�+�,�6S�
��	���f�h�/r c��|td�d��d}tddggddg��}tj||�y)Nz�
            <table>
                <tr>
                    <td>A</td>
                    <td rowspan="2">B</td>
                </tr>
                <tr>
                    <td>C</td>
                </tr>
            </table>
        rrhr�rHrGrIrJrKs    r�test_rowspan_at_end_of_rowz'TestReadHtml.test_rowspan_at_end_of_row�sR��"��
�
��
��
��"�C��:�,��c�
�C��
���f�h�/r c��|td�d��d}tddgddggddg��}tj||�y)Nz�
            <table>
                <tr>
                    <td rowspan="3">A</td>
                    <td rowspan="3">B</td>
                </tr>
            </table>
        rrhrGrHrIrJrKs    r�test_rowspan_only_rowsz#TestReadHtml.test_rowspan_only_rows�sY��"���	
��
��
���C��:��S�z�":�S�#�J�O��
���f�h�/r c��|td��d}tddgddggddgddgg��}tdd	gg|�
�}tj||�y)Nam
            <table>
                <tr>
                    <th>A</th>
                    <th>B</th>
                </tr>
                <tr>
                    <th>a</th>
                    <th>b</th>
                </tr>
                <tr>
                    <td>1</td>
                    <td>2</td>
                </tr>
            </table>
        rrGrHr�r�r���levels�codesrjrI�rrrr-r.�r`rZr�rqr�s     r�+test_header_inferred_from_rows_with_only_thz8TestReadHtml.test_header_inferred_from_rows_with_only_th�sn��!���
�
�&�'
��*�c�3�Z�#�s��$<�a��V�a�QR�V�DT�U���A�q�6�(�G�<��
���f�h�/r c��tdtdd��i�}|j�}|t|�dgd��}t	j
||d�|t|�dgd��}t	j
||d�y)N�date�1/1/2001�
��periodsr�r��parse_datesrS)rrrrr-r.)r`rZr�r�r�s     r�test_parse_dates_listz"TestReadHtml.test_parse_dates_listsv��
��
�:�r� B�C�
D���:�:�<���x��1��s�a�P��
���b�#�a�&�)��x��1��x�ST�U��
���b�#�a�&�)r c�$�ttdd���}t|jd��|jd��d��}|t	|j��ddd	gid�
�}td|i�}t
j||d�y)Nr�r�r�c�4�t|j��Sr#)�strr��r&s rr(z7TestReadHtml.test_parse_dates_combine.<locals>.<lambda>%����A�F�F�H�
�r c�4�t|j��Sr#)r��timer�s rr(z7TestReadHtml.test_parse_dates_combine.<locals>.<lambda>&r�r )r�r��datetimer�rjr�r)r
rrr+rrr-r.)r`rZ�	raw_datesr�r��newdfs      r�test_parse_dates_combinez%TestReadHtml.test_parse_dates_combine!s����:�j�"�=�>�	�
�!�
�
�&=�>�!�
�
�&=�>�
�
����R�Z�Z�\�"��a��V�0D�PQ�
���:�y�1�2��
���e�S��V�,r c���|dddd�}tjj|�sJt|��d���tjj	|�sJt|��d���||dd�	�d
}|j
dk(sJ�d|jd
vsJ�|djtjd�k(sJ�tj|jdd�sJ�y)Nrrr?�wikipedia_states.htmlz is not a filez is an empty file�Arizonar�r�r)�<��Unnamedr��sq mi�float64)rr��H�zPN$A)rr�isfile�repr�getsizeryrqroru�allclose�loc�r`rrZrr�s     r�test_wikipedia_states_tablez(TestReadHtml.test_wikipedia_states_table/s�����f�f�.E�F���w�w�~�~�d�#�B��T�
�|�>�%B�B�#��w�w���t�$�F��d���4E�&F�F�$�!�$�i��B�1�E���|�|�x�'�'�'��F�N�N�2�.�.�.�.��g��$�$�����(;�;�;�;��{�{�6�:�:�j�1�9�=�=�=r c��|dddd�}||dd��d}|jdk(sJ�d	|jd
dvsJ�|jjdk(sJ�tj|j
d
d�sJ�y)Nrrr?r�r�rr�)r��r�r�r�rj)�Alaska)z
Total area[2]r�r�)ryrq�nlevelsrur�r�r�s     r� test_wikipedia_states_multiindexz-TestReadHtml.test_wikipedia_states_multiindex9s�����f�f�.E�F��!�$�i�1�E�a�H���|�|�x�'�'�'��F�N�N�2�.�q�1�1�1�1��~�~�%�%��*�*�*��{�{�6�:�:�&J�K�Y�W�W�Wr c��|td�ddg��}tddggtjddg��	�}t	j
|d|�y)
NaK
                <table>
                    <thead>
                        <tr><th></th><th></tr>
                        <tr><th>A</th><th>B</th></tr>
                    </thead>
                    <tbody>
                        <tr><td>a</td><td>b</td></tr>
                    </tbody>
                </table>
            rr�rhr�r�)�Unnamed: 0_level_0rG)zUnnamed: 1_level_0rHrp)rrr�from_tuplesr-r.rKs    r�%test_parser_error_on_empty_header_rowz2TestReadHtml.test_parser_error_on_empty_header_rowAsd��!��
�
��q�6�
�� ��3�Z�L��*�*�,�.I�J��
��	���f�Q�i��2r c���|td�d��d}tddidg��}|djtjd�k(sJ�t	j
||�y)	Na�<html>
            <body>
             <table>
                <thead>
                    <tr>
                        <th>Header</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1100#101</td>
                    </tr>
                </tbody>
            </table>
            </body>
        </html>�#)�decimalrrNg�C�lg0�@rPr�)rrrorur-r.rKs    r�test_decimal_rowszTestReadHtml.test_decimal_rowsZso��!���
�$�'
�(�)
��,�8�X�"6�q�c�B���h��%�%����)�)<�<�<�<�
���f�h�/r �argTFc��tjd�}tjt|��5|||��ddd�y#1swYyxYw)Nz�Passing a bool to header is invalid. Use header=None for no header or header=int or list-like of ints to specify the row(s) making up the column namesr=rh)r2�escaperCrFr�)r`rer�rZr4s     r�test_bool_header_argz!TestReadHtml.test_bool_header_argwsF���i�i�
�
��
�]�]�9�C�
0�	4��Y�s�3�	4�	4�	4�s�A�Ac��|td�dti��d}tdddgi�}tj||�y)Na�<table>
                 <thead>
                   <tr>
                     <th>a</th>
                    </tr>
                 </thead>
                 <tbody>
                   <tr>
                     <td> 0.763</td>
                   </tr>
                   <tr>
                     <td> 0.244</td>
                   </tr>
                 </tbody>
               </table>r�rurz0.763z0.244)rr�rr-r.rKs    r�test_converterszTestReadHtml.test_converters�sR��!���
�"�S�z�%
�&�'
��*�c�G�W�#5�6�7��
���f�h�/r c��|td�dg��d}tddtjgi�}t	j
||�y)Na�<table>
                 <thead>
                   <tr>
                     <th>a</th>
                   </tr>
                 </thead>
                 <tbody>
                   <tr>
                     <td> 0.763</td>
                   </tr>
                   <tr>
                     <td> 0.244</td>
                   </tr>
                 </tbody>
               </table>g�Zd;�?)�	na_valuesrr�g�"�~j�?�rrrur�r-r.rKs    r�test_na_valueszTestReadHtml.test_na_values�sS��!���
�"�g�%
�&�'
��*�c�E�2�6�6�?�3�4��
���f�h�/r c�,�d}tdddgi�}|t|�d��d}tj||�tdtj
tj
gi�}|t|�d��d}tj||�y)	Na�<table>
                        <thead>
                            <tr>
                            <th>a</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                            <td> N/A</td>
                            </tr>
                            <tr>
                            <td> NA</td>
                            </tr>
                        </tbody>
                    </table>r�zN/Ar
F)�keep_default_narT)rrr-r.rur�)r`rZ�	html_data�expected_df�html_dfs     r�test_keep_default_naz!TestReadHtml.test_keep_default_na�s��� �	�  ��u�d�m� 4�5��"�8�I�#6��N�q�Q��
���k�7�3���r�v�v�r�v�v�&6� 7�8��"�8�I�#6��M�a�P��
���k�7�3r c��|td��d}tddgtjtjggddg��}t	j
||�y)Nak
            <table>
                <tr>
                    <th>A</th>
                    <th>B</th>
                </tr>
                <tr>
                    <td>a</td>
                    <td>b</td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        rr�r�rGrHrIr�rKs    r�test_preserve_empty_rowsz%TestReadHtml.test_preserve_empty_rows�s\��!���
�
�&�'
��*�C��:�������/?�"@�3�PS�*�U��
���f�h�/r c��|td��d}tddgddggddgddgg��}tdd	gg|�
�}tj||�y)NaU
            <table>
                <thead>
                    <tr><th></th><th></tr>
                    <tr><th>A</th><th>B</th></tr>
                    <tr><th>a</th><th>b</th></tr>
                </thead>
                <tbody>
                    <tr><td>1</td><td>2</td></tr>
                </tbody>
            </table>
        rrGrHr�r�r�r�rjrIr�r�s     r�,test_ignore_empty_rows_when_inferring_headerz9TestReadHtml.test_ignore_empty_rows_when_inferring_header�sn��!���

�
��
��"�c�3�Z�#�s��$<�a��V�a�QR�V�DT�U���A�q�6�(�G�<��
���f�h�/r c��tgd���}gd�gd�g|_|jd��}|t|��d}t	j
||�y)N))�Hillary�Dr�)�Bernie�Jr�)�Donald�E�R)r)r��Age�Party)�NamezUnnamed: 1_level_1zUnnamed: 2_level_1Fr�r)rrqrrr-r.)r`rZr�r?r�s     r�test_multiple_header_rowsz&TestReadHtml.test_multiple_header_rowssY���Q�
��
3�@�
����"�"��"�/��"�8�D�>�2�1�5��
���k�7�3r c�|�|dddd�}||d��}t|t�sJ�t|dt�sJ�y)Nrrr?rRrr�)r%rzr)r`rrZrTr�s     r�test_works_on_valid_markupz'TestReadHtml.test_works_on_valid_markupsC���D�&�&�2E�F���x�1�5���#�t�$�$�$��#�a�&�)�,�,�,r c�4�|dddd�}||dddg��y)	Nrrr?rgr�rQr;rLrc)r`rrZrhs    r�test_fallback_successz"TestReadHtml.test_fallback_successs#�� ��v�v��G�
���k�6�:�BV�Wr c��tdd��}ttjj	d�jd�|��}|j
�}d|vsJ�y)Nz
2000-01-01r�r�rj)r�rkr�)rrrurvrw�standard_normalr)r`�rngr�r�s    r�test_to_html_timestampz#TestReadHtml.test_to_html_timestampsN����r�2��
�r�y�y�,�,�Q�/�?�?��H�PS�
T��������v�%�%�%r c�^�tddd�g�}|j�}|jd��}|jd��}|jd��}|jd��}|jd��}d|vsJ�||k(sJ�||k(sJ�||k7sJ�d	|vsJ�d
|vsJ�d|vsJ�||k(sJ�y)Nr�rj�rGrHT)�borderrFz border="1"z border="2"z border="0"z border)rr)r`r��out_border_default�out_border_true�out_border_explicit_default�out_border_nondefault�out_border_zero�out_border_falses        r�test_to_html_borderlessz$TestReadHtml.test_to_html_borderless"s���
�a�a�(�)�
*���Z�Z�\���*�*�D�*�1��&(�j�j��j�&:�#� "�
�
�!�
� 4���*�*�A�*�.���:�:�U�:�3��� 2�2�2�2��"4�4�4�4�!�%@�@�@�@�!�%:�:�:�:�� 5�5�5�5��O�3�3�3�� 0�0�0�0��"2�2�2�2r zdisplayed_only,exp0,exp1�fooNzfoo  bar  baz  quxc��d}|t|�|��}tj|d|�|�tj|d|�yt|�dk(sJ�y)Na<html>
          <body>
            <table>
              <tr>
                <td>
                  foo
                  <span style="display:none;text-align:center">bar</span>
                  <span style="display:none">baz</span>
                  <span style="display: none">qux</span>
                </td>
              </tr>
            </table>
            <table style="display: none">
              <tr>
                <td>foo</td>
              </tr>
            </table>
          </body>
        </html>��displayed_onlyrr�)rr-r.r))r`r	�exp0�exp1rZrr�s       r�test_displayed_onlyz TestReadHtml.test_displayed_only5sY����(�x��~�n�M��
���c�!�f�d�+����!�!�#�a�&�$�/��s�8�q�=� �=r r	c��d}|t|�|��d}tddgddgd��}tj||�y)	NaW
        <table>
            <tr>
                <th>A</th>
                <th>B</th>
            </tr>
            <tr>
                <td>1</td>
                <td>2</td>
            </tr>
            <tr>
                <td><span style="display:none"></span>4</td>
                <td>5</td>
            </tr>
        </table>
        rrr�rkrjr�r�rJ)r`r	rZ�
html_tabler�r�s      r�&test_displayed_only_with_many_elementsz3TestReadHtml.test_displayed_only_with_many_elementsZsM���
� "�(�:�"6�~�V�
�
���A�q�6��A��7�8��
���f�h�/r z\ignore:You provided Unicode markup but also provided a value for from_encoding.*:UserWarningc���tjj|�}tjj|�d}|j	d�\}}	t|d�5}||j
�|d��j�}ddd�t|d�5}|t|j
��|d��j�}	ddd�|||d��j�}
tj	�tj||
�y#1swY��xYw#1swY�[xYw#t$r(t�rd|vsd|vrtj��wxYw)Nr�_�rb)r�rS�16�32)rr�basename�splitext�splitr�r��poprr-r.�	Exceptionr	rC�skip)r`rrZ�	base_path�rootrr��fobj�from_string�from_file_like�
from_filenames           r�test_encodezTestReadHtml.test_encodersE��
�G�G�$�$�%7�8�	��w�w���	�*�1�-���j�j��o���8�	��(�$�/�
�4�.��I�I�K�(�a���#�%��
�
�(�$�/�
�4�!1��D�I�I�K�(�8�q�"��#�%��
�
-�"�X����c�e�
�
�!�!�+�~�>��!�!�+�}�=�
�
��

�
���	�"�$��8�#�t�x�'7��K�K�M��	�s=�D6�#(D�D6�1D*�A
D6�D'�#D6�*D3�/D6�61E'c��|jjd�dk(rtjd�Gd�dt�}|d�}||�sJ�tj
td��5||�ddd�y#1swYyxYw)	NrBrQzNot applicable for lxmlc��eZdZd�Zy)�FTestReadHtml.test_parse_failure_unseekable.<locals>.UnseekableStringIOc��y�NFrcr9s r�seekablezOTestReadHtml.test_parse_failure_unseekable.<locals>.UnseekableStringIO.seekable�s��r N)�__name__�
__module__�__qualname__r'rcr r�UnseekableStringIOr$�s��
r r+z?
            <table><tr><td>spam<foobr />eggs</td></tr></table>z#passed a non-rewindable file objectr=)�keywords�getrCrrrFrM)r`rZr+�bads    r�test_parse_failure_unseekablez*TestReadHtml.test_parse_failure_unseekable�s����$�$�(�(��2�f�<��K�K�1�2�	��	�!�
B�
��
 ��$�$�$�
�]�]�:�-R�
S�	"��S�!�	"�	"�	"�s�0	B�Bc�`�Gd�d�}|d�}|d�}||�sJ�||�sJ�y)Nc�:�eZdZd	d�Zd
d�Zd�Zd�Zd�Zdefd�Z	y)�9TestReadHtml.test_parse_failure_rewinds.<locals>.MockFile�returnNc� �||_d|_yr&)r�at_end)r`rs  r�__init__zBTestReadHtml.test_parse_failure_rewinds.<locals>.MockFile.__init__�s�� ��	�#��r c�H�|jrdn|j}d|_|S)Nr_T)r5r)r`�sizers   rr�z>TestReadHtml.test_parse_failure_rewinds.<locals>.MockFile.read�s��!�[�[�r�d�i�i��"����r c��d|_yr&)r5)r`�offsets  r�seekz>TestReadHtml.test_parse_failure_rewinds.<locals>.MockFile.seek�s	��#��r c��y)NTrcr9s rr'zBTestReadHtml.test_parse_failure_rewinds.<locals>.MockFile.seekable�s��r c��yr#rcr9s r�__next__zBTestReadHtml.test_parse_failure_rewinds.<locals>.MockFile.__next__�s��r c��|Sr#rcr9s r�__iter__zBTestReadHtml.test_parse_failure_rewinds.<locals>.MockFile.__iter__�s	���r )r3Nr#)
r(r)r*r6r�r;r'r>rr@rcr r�MockFiler2�s'��
$�
�

$�
�
�
�(�
r rAz/<table><tr><td>spam<br />eggs</td></tr></table>z2<table><tr><td>spam<foobr />eggs</td></tr></table>rc)r`rZrA�goodr.s     r�test_parse_failure_rewindsz'TestReadHtml.test_parse_failure_rewinds�s@��	�	�2�I�J���K�L����%�%�%���$�$�$r c��Gd�dtj�}|dddd�}|||f��}|||f��}|j�|j�|j�s|j�r#	|j�r�|j�r�#d|jcxur|jusJ�J�y)Nc���eZdZ�fd�Z�xZS)�@TestReadHtml.test_importcheck_thread_safety.<locals>.ErrorThreadc�l��	t�|��d|_y#t$r}||_Yd}~yd}~wwxYwr#)�super�run�errr)r`rJ�	__class__s  �rrIzDTestReadHtml.test_importcheck_thread_safety.<locals>.ErrorThread.run�s5���$��G�K�M� $�D�H��!�#�"�D�H�H��#�s��	3�.�3)r(r)r*rI�
__classcell__)rKs@r�ErrorThreadrF�s
���
$�
$r rMrrr?rR)�targetr2)�	threading�Thread�start�is_aliverJ)r`rrZrMrT�helper_thread1�helper_thread2s       r�test_importcheck_thread_safetyz+TestReadHtml.test_importcheck_thread_safety�s���
	$�)�*�*�	$��D�&�&�2E�F��$�,<�H�;�O��$�,<�H�;�O�����������%�%�'�>�+B�+B�+D���%�%�'�>�+B�+B�+D��~�)�)�?�^�-?�-?�?�?�?�?�?r c��|dddd�}t|�}||�d}||�d}tj||�y)Nrrr?r@r)rr-r.)r`rrZ�file_path_string�	file_pathr�r�s       r�test_parse_path_objectz#TestReadHtml.test_parse_path_object�sM��#�D�&�&�+�F���)�*�	��/�0��3���y�)�!�,��
���c�3�'r c�x�|td��d}tdggdg��}tj||�y)Nz�
            <table>
                <tr>
                    <th>A</th>
                </tr>
                <tr>
                    <td>word1<br>word2</td>
                </tr>
            </table>
        rzword1 word2rGrIrJrKs    r�test_parse_br_as_spacez#TestReadHtml.test_parse_br_as_space�sH��!��	�
�

��

���M�?�"3�c�U�C��
���f�h�/r )r*�bodyr�r`c�n�d}gd�gd�gd�gd�gd�gd�d�}|d	}|d
}|d}|dk(r|d
}|d}|d}n |dk(r|d
}n|dk(r|d}n
|dk(r|d}|t|�|��d}t||g|��}	|	jtj�}	tj||	�y)Na�
          <table>
            <tr>
              <th>HTTP</th>
              <th>FTP</th>
              <th><a href="https://en.wiktionary.org/wiki/linkless">Linkless</a></th>
            </tr>
            <tr>
              <td><a href="https://en.wikipedia.org/">Wikipedia</a></td>
              <td>SURROUNDING <a href="ftp://ftp.us.debian.org/">Debian</a> TEXT</td>
              <td>Linkless</td>
            </tr>
            <tfoot>
              <tr>
                <td><a href="https://en.wikipedia.org/wiki/Page_footer">Footer</a></td>
                <td>
                  Multiple <a href="1">links:</a> <a href="2">Only first captured.</a>
                </td>
              </tr>
            </tfoot>
          </table>
          )�HTTP�FTP�Linkless))r^N)r_N)r`z'https://en.wiktionary.org/wiki/linkless)�	Wikipedia�SURROUNDING Debian TEXTr`))razhttps://en.wikipedia.org/)rbzftp://ftp.us.debian.org/)r`N)�Footer�$Multiple links: Only first captured.N))rcz)https://en.wikipedia.org/wiki/Page_footer)rd�1N)�head_ignore�head_extract�body_ignore�body_extract�
footer_ignore�footer_extractrhrjrfr*rirkrgr\r`r���
extract_linksrrp)rr�fillnarur�r-r.)
r`r�rZ�
gh_13141_data�gh_13141_expected�data_exp�foot_exp�head_expr�r�s
          r�test_extract_linkszTestReadHtml.test_extract_links�s����
�07��
P��
�
�%
��2%�]�3��$�_�5��$�]�3���%�<�(��8�H�(�)9�:�H�(��8�H�
�F�]�(��8�H�
�H�_�(�)9�:�H�
�H�_�(��8�H�!�(�=�"9��M�a�P���h��1�8�D���?�?�2�6�6�*��
���f�h�/r c��d}tjt|��5t|d��ddd�y#1swYyxYw)NzY`extract_links` must be one of {None, "header", "footer", "body", "all"}, got "incorrect"r=�	incorrectrl�rCrFrMr)r`rer4s   r�test_extract_links_badz#TestReadHtml.test_extract_links_badCs<��
I�	��]�]�:�S�
1�	<��i�{�;�	<�	<�	<�rc�z�d}|t|�d��d}tdgg�}tj||�y)Nz�
        <table>
          <tr>
            <td>
              <a href='https://google.com'>Google.com</a>
            </td>
          </tr>
        </table>
        r*rlr)z
Google.comzhttps://google.comrJ�r`rZrr�r�s     r� test_extract_links_all_no_headerz-TestReadHtml.test_extract_links_all_no_headerKsA����"�(�4�.��F�q�I���C�D�E�F��
���f�h�/r c��d}tjt|��5tdd��ddd�y#1swYyxYw)NzPdtype_backend numpy is invalid, only 'numpy_nullable' and 'pyarrow' are allowed.r=�test�numpyr�rw)r`r4s  r�test_invalid_dtype_backendz'TestReadHtml.test_invalid_dtype_backendZs;��
%�	��]�]�:�S�
1�	5��f�G�4�	5�	5�	5�rc��d}|t|��d}tddgddggddg�	�}tj||�y)
Na�
        <table>
            <tr>
                <th>
                    <style>.style</style>
                    A
                    </th>
                <th>B</th>
            </tr>
            <tr>
                <td>A1</td>
                <td>B1</td>
            </tr>
            <tr>
                <td>A2</td>
                <td>B2</td>
            </tr>
        </table>
        r�A1�B1�A2�B2rGrHrIrJrzs     r�test_style_tagzTestReadHtml.test_style_tagbsK����&"�(�4�.�1�!�4���D�$�<�$���">��c�
�S��
���f�h�/r )dr(r)r*rarC�fixturererhr�r��mark�network�
single_cpur�r��slowr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr
rrrrr#r%r'r*r-r/r4r7r:r=rCrErLrQrYrfrlr�r�r�r�r�r�r�r�r�r�r�r�r�r�r��parametrizer�r�r�r�r�r�r�r�r�r�rrrr�filterwarningsr!r/rCrUrYr[rtrxr{rr�rcr rr\r\psp���@�^�^�;��;��^�^�?��?�
'�:0�x�[�[����[�[���)���)� �[�[����[�[���)���)��[�[���)��)�/�-�
-�
�
)�)�)�)�)�)�)�)�L�)�
)�
)�
)�	)�)�)��[�[����[�[���D���D�
�[�[����[�[����[�[���@����@�
�[�[���-��-��[�[�������[�[���2��2��[�[���0��0��[�[���	0��	0��[�[���2��2��[�[���2��2��[�[���
2��
2��[�[���	-��	-�D�
�^�^�.��.�`�[�[����[�[�������
�[�[����[�[���.���.� �60�@0�40�@$2�L0�2�[�[���-0��-0�^�[�[���	$��	$�F0�P0�2!0�F0�@0�:0�*0�8*�-�>�X�3�20�:�[�[���U�T�5�M�2�4�3�4�0�60�64�20�40�.4�-��[�[���X��X�
&�3�&�[�[���"�
�9�e�W�%�t�,�
�I�3�4�5�y�%��7I�J�	
��!��!�<�[�[���-��e�}�=�0�>�0�.�[�[���	&���	��8"�( %�D�[�[����[�[���@���@�.(�0�*�[�[���U�$G�H�B0�I�B0�H<�
0�5�0r r\)4�collections.abcr�	functoolsrrrrr�pathlibrr2rO�urllib.errorrr~rurC�
pandas.compatr	�pandas.util._test_decorators�util�_test_decorators�td�pandasrxr
rrr
rrrrr�pandas._testing�_testingr-�pandas.core.arraysrr�pandas.io.commonrr�rr8rIrOrWr�
skip_if_norZr\rcr r�<module>r�s��$���
��	��!��
�-�)�)��
�
�
���
.�������B��B�
:�(M�@�.���������U�=�2�=�=��#7�����z�9R�"S�T�����V�=�2�=�=��#8�9���4�
�4�I0�I0r 

Youez - 2016 - github.com/yon3zu
LinuXploit