Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/io/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/io/__pycache__/html.cpython-312.pyc

�

Mٜgz�����dZddlmZddlmZddlZddlZddlmZddlm	Z	m
Z
mZddlZddl
mZddlmZdd	lmZmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddl m!Z!ddl"m#Z#ddl$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/ddl0m1Z1e	rddl2m3Z3m4Z4ddl5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;ddlm<Z<ejzd�Z>e>fd6d�Z?d7d�Z@								d8d�ZAGd�d�ZBGd �d!eB�ZCd9d"�ZDd#d$iZEGd%�d&eB�ZFd:d'�ZGd(�ZHeFeFeCeCd)�ZId;d*�ZJd9d+�ZKd,�ZLd-�ZMee%d�.�d/dddddd0d1dd2ddd3d3dej�dd4�																																					d<d5��ZOy)=zW
:mod:`pandas.io.html` is a module containing functionality for dealing with
HTML IO.

�)�annotations)�abcN)�Pattern)�
TYPE_CHECKING�Literal�cast)�lib)�import_optional_dependency)�AbstractMethodError�EmptyDataError)�doc)�find_stack_level)�check_dtype_backend)�is_list_like��isna)�Index)�
MultiIndex)�Series)�_shared_docs)�file_exists�
get_handle�is_file_like�
is_fsspec_url�is_url�stringify_path�validate_header_arg)�pprint_thing)�
TextParser)�Iterable�Sequence)�
BaseBuffer�DtypeBackend�FilePath�HTMLFlavors�
ReadBuffer�StorageOptions)�	DataFramez[\r\n]+|\s{2,}c�B�|jd|j��S)a�
    Replace extra whitespace inside of a string with a single space.

    Parameters
    ----------
    s : str or unicode
        The string from which to remove extra whitespace.
    regex : re.Pattern
        The regular expression to use to remove extra whitespace.

    Returns
    -------
    subd : str or unicode
        `s` with all extra whitespace replaced with a single space.
    � )�sub�strip)�s�regexs  �9/usr/local/lib/python3.12/site-packages/pandas/io/html.py�_remove_whitespacer0Is�� �9�9�S�!�'�'�)�$�$�c�L�t|t�r@|jxsd|jxsd}}t	t||j|��St|tj�st|�rtd|�S|�ytt|�j�d���)a�
    Get an iterator given an integer, slice or container.

    Parameters
    ----------
    skiprows : int, slice, container
        The iterator to use to skip rows; can also be a slice.

    Raises
    ------
    TypeError
        * If `skiprows` is not a slice, integer, or Container

    Returns
    -------
    it : iterable
        A proper iterator to use to skip rows of a DataFrame.
    r��int | Sequence[int]z& is not a valid type for skipping rows)�
