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__/xml.cpython-312.pyc

�

Mٜg�����dZddlmZddlZddlmZddlmZmZm	Z	ddl
Z
ddlmZddl
mZddlmZmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%er.ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5ddl6m7Z7eededdz��Gd�d��Z8Gd�de8�Z9Gd�de8�Z:										d*d�Z;d+d �Z<d,d!�Z=ej|f																																	d-d"�Z?eededdz��d#dd$d$ddddd%d&ddd'dej|d(�																																	d.d)��Z@y)/z5
:mod:``pandas.io.xml`` is a module for reading XML.
�)�annotationsN)�PathLike)�
TYPE_CHECKING�Any�Callable)�lib)�import_optional_dependency)�AbstractMethodError�ParserError)�doc)�find_stack_level)�check_dtype_backend)�is_list_like)�_shared_docs)�file_exists�
get_handle�infer_compression�is_file_like�
is_fsspec_url�is_url�stringify_path)�
TextParser)�Sequence)�Element)�etree)	�CompressionOptions�
ConvertersArg�DtypeArg�DtypeBackend�FilePath�
ParseDatesArg�
ReadBuffer�StorageOptions�
XMLParsers)�	DataFrame�storage_options�decompression_options�path_or_buffer)r&r'c��eZdZdZ																														d
d�Zdd�Zdd�Zd
d�Zdd�Zdd�Z					dd�Z
y	)�_XMLFrameParsera�	
    Internal subclass to parse XML into DataFrames.

    Parameters
    ----------
    path_or_buffer : a valid JSON ``str``, path object or file-like object
        Any valid string path is acceptable. The string could be a URL. Valid
        URL schemes include http, ftp, s3, and file.

    xpath : str or regex
        The ``XPath`` expression to parse required set of nodes for
        migration to :class:`~pandas.DataFrame`. ``etree`` supports limited ``XPath``.

    namespaces : dict
        The namespaces defined in XML document (``xmlns:namespace='URI'``)
        as dicts with key being namespace and value the URI.

    elems_only : bool
        Parse only the child elements at the specified ``xpath``.

    attrs_only : bool
        Parse only the attributes at the specified ``xpath``.

    names : list
        Column names for :class:`~pandas.DataFrame` of parsed XML data.

    dtype : dict
        Data type for data or columns. E.g. {{'a': np.float64,
        'b': np.int32, 'c': 'Int64'}}

        .. versionadded:: 1.5.0

    converters : dict, optional
        Dict of functions for converting values in certain columns. Keys can
        either be integers or column labels.

        .. versionadded:: 1.5.0

    parse_dates : bool or list of int or names or list of lists or dict
        Converts either index or select columns to datetimes

        .. versionadded:: 1.5.0

    encoding : str
        Encoding of xml object or document.

    stylesheet : str or file-like
        URL, file, file-like object, or a raw string containing XSLT,
        ``etree`` does not support XSLT but retained for consistency.

    iterparse : dict, optional
        Dict with row element as key and list of descendant elements
        and/or attributes as value to be retrieved in iterparsing of
        XML document.

        .. versionadded:: 1.5.0

    {decompression_options}

        .. versionchanged:: 1.4.0 Zstandard support.

    {storage_options}

    See also
    --------
    pandas.io.xml._EtreeFrameParser
    pandas.io.xml._LxmlFrameParser

    Notes
    -----
    To subclass this class effectively you must override the following methods:`
        * :func:`parse_data`
        * :func:`_parse_nodes`
        * :func:`_iterparse_nodes`
        * :func:`_parse_doc`
        * :func:`_validate_names`
        * :func:`_validate_path`


    See each method's respective documentation for details on their
    functionality.
    c���||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_d|_|
|_
||_y)N)r(�xpath�
namespaces�
elems_only�
attrs_only�names�dtype�
converters�parse_dates�encoding�
stylesheet�	iterparse�is_style�compressionr&)�selfr(r,r-r.r/r0r1r2r3r4r5r6r8r&s               �8/usr/local/lib/python3.12/site-packages/pandas/io/xml.py�__init__z_XMLFrameParser.__init__�sq��"-�����
�$���$���$�����
���
�$���&��� ��
�$���"�����
�/:���.���c��t|��)z�
        Parse xml data.

        This method will call the other internal methods to
        validate ``xpath``, names, parse and return specific nodes.
        �r
�r9s r:�
parse_dataz_XMLFrameParser.parse_data�s��"�$�'�'r<c��|jr|jrtd��|j�r|jr�|D���cgc]�}i|jr2|jj�s|j|jini�t|j|jd��D��cic] \}}||jr|jnd��"c}}����}}}}�n|D��cgc]D}|jd�D�cic]'}|j|jr|jnd��)c}��F}}}�n�|jrE|D���cgc]4}|jj�D��cic]\}}||r|nd��c}}��6}}}}�n\|jr�|D���cgc]�}i|j�|jr2|jj�s|j|jini�t|j|jd��D��cic] \}}||jr|jnd��"c}}����}}}}n�|D��cgc]�}i|j�|jr2|jj�s|j|jini�|jd�D�cic]'}|j|jr|jnd��)c}����}}}|D���cgc]>}|j�D��cic] \}}d|vr|jd�dn||��"c}}��@}}}}ttj|D��cgc]}|j�D]}|���c}}��}	|D��cgc]*}|	D�cic]}|||j�vr||nd��c}��,}}}|jr:|D�cgc]/}tt|j|j!�����1}}|Scc}}wcc}}}wcc}wcc}}wcc}}wcc}}}wcc}}wcc}}}wcc}wcc}}wcc}}wcc}}}wcc}}wcc}wcc}}wcc}w)aA
        Parse xml nodes.

        This method will parse the children and attributes of elements
        in ``xpath``, conditionally for only elements, only attributes
        or both while optionally renaming node names.

        Raises
        ------
        ValueError
            * If only elements and only attributes are specified.

        Notes
        -----
        Namespace URIs will be removed from return node values. Also,
        elements with missing children or attributes compared to siblings
        will have optional keys filled with None values.
        z4Either element or attributes can be parsed not both.�*N�}�)r.r/�
ValueErrorr0�text�isspace�tag�zip�findall�attrib�items�split�list�dict�fromkeys�keys�values)
r9�elems�el�nm�ch�dicts�k�v�drQs
          r:�_parse_nodesz_XMLFrameParser._parse_nodes�s���,�?�?�t����S�T�T��?�?��z�z�$�
�$��
� "�w�w�r�w�w���/@� �V�V�R�W�W�-�!#�	
�+.�d�j�j�"�*�*�S�/�*J��*J���B��2�7�7�����<�*J��
�$��
�"$��#��EG�J�J�s�O�T�O�b�R�V�V����R�W�W�T�9�O�T�#���
�_�_�NS��NS�������1B�C�1B���A���A��$�1B�C�e�
���Z�Z� �
� �B���i�i��,.�G�G�B�G�G�O�O�<M�������(�SU��
'*�$�*�*�b�j�j��o�&F��&F�F�B���r�w�w�B�G�G�D�8�&F��� �
�
�& �
� �B���i�i��,.�G�G�B�G�G�O�O�<M�������(�SU��GI�j�j�QT�o�V�o��r�v�v�"�'�'�r�w�w�t�;�o�V��
 �

��TY�
�SX�a�q�w�w�y�I�y�t�q�!��q��Q�W�W�S�\�!�_�a��
2�y�I�SX�	�
��D�M�M�e�"F�e��Q�V�V�X��1�X�1�e�"F�G�H��MR�S�U��d�C�d��!�Q�!�&�&�(�]�Q�q�T��4�d�C�U��S��:�:�@E�F��1�T�#�d�j�j�!�(�(�*�5�6��E�F����g��
�� U����D������	
��"W��	��
J��
��#G��C��S��Gs��A.O8�1%O2�O8�(P�,O?�,P�"P�*P
�;P�A:P�%P�8P�	A%P)�.,P$�P)�)P5�%P/�&P5�	P<�8	Q�!Q�"Q�:4Q
�2O8�?P�
P�P�$P)�/P5�Qc�J	�g}d}t|jt�s+tt	|j�j
�d���|jr,t
t|jj���nd}t|j|�s$tt	|j|��d���t|jd�s�t|jttf�rut|j�s`t|j�sKt|jt�r|jj!d�st#|jd��t%d��t'|j|�t't)|j|��k7}||jd	�
�D�]�\}}d|j*vr|j*j-d�dn|j*}|d
k(r||k(ri}|��|j.r�|r�t1|j||j.�D]�\}	}
||	k(r5|j2r|j2nd}||j5�vr	|
|vr|||
<|	|j6vs�O|j6|	|j5�vs�o|
|vs�t|j6|	||
<��nW|j|D]E}	||	k(r|j2r|j2nd||	<|	|j6vs�4|j6|	||	<�G|dk(s��f||k(r|�|j9|�d}|j;�t|d�s���|j=�����|j?�����|j?�d=|j=�����|j?���4���|gk(rt%d��tAtjC|D��
cgc]}|j�D]}
|
���c}
}��}|D��
cgc]*}|D�
cic]}
|
|
|j�vr||
nd��c}
��,}}}
|j.r:|D�cgc]/}tt1|j.|j5�����1}}|Scc}
}wcc}
wcc}
}wcc}w)a#
        Iterparse xml nodes.

        This method will read in local disk, decompressed XML files for elements
        and underlying descendants using iterparse, a method to iterate through
        an XML tree without holding entire XML tree in memory.

        Raises
        ------
        TypeError
            * If ``iterparse`` is not a dict or its dict value is not list-like.
        ParserError
            * If ``path_or_buffer`` is not a physical file on disk or file-like object.
            * If no data is returned from selected items in ``iterparse``.

        Notes
        -----
        Namespace URIs will be removed from return node values. Also,
        elements with missing children or attributes in submitted list
        will have optional keys filled with None values.
        Nz" is not a valid type for iterparse�z+ is not a valid type for value in iterparse�read�z<?xml�<�inferziterparse is designed for large XML files that are fully extracted on local disk and not as compressed files or online sources.)�start�end)�eventsrCrDrbrc�getpreviousrz+No result from selected items in iterparse.)"�
isinstancer6rO�	TypeError�type�__name__�next�iterrQr�hasattrr(�strrrr�
startswithrr�len�setrHrMr0rIrFrRrK�append�clearre�	getparentrNrP)r9r6rW�row�row_node�iterparse_repeats�event�elem�	curr_elem�colrU�elem_valrZrXrQs               r:�_iterparse_nodesz _XMLFrameParser._iterparse_nodess��..0��,0���$�.�.�$�/������'�0�0�1�1S�T��
�9=���4��T�^�^�0�0�2�3�4�B���D�N�N�8�4�5������x�0�1�2�3)�)��
�
��+�+�V�4��4�.�.��h��@��d�)�)�*��T�0�0�1��4�.�.��4��'�'�2�2�>�B� ��!4�!4�g�>�J��L��
�
 ����x� 8�9�S�����x�(�)�>
�
��%�T�%8�%8�AQ�R�R�K�E�4�25����/������s�+�A�.�t�x�x�I������(��C����:�:�"3�#&�t�~�~�h�'?����#L���R�$��+�48�I�I�t�y�y�4�H�'�s�z�z�|�;��#�
�*2��B���$�+�+�-�#�{�{�3�/�s�z�z�|�C��RU�
�*.�+�+�c�*:��B��$M� $�~�~�h�7��$��+�48�I�I�t�y�y�4�C��H��$�+�+�-�'+�{�{�3�'7�C��H�	 8���~���(�S�_��L�L��%��C��
�
���4��/��(�(�*�6�4�>�>�;K�;W� �N�N�,�Q�/��(�(�*�6�4�>�>�;K�;W�CS�J�B�;��K�L�L��D�M�M�e�"F�e��Q�V�V�X��1�X�1�e�"F�G�H��MR�S�U��d�C�d��!�Q�!�&�&�(�]�Q�q�T��4�d�C�U��S��:�:�@E�F��1�T�#�d�j�j�!�(�(�*�5�6��E�F����
#G��C��S��Gs$�&R�	R�!R�?R�4R �Rc��t|��)a*
        Validate ``xpath``.

        This method checks for syntax, evaluation, or empty nodes return.

        Raises
        ------
        SyntaxError
            * If xpah is not supported or issues with namespaces.

        ValueError
            * If xpah does not return any nodes.
        r>r?s r:�_validate_pathz_XMLFrameParser._validate_path�s��"�$�'�'r<c��t|��)z�
        Validate names.

        This method will check if names is a list-like and aligns
        with length of parse nodes.

        Raises
        ------
        ValueError
            * If value is not a list and less then length of nodes.
        r>r?s r:�_validate_namesz_XMLFrameParser._validate_names�s��"�$�'�'r<c��t|��)z�
        Build tree from path_or_buffer.

        This method will parse XML object into tree
        either from string/bytes or file location.
        r>)r9�raw_docs  r:�
_parse_docz_XMLFrameParser._parse_doc�s��"�$�'�'r<N)r(�.FilePath | ReadBuffer[bytes] | ReadBuffer[str]r,rmr-�dict[str, str] | Noner.�boolr/r�r0�Sequence[str] | Noner1�DtypeArg | Noner2�ConvertersArg | Noner3�ParseDatesArg | Noner4�
str | Noner5�5FilePath | ReadBuffer[bytes] | ReadBuffer[str] | Noner6�dict[str, list[str]] | Noner8rr&r#�return�None�r��list[dict[str, str | None]])rS�	list[Any]r�r�)r6rr�r��r�r��r�r�)r�r�r�zElement | etree._Element)ri�
__module__�__qualname__�__doc__r;r@r[r|r~r�r��r<r:r*r*>s���
Q�f/�F�/��/�*�	/�
�/��
/�$�/��/�)�/�*�/��/�J�/�/�/�(�/�(�/� 
�!/�B(�T�lg�R(�"(�	(�E�	(�	!�	(r<r*c�8�eZdZdZdd�Zdd�Zd	d�Z				d
d�Zy)�_EtreeFrameParserz
    Internal class to parse XML into DataFrames with the Python
    standard library XML module: `xml.etree.ElementTree`.
    c�8�ddlm}|j�td��|j�0|j	|j
�|_|j�}|j�|j�|j�}|S|j|�}|S)Nr�r6zBTo use stylesheet, you need lxml installed and selected as parser.)�xml.etree.ElementTreer6r5rEr�r(�xml_docr~r�r[r|�r9r6rS�	xml_dictss    r:r@z_EtreeFrameParser.parse_data�s���3��?�?�&��T��
��>�>�!��?�?�4�+>�+>�?�D�L��'�'�)�E������~�~�%�
���e�$�	����&�&�y�1�	��r<c�6�d}	|jj|j|j��}|D��cgc]}|jd�D]}|���}}}|D���cic]'}|jj�D]\}}||��
�)}}}}|�t
|��|�M|jr|gk(rt
|��|jr|ik(rt
|��|gk(r|ik(rt
|��|Scc}}wcc}}}w#ttf$rtd��wxYw)z�
        Notes
        -----
        ``etree`` supports limited ``XPath``. If user attempts a more complex
        expression syntax error will raise.
        ��xpath does not return any nodes or attributes. Be sure to specify in `xpath` the parent nodes of children and attributes to parse. If document uses namespaces denoted with xmlns, be sure to define namespaces and use them in xpath.�r-rBzxYou have used an incorrect or unsupported XPath expression for etree library or you used an undeclared namespace prefix.)r�rJr,r-rKrLrEr.r/�KeyError�SyntaxError�	r9�msgrSrTrV�childrenrXrY�attrss	         r:r~z _EtreeFrameParser._validate_path�s��
!�	�	��L�L�(�(�������(�P�E�%*�E�U�r�R�Z�Z��_�r��_��U�H�E�$)�H�E�b�b�i�i�o�o�6G�d�a��Q��T�6G�Q�E�E�H��}� ��o�%�� ��?�?�x�2�~�$�S�/�)��?�?�u��{�$�S�/�)��r�>�e�r�k�$�S�/�)����+F��H���+�&�	��/��
�	�s)�6C=�C0�	C=�",C6�A C=�0
C=�=Dc���|jr�|jr,|jtt|j��}nF|jj|j|j��}|�|jd�ng}t|j�r-t|j�t|�krtd��ytt|j�j�d���y)Nr�rB�7names does not match length of child elements in xpath.� is not a valid type for names)r0r6rjrkr��findr,r-rJrrorErgrhri)r9r��parents   r:r�z!_EtreeFrameParser._validate_names�s����:�:��~�~��>�>�$�t�D�N�N�/C�*D�E�����*�*�4�:�:�$�/�/�*�R��28�2D�6�>�>�#�.�"���D�J�J�'��t�z�z�?�S��]�2�$�Q���3�
 ��D�J�J�'�0�0�1�1O�P���r<c�$�ddlm}m}t||j|j
|j��}t|�5}||j��}|||��}ddd�|j�S#1swYj�SxYw)Nr)�	XMLParser�parse��filepath_or_bufferr4r8r&�r4��parser)	r�r�r��get_data_from_filepathr4r8r&�preprocess_data�getroot)r9r�r�r��handle_data�xml_data�curr_parser�documents        r:r�z_EtreeFrameParser._parse_docs���	
�
-�&��]�]��(�(� �0�0�	
���[�
)�X�#�T�]�]�;�K��X�k�:�H�*����!�!�	*����!�!�s�A7�7BNr�r�r�)r�r�r�r)rir�r�r�r@r~r�r�r�r<r:r�r��s,���
�,'�R�("�E�"�	�"r<r�c�@�eZdZdZdd�Zd	d�Zd
d�Z				dd�Zdd�Zy)
�_LxmlFrameParserz�
    Internal class to parse XML into :class:`~pandas.DataFrame` with third-party
    full-featured XML library, ``lxml``, that supports
    ``XPath`` 1.0 and XSLT 1.0.
    c��ddlm}|j�q|j|j�|_|j