isinstance�slice�start�step�list�range�stop�numbers�Integralrr�	TypeError�type�__name__)�skiprowsr7r8s   r/�
_get_skiprowsrB\s���&�(�E�"��n�n�)��8�=�=�+=�A�t���E�%�����5�6�6�	�H�g�.�.�	/�<��3I��)�8�4�4�	�	��
�t�H�~�.�.�/�/U�V�
W�Wr1�storage_optionsc�`�t|�s't|d�st|t�r?t	|�r4t|d||��5}|jj�}ddd�|St|ttf�r|}|Stdt|�j�d���#1swYSxYw)z�
    Try to read from a url, file or string.

    Parameters
    ----------
    obj : str, unicode, path object, or file-like object

    Returns
    -------
    raw_text : str
    �read�r)�encodingrCNzCannot read object of type '�')r�hasattrr5�strrr�handlerE�bytesr>r?r@)�objrGrC�handles�texts     r/�_readrPys���$	�s���3����s�C� �[��%5�
���x��
�
��>�>�&�&�(�D�
��K�	
�C�#�u��	&����K��6�t�C�y�7I�7I�6J�!�L�M�M�
��K�s�B#�#B-c��eZdZdZ	d															dd�Zd�Zd�Zdd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
dd
�Zd�Zd�Z		dd�Zdd�Zy)�_HtmlFrameParseraZ
    Base class for parsers that parse HTML into DataFrames.

    Parameters
    ----------
    io : str or file-like
        This can be either a string of raw HTML, a valid URL using the HTTP,
        FTP, or FILE protocols or a file-like object.

    match : str or regex
        The text to match in the document.

    attrs : dict
        List of HTML <table> element attributes to match.

    encoding : str
        Encoding to be used by parser

    displayed_only : bool
        Whether or not items with "display:none" should be ignored

    extract_links : {None, "all", "header", "body", "footer"}
        Table elements in the specified section(s) with <a> tags will have their
        href extracted.

        .. versionadded:: 1.5.0

    Attributes
    ----------
    io : str or file-like
        raw HTML, URL, or file-like object

    match : regex
        The text to match in the raw HTML

    attrs : dict-like
        A dictionary of valid table attributes to use to search for table
        elements.

    encoding : str
        Encoding to be used by parser

    displayed_only : bool
        Whether or not items with "display:none" should be ignored

    extract_links : {None, "all", "header", "body", "footer"}
        Table elements in the specified section(s) with <a> tags will have their
        href extracted.

        .. versionadded:: 1.5.0

    Notes
    -----
    To subclass this class effectively you must override the following methods:
        * :func:`_build_doc`
        * :func:`_attr_getter`
        * :func:`_href_getter`
        * :func:`_text_getter`
        * :func:`_parse_td`
        * :func:`_parse_thead_tr`
        * :func:`_parse_tbody_tr`
        * :func:`_parse_tfoot_tr`
        * :func:`_parse_tables`
        * :func:`_equals_tag`
    See each method's respective documentation for details on their
    functionality.
    Nc�f�||_||_||_||_||_||_||_y�N)�io�match�attrsrG�displayed_only�
extract_linksrC)�selfrUrVrWrGrXrYrCs        r/�__init__z_HtmlFrameParser.__init__�s8�������
���
� ��
�,���*���.��r1c����j�j��j�j�}�fd�|D�S)z�
        Parse and return all tables from the DOM.

        Returns
        -------
        list of parsed (header, body, footer) tuples from tables.
        c3�@�K�|]}�j|����y�wrT)�_parse_thead_tbody_tfoot)�.0�tablerZs  �r/�	<genexpr>z0_HtmlFrameParser.parse_tables.<locals>.<genexpr>�s�����I�&���-�-�e�4�&�s�)�
_parse_tables�
_build_docrVrW)rZ�tabless` r/�parse_tablesz_HtmlFrameParser.parse_tables�s3����#�#�D�O�O�$5�t�z�z�4�:�:�N��I�&�I�Ir1c�$�|j|�S)aC
        Return the attribute value of an individual DOM node.

        Parameters
        ----------
        obj : node-like
            A DOM node.

        attr : str or unicode
            The attribute, such as "colspan"

        Returns
        -------
        str or unicode
            The attribute value.
        )�get)rZrM�attrs   r/�_attr_getterz_HtmlFrameParser._attr_getter�s��$�w�w�t�}�r1c��t|��)a
        Return a href if the DOM node contains a child <a> or None.

        Parameters
        ----------
        obj : node-like
            A DOM node.

        Returns
        -------
        href : str or unicode
            The href from the <a> child of the DOM node.
        �r�rZrMs  r/�_href_getterz_HtmlFrameParser._href_getter���"�$�'�'r1c��t|��)a
        Return the text of an individual DOM node.

        Parameters
        ----------
        obj : node-like
            A DOM node.

        Returns
        -------
        text : str or unicode
            The text from an individual DOM node.
        rkrls  r/�_text_getterz_HtmlFrameParser._text_getter rnr1c��t|��)a
        Return the td elements from a row element.

        Parameters
        ----------
        obj : node-like
            A DOM <tr> node.

        Returns
        -------
        list of node-like
            These are the elements of each row, i.e., the columns.
        rkrls  r/�	_parse_tdz_HtmlFrameParser._parse_td0rnr1c��t|��)a;
        Return the list of thead row elements from the parsed table element.

        Parameters
        ----------
        table : a table element that contains zero or more thead elements.

        Returns
        -------
        list of node-like
            These are the <tr> row elements of a table.
        rk�rZr`s  r/�_parse_thead_trz _HtmlFrameParser._parse_thead_tr@���"�$�'�'r1c��t|��)a�
        Return the list of tbody row elements from the parsed table element.

        HTML5 table bodies consist of either 0 or more <tbody> elements (which
        only contain <tr> elements) or 0 or more <tr> elements. This method
        checks for both structures.

        Parameters
        ----------
        table : a table element that contains row elements.

        Returns
        -------
        list of node-like
            These are the <tr> row elements of a table.
        rkrts  r/�_parse_tbody_trz _HtmlFrameParser._parse_tbody_trO���""�$�'�'r1c��t|��)a,
        Return the list of tfoot row elements from the parsed table element.

        Parameters
        ----------
        table : a table element that contains row elements.

        Returns
        -------
        list of node-like
            These are the <tr> row elements of a table.
        rkrts  r/�_parse_tfoot_trz _HtmlFrameParser._parse_tfoot_trbrvr1c��t|��)ai
        Return all tables from the parsed DOM.

        Parameters
        ----------
        document : the DOM from which to parse the table element.

        match : str or regular expression
            The text to search for in the DOM tree.

        attrs : dict
            A dictionary of table attributes that can be used to disambiguate
            multiple tables on a page.

        Raises
        ------
        ValueError : `match` does not match any text in the document.

        Returns
        -------
        list of node-like
            HTML <table> elements to be parsed into raw data.
        rk)rZ�documentrVrWs    r/rbz_HtmlFrameParser._parse_tablesqs��0"�$�'�'r1c��t|��)a?
        Return whether an individual DOM node matches a tag

        Parameters
        ----------
        obj : node-like
            A DOM node.

        tag : str
            Tag name to be checked for equality.

        Returns
        -------
        boolean
            Whether `obj`'s tag name is `tag`
        rk�rZrM�tags   r/�_equals_tagz_HtmlFrameParser._equals_tag�ryr1c��t|��)z�
        Return a tree-like object that can be used to iterate over the DOM.

        Returns
        -------
        node-like
            The DOM from which to parse the table element.
        rk)rZs r/rcz_HtmlFrameParser._build_doc�s��"�$�'�'r1c�j���j|�}�j|�}�j|�}�fd�}|s;|r9||d�r.|j|j	d��|r||d�r�.�j|d��}�j|d��}�j|d��}|||fS)a

        Given a table, return parsed header, body, and foot.

        Parameters
        ----------
        table_html : node-like

        Returns
        -------
        tuple of (header, body, footer), each a list of list-of-text rows.

        Notes
        -----
        Header and body are lists-of-lists. Top level list is a list of
        rows. Each row is a list of str text.

        Logic: Use <thead>, <tbody>, <tfoot> elements to identify
               header, body, and footer, otherwise:
               - Put all rows into body
               - Move rows from top of body to header only if
                 all elements inside row are <th>
               - Move rows from bottom of body to footer only if
                 all elements inside row are <th>
        c�J��t�fd��j|�D��S)Nc3�B�K�|]}�j|d����y�w)�thN)r�)r_�trZs  �r/razS_HtmlFrameParser._parse_thead_tbody_tfoot.<locals>.row_is_all_th.<locals>.<genexpr>�s!�����N�:M�Q�t�'�'��4�0�:M�s�)�allrr)�rowrZs �r/�
row_is_all_thz@_HtmlFrameParser._parse_thead_tbody_tfoot.<locals>.row_is_all_th�s����N�$�.�.��:M�N�N�Nr1r�header)�section�body�footer)rurxr{�append�pop�_expand_colspan_rowspan)	rZ�
table_html�header_rows�	body_rows�footer_rowsr�r�r�r�s	`        r/r^z)_HtmlFrameParser._parse_thead_tbody_tfoot�s����2�*�*�:�6���(�(��4�	��*�*�:�6��	O���
�i��l� ;��"�"�9�=�=��#3�4��
�i��l� ;��-�-�k�8�-�L���+�+�I�v�+�F���-�-�k�8�-�L���t�V�#�#r1c	���g}g}|D�]�}g}g}d}|j|�}	|	D�]$}
|r`|dd|krU|jd�\}}}
|j|�|
dkDr|j|||
dz
f�|dz
}|r|dd|kr�Ut|j	|
��}|j
d|fvr|j
|
�}||f}t|j|
d�xsd�}t|j|
d�xsd�}t|�D]4}|j|�|dkDr|j|||dz
f�|dz
}�6��'|D]4\}}}
|j|�|
dkDs�|j|||
dz
f��6|j|�|}���|rSg}g}|D]4\}}}
|j|�|
dkDs�|j|||
dz
f��6|j|�|}|r�S|S)a*
        Given a list of <tr>s, return a list of text rows.

        Parameters
        ----------
        rows : list of node-like
            List of <tr>s
        section : the section that the rows belong to (header, body or footer).

        Returns
        -------
        list of list
            Each returned row is a list of str text, or tuple (text, link)
            if extract_links is not None.

        Notes
        -----
        Any cell with ``rowspan`` or ``colspan`` will have its contents copied
        to subsequent cells.
        rr3r��rowspan�colspan)
rrr�r�r0rprYrm�intrir:)rZ�rowsr��	all_texts�	remainder�tr�texts�next_remainder�index�tds�td�prev_i�	prev_text�prev_rowspanrO�hrefr�r��_s                   r/r�z(_HtmlFrameParser._expand_colspan_rowspan�sA��.�	�
�	��B��E��N��E��.�.��$�C��� �I�a�L��O�u�$<�6?�m�m�A�6F�3�F�I�|��L�L��+�#�a�'�&�-�-�v�y�,�QR�BR�.S�T��Q�J�E� �I�a�L��O�u�$<�*�$�*;�*;�B�*?�@���%�%�%��)9�9��,�,�R�0�D� �$�<�D��d�/�/��I�>�C�!�D���d�/�/��I�>�C�!�D���w��A��L�L��&���{�&�-�-�u�d�G�a�K�.H�I��Q�J�E�	(�%�24=�/��	�<����Y�'��!�#�"�)�)�6�9�l�Q�>N�*O�P�4=�

���U�#�&�I�K�R��N��E�3<�/��	�<����Y�'��!�#�"�)�)�6�9�l�Q�>N�*O�P�4=�
���U�#�&�I���r1c��|js|S|D�cgc]2}dt||�jdd�jdd�vr|��4c}Scc}w)a�
        Return list of tables, potentially removing hidden elements

        Parameters
        ----------
        tbl_list : list of node-like
            Type of list elements will vary depending upon parser used
        attr_name : str
            Name of the accessor for retrieving HTML attributes

        Returns
        -------
        list of node-like
            Return type matches `tbl_list`
        �display:none�style�r*)rX�getattrrg�replace)rZ�tbl_list�	attr_name�xs    r/�_handle_hidden_tablesz&_HtmlFrameParser._handle_hidden_tables(sf�� �"�"��O��
�����1�i�(�,�,�W�b�9�A�A�#�r�J�K�
��
�	
��
s�7A
rT)rUz.FilePath | ReadBuffer[str] | ReadBuffer[bytes]rV�
str | PatternrW�dict[str, str] | NonerGrJrX�boolrY�0Literal[None, 'header', 'footer', 'body', 'all']rCr'�return�None�r��
str | None�r�r�)r�z#Literal['header', 'footer', 'body'])r�rJ)r@�
__module__�__qualname__�__doc__r[rerirmrprrrurxr{rbr�rcr^r�r��r1r/rRrR�s���B�X+/�/�:�/��/�%�	/�
�/��
/�H�/�(�/�
�/�$	J��((� (� (� 
(�(�&
(�(�4(�&	(�+$�ZP�@�P�d
r1rRc�P�eZdZdZd�Zd
d�Zd�Zdd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
y)�!_BeautifulSoupHtml5LibFrameParsera/
    HTML to DataFrame parser that uses BeautifulSoup under the hood.

    See Also
    --------
    pandas.io.html._HtmlFrameParser
    pandas.io.html._LxmlFrameParser

    Notes
    -----
    Documentation strings for this class are in the base class
    :class:`pandas.io.html._HtmlFrameParser`.
    c�"�d}|j||��}|std��g}t�}|j|d�}|D]�}|jr`|jd�D]}	|	j��|jt
jd���D]}	|	j��||vr#|j|���|j|�|j|���|s!td	t|j�����|S)
Nr`)rWzNo tables foundrWr�zdisplay:\s*none)r�)�stringz!No tables found matching pattern )
�find_all�
ValueError�setr�rX�	decompose�re�compile�findr��add�repr�pattern)
rZr}rVrW�element_namerd�result�
unique_tablesr`�elems
          r/rbz/_BeautifulSoupHtml5LibFrameParser._parse_tablesRs�����"�"�<�u�"�=����.�/�/�����
��+�+�F�G�<���E��"�"�!�N�N�7�3�D��N�N�$�4�"�N�N����<N�1O�N�P�D��N�N�$�Q��M�)�e�j�j��j�.F�.R��
�
�e�$����e�$����@��e�m�m�AT�@U�V�W�W��
r1c�:�|jdd��}|sdS|dS)N�aT)r�r�)r�)rZrMr�s   r/rmz._BeautifulSoupHtml5LibFrameParser._href_getterks%���H�H�S�t�H�$���t�+�!�F�)�+r1c��|jSrT)rOrls  r/rpz._BeautifulSoupHtml5LibFrameParser._text_getteros���x�x�r1c� �|j|k(SrT)�namers   r/r�z-_BeautifulSoupHtml5LibFrameParser._equals_tagrs���x�x�3��r1c�(�|jdd��S)N)r�r�F��	recursive)r��rZr�s  r/rrz+_BeautifulSoupHtml5LibFrameParser._parse_tdus���|�|�L�E�|�:�:r1c�$�|jd�S)Nzthead tr��selectrts  r/ruz1_BeautifulSoupHtml5LibFrameParser._parse_thead_trx����|�|�J�'�'r1c�T�|jd�}|jdd��}||zS)Nztbody trr�Fr�)r�r��rZr`�
from_tbody�	from_roots    r/rxz1_BeautifulSoupHtml5LibFrameParser._parse_tbody_tr{s-���\�\�*�-�
��N�N�4�5�N�9�	��I�%�%r1c�$�|jd�S)Nztfoot trr�rts  r/r{z1_BeautifulSoupHtml5LibFrameParser._parse_tfoot_tr�r�r1c��t|j|j|j�}|st	d|j����|S)NzNo text parsed from document: )rPrUrGrCr�)rZ�raw_texts  r/�_setup_build_docz2_BeautifulSoupHtml5LibFrameParser._setup_build_doc�s=������$�-�-��1E�1E�F����=�d�g�g�Y�G�H�H��r1c�@�ddlm}|j�}t|t�r*|j
�|j
|j
�}d}n|}|j
}||d|��}|jd�D] }|jd|jz��"|S)Nr)�
BeautifulSoup�html5lib)�features�
from_encoding�br�
)
�bs4r�r�r5rLrG�decoder��replace_withrO)rZr��bdoc�udocr��soupr�s       r/rcz,_BeautifulSoupHtml5LibFrameParser._build_doc�s���%��$�$�&���d�E�"�t�}�}�'@��;�;�t�}�}�-�D� �M��D� �M�M�M��T�J�m�T���-�-��%�B��O�O�D�2�7�7�N�+�&��r1Nr�r�)r@r�r�r�rbrmrpr�rrrurxr{r�rcr�r1r/r�r�Cs9����2,���;�(�&�(��r1r�c���d|vr|jd�|d<dj|j�D��cgc]\}}d|�dt|�����c}}�}d|�d�Scc}}w)ar
    Build an xpath expression to simulate bs4's ability to pass in kwargs to
    search for attributes when using the lxml parser.

    Parameters
    ----------
    attrs : dict
        A dict of HTML attributes. These are NOT checked for validity.

    Returns
    -------
    expr : unicode
        An XPath expression that checks for the given HTML attributes.
    �class_�classz and �@�=�[�])r��join�itemsr�)rW�k�vr-s    r/�_build_xpath_exprr��si�� �5�����8�,��g�����E�K�K�M�B�M�D�A�q��!��A�d�1�g�Y�'�M�B�C�A�
�q�c��8�O��Cs�A 
r�z$http://exslt.org/regular-expressionsc�J�eZdZdZdd�Zd�Zd�Zd�Zd
d�Zd�Z	d�Z
d	�Zd
�Zy)�_LxmlFrameParseraY
    HTML to DataFrame parser that uses lxml under the hood.

    Warning
    -------
    This parser can only handle HTTP, FTP, and FILE urls.

    See Also
    --------
    _HtmlFrameParser
    _BeautifulSoupLxmlFrameParser

    Notes
    -----
    Documentation strings for this class are in the base class
    :class:`_HtmlFrameParser`.
    c�6�|jd�}|sdS|dS)Nz
.//a/@hrefr��xpath)rZrMr�s   r/rmz_LxmlFrameParser._href_getter�s!���y�y��&���t�,�T�!�W�,r1c�"�|j�SrT)�text_contentrls  r/rpz_LxmlFrameParser._text_getter�s�����!�!r1c�$�|jd�S)N�	./td|./thrr�s  r/rrz_LxmlFrameParser._parse_td�s���y�y��%�%r1c��|j}dt|��d�}|r|t|�z
}|j|t��}|j|d�}|jr�|D]}}|jd�D]}|j��|jd�D]A}d|jjdd	�jd
d	�vs�2|j��C�|stdt|�����|S)Nz//table[.//text()[re:test(., z)]])�
namespaces�attribz.//stylez.//*[@style]r�r�r�r*zNo tables found matching regex )r�r�r�r�
_re_namespacer�rX�	drop_treer
rgr�r�)	rZr}rV�kwargsr��
xpath_exprrdr`r�s	         r/rbz_LxmlFrameParser._parse_tables�s����-�-��5�T�'�]�O�3�G�
���+�F�3�3�J����
�}��E���+�+�F�H�=�������"�K�K�
�3�D��N�N�$�4�!�K�K��7�D�%�������"�)E�)M�)M�c�SU�)V�V����(�8�
 ���>�t�G�}�o�N�O�O��
r1c� �|j|k(SrT)r�rs   r/r�z_LxmlFrameParser._equals_tag�s���w�w�#�~�r1c���ddlm}ddlm}m}m}|d|j��}	t|j�r@t|jd|j��5}||j|��}d	d	d	�n||j|��}	j�}td
�s|dddd��|j#d�D]}	d
|	j$xsdz|	_�|S#1swY�axYw#t$rY�^wxYw#tt f$rV}t|j�s5||j|��}	|j�}n#t$rYnwxYw|�Yd	}~��d	}~wwxYw)a�
        Raises
        ------
        ValueError
            * If a URL that lxml cannot parse is passed.

        Exception
            * Any other ``Exception`` thrown. For example, trying to parse a
              URL that is syntactically correct on a machine with no internet
              connection will fail.

        See Also
        --------
        pandas.io.html._HtmlFrameParser._build_doc
        r)�XMLSyntaxError)�
HTMLParser�
fromstring�parseT)�recoverrGrF�rC)�parserNrzno text parsed from documentz*//brr�r�)�
lxml.etreer�	lxml.htmlrrrrGrrUrrCrK�getroot�AttributeErrorrI�UnicodeDecodeError�OSErrorr�tail)
rZrrrrr�frF�er�s
          r/rcz_LxmlFrameParser._build_doc�sO�� 	.�	