r5|j|j
�|_|j�|_|j�}|j�|j�|j�}|S|j|�}|S)z�
        Parse xml data.

        This method will call the other internal methods to
        validate ``xpath``, names, optionally parse and run XSLT,
        and parse original or transformed XML and return specific nodes.
        rr�)�
lxml.etreer6r�r(r�r5�xsl_doc�_transform_docr~r�r[r|r�s    r:r@z_LxmlFrameParser.parse_data!s���	)��>�>�!��?�?�4�+>�+>�?�D�L����#���t���?���#�2�2�4����'�'�)�E������~�~�%�
���e�$�	����&�&�y�1�	��r<c��d}|jj|j|j��}|D��cgc]}|jd�D]}|���}}}|D���cic]'}|jj	�D]\}}||��
�)}}}}|gk(rt|��|gk7rM|jr|gk(rt|��|jr|ik(rt|��|gk(r|ik(rt|��|Scc}}wcc}}}w)Nr�r�rB)r�r,r-rKrLrEr.r/r�s	         r:r~z_LxmlFrameParser._validate_path>s���
!�	����"�"�4�:�:�$�/�/�"�J��!&�?��2����#��2�B��B���?� %�D��"�"�)�)�/�/�2C�$�!�Q��A��2C����D��B�;��S�/�!��B�;����8�r�>� ��o�%����5�B�;� ��o�%��2�~�%�2�+� ��o�%����@��Ds�C5�!,C;c���|jr�|jr,|jtt|j��}n4|jj|j
dz|j��}t|j�r-t|j�t|�krtd��ytt|j�j�d���y)Nz[1]/*r�r�r�)
r0r6rjrkr�r,r-rrorErgrhri)r9r�s  r:r�z _LxmlFrameParser._validate_namesYs����:�:��~�~��>�>�$�t�D�N�N�/C�*D�E���<�<�-�-��J�J��(�T�_�_�.����D�J�J�'��t�z�z�?�S��]�2�$�Q���3�
 ��D�J�J�'�0�0�1�1O�P���r<c��ddlm}m}m}t	||j
|j|j��}t|�5}||j
��}t|tj�rI|j
�td��||j�j|j
�|��}n
|||��}ddd�|S#1swYSxYw)Nr)r��
fromstringr�r�r�z2Can not pass encoding None when input is StringIO.r�)r�r�r�r�r�r4r8r&r�rf�io�StringIOrg�getvalue�encode)	r9r�r�r�r�r�r�r�r�s	         r:r�z_LxmlFrameParser._parse_docns���	
�	
�-�&��]�]��(�(� �0�0�	
���[�
)�X�#�T�]�]�;�K��(�B�K�K�0��=�=�(�#�L���&��%�%�'�.�.�t�}�}�=�k���!��+�>��*���*���s
�BC�Cc�Z�ddlm}||j�}||j�}|S)z�
        Transform original tree using stylesheet.

        This method will transform original xml using XSLT script into
        am ideally flatter xml document for easier parsing and migration
        to Data Frame.
        r)�XSLT)r�r�r�r�)r9r��transformer�new_docs    r:r�z_LxmlFrameParser._transform_doc�s(��	$��4�<�<�(���d�l�l�+���r<Nr�r�r�)r�r�r�zetree._Element)r�zetree._XSLTResultTree)	rir�r�r�r@r~r�r�r�r�r<r:r�r�s1����:�6�*�E��	��B
r<r�c��t|t�st|�}t|t�r�|j	d�s�t|t�r!t|�st
|�st|�rWt|d|||��5}t|jd�r|jj�n|j}ddd�|S|S#1swY|SxYw)aG
    Extract raw XML data.

    The method accepts three input types:
        1. filepath (string-like)
        2. file-like object (e.g. open file object, StringIO)
        3. XML string or bytes

    This method turns (1) into (2) to simplify the rest of the processing.
    It returns input types (2) and (3) unchanged.
    r_�r)r4r8r&r^N)rf�bytesrrmrnrrrrrl�handler^)r�r4r8r&�
handle_objs     r:r�r��s���"�(�%�0�+�,>�?��	�%�s�+�"�-�-�n�=��)�3�/��$�%��+�,��)�*�
����#�+�
���:�,�,�f�5��!�!�&�&�(��&�&�
�
�����
���s�>=C�Cc��t|t�rtj|�}|St|t�rtj
|�}|S)z�
    Convert extracted raw data.

    This method will return underlying data of extracted XML content.
    The data either has a `read` attribute (e.g. a file object or a
    StringIO/BytesIO) or is a string or bytes that is an XML document.
    )rfrmr�r�r��BytesIO)�datas r:r�r��sB���$����{�{�4� ��
�K�
�D�%�	 ��z�z�$����Kr<c��tt|��}|D�cgc]}t|j����}}	t	|fd|i|��5}|j�cddd�Scc}w#1swYyxYw#t$rt
d��wxYw)z�
    Convert parsed data to Data Frame.

    This method will bind xml dictionary data of keys and values
    into named columns of Data Frame using the built-in TextParser
    class that build Data Frame and infers specific dtypes.
    r0NzqXML document may be too complex for import. Try to flatten document and use distinct element and attribute names.)rjrkrNrRrr^r)r��kwargs�tagsrZ�nodes�tps      r:�_data_to_framer��s�����T�
��D�'+�,�t�!�T�!�(�(�*�
�t�E�,�
�
��
4�T�
4�V�
4���7�7�9�5�
4��
-�5�
4���
��
+�
�	
�
�s.� A$�A5�
A)�	A5�)A2�.A5�2A5�5B
c���t|t�rWtt|�t	|�t|�t
|�g�s$tjdtt���|
dk(r3tdd��}|�t||||||||||	|||
|�}n4td��|
dk(rt||||||||||	|||
|�}ntd	��|j!�}t#d|||||d
�|��S)a
    Call internal parsers.

    This method will conditionally call internal parsers:
    LxmlFrameParser and/or EtreeParser.

    Raises
    ------
    ImportError
        * If lxml is not installed if selected as parser.

    ValueError
        * If parser is not lxml or etree.
    z�Passing literal xml to 'read_xml' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.)�
stacklevel�lxmlz
lxml.etree�ignore)�errorsz7lxml not found, please install or use the etree parser.rz,Values for parser can only be lxml or etree.)r�r1r2r3�
dtype_backendr�)rfrm�anyrrrr�warnings�warn�
FutureWarningr
r	r��ImportErrorr�rEr@r�)r(r,r-r.r/r0r1r2r3r4r�r5r6r8r&r�r�r��p�
data_dictss                    r:�_parser��s7��H�.�#�&�s���(���'��>�"��.�)�		
�0�	�
�
�
>�
�'�)�	
����)�,�x�H���� ����������������A�"�W�X�X�	�7�	����������������
��"�G�H�H�����J���
����#���
�r<z./*Fzutf-8r�ra)r,r-r.r/r0r1r2r3r4r�r5r6r8r&r�c��t|�tdid|�d|�d|�d|�d|�d|�d|�d|�d	|�d
|	�d|
�d|�d
|�d|
�d|�d|��S)aE'
    Read XML document into a :class:`~pandas.DataFrame` object.

    .. versionadded:: 1.3.0

    Parameters
    ----------
    path_or_buffer : str, path object, or file-like object
        String, path object (implementing ``os.PathLike[str]``), or file-like
        object implementing a ``read()`` function. The string can be any valid XML
        string or a path. The string can further be a URL. Valid URL schemes
        include http, ftp, s3, and file.

        .. deprecated:: 2.1.0
            Passing xml literal strings is deprecated.
            Wrap literal xml input in ``io.StringIO`` or ``io.BytesIO`` instead.

    xpath : str, optional, default './\*'
        The ``XPath`` to parse required set of nodes for migration to
        :class:`~pandas.DataFrame`.``XPath`` should return a collection of elements
        and not a single element. Note: The ``etree`` parser supports limited ``XPath``
        expressions. For more complex ``XPath``, use ``lxml`` which requires
        installation.

    namespaces : dict, optional
        The namespaces defined in XML document as dicts with key being
        namespace prefix and value the URI. There is no need to include all
        namespaces in XML, only the ones used in ``xpath`` expression.
        Note: if XML document uses default namespace denoted as
        `xmlns='<URI>'` without a prefix, you must assign any temporary
        namespace prefix such as 'doc' to the URI in order to parse
        underlying nodes and/or attributes. For example, ::

            namespaces = {{"doc": "https://example.com"}}

    elems_only : bool, optional, default False
        Parse only the child elements at the specified ``xpath``. By default,
        all child elements and non-empty text nodes are returned.

    attrs_only :  bool, optional, default False
        Parse only the attributes at the specified ``xpath``.
        By default, all attributes are returned.

    names :  list-like, optional
        Column names for DataFrame of parsed XML data. Use this parameter to
        rename original element names and distinguish same named elements and
        attributes.

    dtype : Type name or dict of column -> type, optional
        Data type for data or columns. E.g. {{'a': np.float64, 'b': np.int32,
        'c': 'Int64'}}
        Use `str` or `object` together with suitable `na_values` settings
        to preserve and not interpret dtype.
        If converters are specified, they will be applied INSTEAD
        of dtype conversion.

        .. versionadded:: 1.5.0

    converters : dict, optional
        Dict of functions for converting values in certain columns. Keys can either
        be integers or column labels.

        .. versionadded:: 1.5.0

    parse_dates : bool or list of int or names or list of lists or dict, default False
        Identifiers to parse index or columns to datetime. The behavior is as follows:

        * boolean. If True -> try parsing the index.
        * list of int or names. e.g. If [1, 2, 3] -> try parsing columns 1, 2, 3
          each as a separate date column.
        * list of lists. e.g.  If [[1, 3]] -> combine columns 1 and 3 and parse as
          a single date column.
        * dict, e.g. {{'foo' : [1, 3]}} -> parse columns 1, 3 as date and call
          result 'foo'

        .. versionadded:: 1.5.0

    encoding : str, optional, default 'utf-8'
        Encoding of XML document.

    parser : {{'lxml','etree'}}, default 'lxml'
        Parser module to use for retrieval of data. Only 'lxml' and
        'etree' are supported. With 'lxml' more complex ``XPath`` searches
        and ability to use XSLT stylesheet are supported.

    stylesheet : str, path object or file-like object
        A URL, file-like object, or a raw string containing an XSLT script.
        This stylesheet should flatten complex, deeply nested XML documents
        for easier parsing. To use this feature you must have ``lxml`` module
        installed and specify 'lxml' as ``parser``. The ``xpath`` must
        reference nodes of transformed XML document generated after XSLT
        transformation and not the original XML document. Only XSLT 1.0
        scripts and not later versions is currently supported.

    iterparse : dict, optional
        The nodes or attributes to retrieve in iterparsing of XML document
        as a dict with key being the name of repeating element and value being
        list of elements or attribute names that are descendants of the repeated
        element. Note: If this option is used, it will replace ``xpath`` parsing
        and unlike ``xpath``, descendants do not need to relate to each other but can
        exist any where in document under the repeating element. This memory-
        efficient method should be used for very large XML files (500MB, 1GB, or 5GB+).
        For example, ::

            iterparse = {{"row_element": ["child_elem", "attr", "grandchild_elem"]}}

        .. versionadded:: 1.5.0

    {decompression_options}

        .. versionchanged:: 1.4.0 Zstandard support.

    {storage_options}

    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

    Returns
    -------
    df
        A DataFrame.

    See Also
    --------
    read_json : Convert a JSON string to pandas object.
    read_html : Read HTML tables into a list of DataFrame objects.

    Notes
    -----
    This method is best designed to import shallow XML documents in
    following format which is the ideal fit for the two-dimensions of a
    ``DataFrame`` (row by column). ::

            <root>
                <row>
                  <column1>data</column1>
                  <column2>data</column2>
                  <column3>data</column3>
                  ...
               </row>
               <row>
                  ...
               </row>
               ...
            </root>

    As a file format, XML documents can be designed any way including
    layout of elements and attributes as long as it conforms to W3C
    specifications. Therefore, this method is a convenience handler for
    a specific flatter design and not all possible XML structures.

    However, for more complex XML documents, ``stylesheet`` allows you to
    temporarily redesign original document with XSLT (a special purpose
    language) for a flatter version for migration to a DataFrame.

    This function will *always* return a single :class:`DataFrame` or raise
    exceptions due to issues with XML document, ``xpath``, or other
    parameters.

    See the :ref:`read_xml documentation in the IO section of the docs
    <io.read_xml>` for more information in using this method to parse XML
    files to DataFrames.

    Examples
    --------
    >>> from io import StringIO
    >>> xml = '''<?xml version='1.0' encoding='utf-8'?>
    ... <data xmlns="http://example.com">
    ...  <row>
    ...    <shape>square</shape>
    ...    <degrees>360</degrees>
    ...    <sides>4.0</sides>
    ...  </row>
    ...  <row>
    ...    <shape>circle</shape>
    ...    <degrees>360</degrees>
    ...    <sides/>
    ...  </row>
    ...  <row>
    ...    <shape>triangle</shape>
    ...    <degrees>180</degrees>
    ...    <sides>3.0</sides>
    ...  </row>
    ... </data>'''

    >>> df = pd.read_xml(StringIO(xml))
    >>> df
          shape  degrees  sides
    0    square      360    4.0
    1    circle      360    NaN
    2  triangle      180    3.0

    >>> xml = '''<?xml version='1.0' encoding='utf-8'?>
    ... <data>
    ...   <row shape="square" degrees="360" sides="4.0"/>
    ...   <row shape="circle" degrees="360"/>
    ...   <row shape="triangle" degrees="180" sides="3.0"/>
    ... </data>'''

    >>> df = pd.read_xml(StringIO(xml), xpath=".//row")
    >>> df
          shape  degrees  sides
    0    square      360    4.0
    1    circle      360    NaN
    2  triangle      180    3.0

    >>> xml = '''<?xml version='1.0' encoding='utf-8'?>
    ... <doc:data xmlns:doc="https://example.com">
    ...   <doc:row>
    ...     <doc:shape>square</doc:shape>
    ...     <doc:degrees>360</doc:degrees>
    ...     <doc:sides>4.0</doc:sides>
    ...   </doc:row>
    ...   <doc:row>
    ...     <doc:shape>circle</doc:shape>
    ...     <doc:degrees>360</doc:degrees>
    ...     <doc:sides/>
    ...   </doc:row>
    ...   <doc:row>
    ...     <doc:shape>triangle</doc:shape>
    ...     <doc:degrees>180</doc:degrees>
    ...     <doc:sides>3.0</doc:sides>
    ...   </doc:row>
    ... </doc:data>'''

    >>> df = pd.read_xml(StringIO(xml),
    ...                  xpath="//doc:row",
    ...                  namespaces={{"doc": "https://example.com"}})
    >>> df
          shape  degrees  sides
    0    square      360    4.0
    1    circle      360    NaN
    2  triangle      180    3.0

    >>> xml_data = '''
    ...         <data>
    ...            <row>
    ...               <index>0</index>
    ...               <a>1</a>
    ...               <b>2.5</b>
    ...               <c>True</c>
    ...               <d>a</d>
    ...               <e>2019-12-31 00:00:00</e>
    ...            </row>
    ...            <row>
    ...               <index>1</index>
    ...               <b>4.5</b>
    ...               <c>False</c>
    ...               <d>b</d>
    ...               <e>2019-12-31 00:00:00</e>
    ...            </row>
    ...         </data>
    ...         '''

    >>> df = pd.read_xml(StringIO(xml_data),
    ...                  dtype_backend="numpy_nullable",
    ...                  parse_dates=["e"])
    >>> df
       index     a    b      c  d          e
    0      0     1  2.5   True  a 2019-12-31
    1      1  <NA>  4.5  False  b 2019-12-31
    r(r,r-r.r/r0r1r2r3r4r�r5r6r8r&r�r�)rr�)r(r,r-r.r/r0r1r2r3r4r�r5r6r8r&r�s                r:�read_xmlr�`s���L	�
�&���%�������	�
���
����� ���������� ��(�� $�!�r<)
r�z6FilePath | bytes | ReadBuffer[bytes] | ReadBuffer[str]r4r�r8rr&r#r�z1str | bytes | ReadBuffer[bytes] | ReadBuffer[str])r�zio.StringIO | io.BytesIO)r�r%)"r(r�r,rmr-r�r.r�r/r�r0r�r1r�r2r�r3r�r4r�r�r$r5r�r6r�r8rr&r#r��DtypeBackend | lib.NoDefaultr�r%)"r(r�r,rmr-r�r.r�r/r�r0r�r1r�r2r�r3r�r4r�r�r$r5r�r6r�r8rr&zStorageOptions | Noner�r�r�r%)Ar��
__future__rr��osr�typingrrrr��pandas._libsr�pandas.compat._optionalr	�
pandas.errorsr
r�pandas.util._decoratorsr�pandas.util._exceptionsr
�pandas.util._validatorsr�pandas.core.dtypes.commonr�pandas.core.shared_docsr�pandas.io.commonrrrrrrr�pandas.io.parsersr�collections.abcrr�rr�r�pandas._typingrrrrr r!r"r#r$�pandasr%r*r�r�r�r�r��
no_defaultr�r�r�r<r:�<module>rs����#�	����
��>��(�4�7�2�0����)��(�-��
�
�
�!�� �!2�3�&�'>�?�BR�R��f(�f(�	�f(�Rl"��l"�^B��B�J*�N�*��*�$�*�$�	*�
7�*�Z�$
�N36�.�.�!h�B�h��h�&�h��	h�
�h� �
h��h�%�h�&�h��h�
�h�F�h�+�h�$�h�$�h� 0�!h�$�%h�V� �!2�3�&�'>�?�BR�R���(,���"&�!�'+�(,�"��HL�-1�&-�-1�25�.�.�%u�B�u��u�&�	u�
�u��
u� �u��u�%�u�&�u��u�
�u�F�u�+�u� $�!u�"+�#u�$0�%u�&�'u�	�ur<

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