�	
��D�4�=�=�A��	N��d�g�g����G�G�S�$�2F�2F����a�h�h�v�6�A����$�'�'�&�1��
��I�I�K���1�n�-�$�%C�Q��1�M�M��'�'�'�"�B��b�g�g�m��,�B�G�#���;���"�
��
��"�G�,�
	��$�'�'�?��t�w�w�v�6����	�	��A��%���������
	�sq�7D�C'�2D�C3�'C0�,D�3	C?�<D�>C?�?D�E'�)E"�;E�E"�	E�E"�E�E"�"E'c��g}|jd�D]G}|j|jd��|jd�}|s�7|j|��I|S)Nz.//thead�./trr)r�extendr�)rZr`r��thead�elements_at_roots     r/ruz _LxmlFrameParser._parse_thead_tr0sV�����[�[��,�E��K�K����F�+�,� %�{�{�;�7������E�"�-��r1c�P�|jd�}|jd�}||zS)Nz.//tbody//trr"rr�s    r/rxz _LxmlFrameParser._parse_tbody_trBs)���[�[��0�
��K�K��'�	��I�%�%r1c�$�|jd�S)Nz.//tfoot//trrrts  r/r{z _LxmlFrameParser._parse_tfoot_trHs���{�{�>�*�*r1Nr�r�)
r@r�r�r�rmrprrrbr�rcrurxr{r�r1r/rr�s5���$-�"�&�
�:�8�t�$&�+r1rc���|D�cgc]
}t|���}}t|�}|j�}|||k7}dg}|j�D]\}}||xx|||z
zz
cc<�ycc}w)Nr�)�lenr�maxr�)	r�r��data�lens�lens_max�not_max�empty�ind�lengths	         r/�_expand_elementsr2Lsu��"&�'�$�$�C��I�$�D�'��$�<�D��x�x�z�H��4�8�#�$�G�
�D�E��}�}����V��S�	�U�h��/�0�0�	�'��
(s�A+c��|jd�\}}}|jd�}t|d�|d<|rH||z}|�At|�dk(rd}n0t|�D��cgc]\}}t	d�|D��s�|��}}}|r||z
}t|�t
|fd|i|��5}|j�cddd�Scc}}w#1swYyxYw)Nr+r�rAr3rc3� K�|]}|���y�wrTr�)r_rOs  r/raz!_data_to_frame.<locals>.<genexpr>ds����@V�RU�$��RU�s�)r�rBr)�	enumerate�anyr2rrE)r
�headr��footr��ir��tps        r/�_data_to_framer;Ws����z�z�&�)��D�$��
�Z�Z��
!�F�&�v�j�'9�:�F�:����d�{���>��4�y�A�~���+4�D�/�W�/���3�S�@V�RU�@V�=V�!�/��W�������T��	�D�	2��	2�6�	2�b��w�w�y�
3�	2��X�
3�	2�s� B<�;B<�"C�C)�lxmlNr�r�c���ttj��}||vrtt	|��d|����|dvrtd�td�t|Std�t|S)a�
    Choose the parser based on the input flavor.

    Parameters
    ----------
    flavor : {{"lxml", "html5lib", "bs4"}} or None
        The type of parser to use. This must be a valid backend.

    Returns
    -------
    cls : _HtmlFrameParser subclass
        The parser class based on the requested input flavor.

    Raises
    ------
    ValueError
        * If `flavor` is not a valid backend.
    ImportError
        * If you do not have the requested `flavor`
    z* is not a valid flavor, valid flavors are )r�r�r�r�z
lxml.etree)r9�_valid_parsers�keysr�r�r
)�flavor�
valid_parserss  r/�_parser_dispatchrBws|��*��,�,�.�/�M�
�]�"���F�|�n�F�}�o�V�
�	
��$�$�"�:�.�"�5�)��&�!�!�	#�<�0��&�!�!r1c�h�dj|D�cgc]
}t|���c}�}d|�d�Scc}w)Nz, �{�})r�r)r-�el�args   r/�
_print_as_setrH�s7��
�)�)��2��"�\�"�%��2�
3�C�
��u�B�<���3s�/c���|�d}n�t|t�r|f}n�t|tj�r=t	d�|D��satdt
t|�j��d���t|t�rt
|�n
t|�}|dz
}t|��t|�}tt�}t|�}||zs"tt|��dt|�����|S)N)r<r�c3�<K�|]}t|t����y�wrT)r5rJ)r_�flavs  r/raz#_validate_flavor.<locals>.<genexpr>�s����<�V�T�:�d�C�(�V�s�zObject of type z is not an iterable of stringsz is not a valid flavorz2 is not a valid set of flavors, valid flavors are )r5rJrr r�r>r�r?r@r��tupler�r>rH)r@�msg�
valid_flavors�
flavor_sets    r/�_validate_flavorrP�s���
�~���	�F�C�	 ����	�F�C�L�L�	)��<�V�<�<��!�$�t�F�|�'<�'<�"=�!>�?0�1��
�
)���5�d�6�l�3�v�;���'�'����o��
�6�]�F���'�M��V��J��
�%���Z�(�)�*�(��7�8�
:�
�	
��Mr1c
��t|�}tj|�}	d}
|D]-}t|�}|||	|||||�}
	|
j	�}n|
�J�|
�g}|D]b}	td
d|i|��}|dvr=t|jt�r#td�|jD�d�	�|_|j|��d|S#t
$rg}t
|d�r"|j�r|jd�n,t
|d�r |j�std|�d��|�|}
Yd}~��d}~wwxYw#t$rY��wxYw)N�seekablerzThe flavor z� failed to parse your input. Since you passed a non-rewindable file object, we can't rewind it to try another parser. Try read_html() with a different flavor.r+)r�r�c3�PK�|]}|dt|d�rdn|df��� y�w)rr3Nr)r_�cols  r/raz_parse.<locals>.<genexpr>�s*����V�:�C�c�!�f�d�3�q�6�l�d��A��?�:�s�$&F)�
tupleize_colsr�)rPr�r�rBrer�rIrR�seekr;r5�columnsrrr�r)r@rUrVrWrGrXrYrCr
�compiled_match�retainedrKr�prd�caught�retr`�dfs                   r/�_parser^�st���f�
%�F��Z�Z��&�N��H���!�$�'����������
��	��^�^�%�F�"
�=�@�#�#�#���
�C���	��5�U�5�f�5�B�� 1�1�j��
�
�J�7�#�V�2�:�:�V�"'���
�

�J�J�r�N��"�J��O�	��r�:�&�2�;�;�=�����
���Z�(����� �!�$��(O�O��
���H��	��J�	��	�s,�C�#AD9�	D6�AD1�1D6�9	E�Erz.+F�,�.T)rVr@r��	index_colrArW�parse_dates�	thousandsrG�decimal�
converters�	na_values�keep_default_narXrY�
dtype_backendrCc�
�t|tj�r|dkrtd��|dvrtd|�d���t	|�t|�t
|�}t|t�rWtt|�t|�t|�t|�g�s$tjdtt!���t#did|�d	|�d
|�d|�d|�d
|�d|�d|�d|�d|	�d|
�d|�d|�d|
�d|�d|�d|�d|��S)a�
    Read HTML tables into a ``list`` of ``DataFrame`` objects.

    Parameters
    ----------
    io : str, path object, or file-like object
        String, path object (implementing ``os.PathLike[str]``), or file-like
        object implementing a string ``read()`` function.
        The string can represent a URL or the HTML itself. Note that
        lxml only accepts the http, ftp and file url protocols. If you have a
        URL that starts with ``'https'`` you might try removing the ``'s'``.

        .. deprecated:: 2.1.0
            Passing html literal strings is deprecated.
            Wrap literal string/bytes input in ``io.StringIO``/``io.BytesIO`` instead.

    match : str or compiled regular expression, optional
        The set of tables containing text matching this regex or string will be
        returned. Unless the HTML is extremely simple you will probably need to
        pass a non-empty string here. Defaults to '.+' (match any non-empty
        string). The default value will return all tables contained on a page.
        This value is converted to a regular expression so that there is
        consistent behavior between Beautiful Soup and lxml.

    flavor : {{"lxml", "html5lib", "bs4"}} or list-like, optional
        The parsing engine (or list of parsing engines) to use. 'bs4' and
        'html5lib' are synonymous with each other, they are both there for
        backwards compatibility. The default of ``None`` tries to use ``lxml``
        to parse and if that fails it falls back on ``bs4`` + ``html5lib``.

    header : int or list-like, optional
        The row (or list of rows for a :class:`~pandas.MultiIndex`) to use to
        make the columns headers.

    index_col : int or list-like, optional
        The column (or list of columns) to use to create the index.

    skiprows : int, list-like or slice, optional
        Number of rows to skip after parsing the column integer. 0-based. If a
        sequence of integers or a slice is given, will skip the rows indexed by
        that sequence.  Note that a single element sequence means 'skip the nth
        row' whereas an integer means 'skip n rows'.

    attrs : dict, optional
        This is a dictionary of attributes that you can pass to use to identify
        the table in the HTML. These are not checked for validity before being
        passed to lxml or Beautiful Soup. However, these attributes must be
        valid HTML table attributes to work correctly. For example, ::

            attrs = {{'id': 'table'}}

        is a valid attribute dictionary because the 'id' HTML tag attribute is
        a valid HTML attribute for *any* HTML tag as per `this document
        <https://html.spec.whatwg.org/multipage/dom.html#global-attributes>`__. ::

            attrs = {{'asdf': 'table'}}

        is *not* a valid attribute dictionary because 'asdf' is not a valid
        HTML attribute even if it is a valid XML attribute.  Valid HTML 4.01
        table attributes can be found `here
        <http://www.w3.org/TR/REC-html40/struct/tables.html#h-11.2>`__. A
        working draft of the HTML 5 spec can be found `here
        <https://html.spec.whatwg.org/multipage/tables.html>`__. It contains the
        latest information on table attributes for the modern web.

    parse_dates : bool, optional
        See :func:`~read_csv` for more details.

    thousands : str, optional
        Separator to use to parse thousands. Defaults to ``','``.

    encoding : str, optional
        The encoding used to decode the web page. Defaults to ``None``.``None``
        preserves the previous encoding behavior, which depends on the
        underlying parser library (e.g., the parser library will try to use
        the encoding provided by the document).

    decimal : str, default '.'
        Character to recognize as decimal point (e.g. use ',' for European
        data).

    converters : dict, default None
        Dict of functions for converting values in certain columns. Keys can
        either be integers or column labels, values are functions that take one
        input argument, the cell (not column) content, and return the
        transformed content.

    na_values : iterable, default None
        Custom NA values.

    keep_default_na : bool, default True
        If na_values are specified and keep_default_na is False the default NaN
        values are overridden, otherwise they're appended to.

    displayed_only : bool, default True
        Whether elements with "display: none" should be parsed.

    extract_links : {{None, "all", "header", "body", "footer"}}
        Table elements in the specified section(s) with <a> tags will have their
        href extracted.

        .. versionadded:: 1.5.0

    dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable'
        Back-end data type applied to the resultant :class:`DataFrame`
        (still experimental). Behaviour is as follows:

        * ``"numpy_nullable"``: returns nullable-dtype-backed :class:`DataFrame`
          (default).
        * ``"pyarrow"``: returns pyarrow-backed nullable :class:`ArrowDtype`
          DataFrame.

        .. versionadded:: 2.0

    {storage_options}

        .. versionadded:: 2.1.0

    Returns
    -------
    dfs
        A list of DataFrames.

    See Also
    --------
    read_csv : Read a comma-separated values (csv) file into DataFrame.

    Notes
    -----
    Before using this function you should read the :ref:`gotchas about the
    HTML parsing libraries <io.html.gotchas>`.

    Expect to do some cleanup after you call this function. For example, you
    might need to manually assign column names if the column names are
    converted to NaN when you pass the `header=0` argument. We try to assume as
    little as possible about the structure of the table and push the
    idiosyncrasies of the HTML contained in the table to the user.

    This function searches for ``<table>`` elements and only for ``<tr>``
    and ``<th>`` rows and ``<td>`` elements within each ``<tr>`` or ``<th>``
    element in the table. ``<td>`` stands for "table data". This function
    attempts to properly handle ``colspan`` and ``rowspan`` attributes.
    If the function has a ``<thead>`` argument, it is used to construct
    the header, otherwise the function attempts to find the header within
    the body (by putting rows with only ``<th>`` elements into the header).

    Similar to :func:`~read_csv` the `header` argument is applied
    **after** `skiprows` is applied.

    This function will *always* return a list of :class:`DataFrame` *or*
    it will fail, e.g., it will *not* return an empty list.

    Examples
    --------
    See the :ref:`read_html documentation in the IO section of the docs
    <io.read_html>` for some examples of reading in HTML tables.
    rzPcannot skip rows starting from the end of the data (you passed a negative value))Nr�r�r�r�zO`extract_links` must be one of {None, "header", "footer", "body", "all"}, got "�"z�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.)�
stacklevelr@rUrVr�rarArbrcrWrGrdrerfrgrXrYrhrCr�)r5r<r=r�rrrrJr6rrrr�warnings�warn�
FutureWarningrr^)rUrVr@r�rarArWrbrcrGrdrerfrgrXrYrhrCs                  r/�	read_htmlros���j�(�G�,�,�-�(�Q�,��
1�
�	
��E�E��
���a�
!�
�	
�����
�&�	��	�B��"�c��3������O��2�J��"��		
�$�	�
�
�
>�
�'�)�	
�����
�����	�
���
� ��������������(��&�� $�!�"$�#�$(�%�r1)r-rJr.rr�rJ)rA�"int | Sequence[int] | slice | Noner�r4)rMzFilePath | BaseBufferrGr�rCzStorageOptions | Noner�zstr | bytes)r�rJ)r�r�)r@zHTMLFlavors | Noner�ztype[_HtmlFrameParser])&rUzFilePath | ReadBuffer[str]rVr�r@z*HTMLFlavors | Sequence[HTMLFlavors] | Noner��int | Sequence[int] | NonerarqrArprWr�rbr�rcr�rGr�rdrJrezdict | NonerfzIterable[object] | Nonergr�rXr�rYr�rhzDtypeBackend | lib.NoDefaultrCr'r�zlist[DataFrame])Pr��
__future__r�collectionsrr<r�r�typingrrrrl�pandas._libsr	�pandas.compat._optionalr
�
pandas.errorsrr�pandas.util._decoratorsr
�pandas.util._exceptionsr�pandas.util._validatorsr�pandas.core.dtypes.commonr�pandasr�pandas.core.indexes.baser�pandas.core.indexes.multir�pandas.core.seriesr�pandas.core.shared_docsr�pandas.io.commonrrrrrrr�pandas.io.formats.printingr�pandas.io.parsersr�collections.abcr r!�pandas._typingr"r#r$r%r&r'r(r��_RE_WHITESPACEr0rBrPrRr�r�rrr2r;r>rBrHrPr^�
no_defaultror�r1r/�<module>r�sl���#���	����
��>��(�4�7�2��*�0�%�0����4�(���
��!�
����-�.��1?�%�&X�:�	����+���	�Bf
�f
�R
W�(8�W�t�.�=�>�
�R+�'�R+�j1��2
�
�1�,�	�� "�F�
�8D�N�\�"3�4�5� �9=�)-�,0�37�#'�����"�)-� ��FJ�25�.�.�&*�'h�"�h��h�
7�	h�

'�h�*�
h�1�h�!�h��h��h��h��h��h�'�h��h� �!h�"D�#h�$0�%h�&$�'h�(�)h�6�hr1

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists