Your IP : 3.144.84.91


Current Path : /opt/alt/python313/lib64/python3.13/xml/etree/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/xml/etree/__pycache__/ElementTree.cpython-313.pyc

�

2}gE"���Sr/SQrSrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKJr "SS\
5rS	r"S
S5r04SjrSCS
jrSCSjr\r"SS5r"SS5r\	R.S5rSCSjrSr1SkrSrSr\\\S.rSrSSSSSS S!S".r \ \l S#r!S$r"S%r#S&r$SDSSS'S(.S)jjr%"S*S+\RL5r'SDSSS'S(.S,jjr(S-r)SES.jr*SCS/jr+SDS0jr,"S1S25r-SCS3jr.SCS4jr/\.r0SCS5jr1"S6S75r2"S8S95r3SCSSS:.S;jjr4\Rj"S<\Rl5Rnr8"S=S>5r9S?r:S@r;\r<SSAK=7 SSBK=J>r> \>"\\5 g!\?a gf=f)Fa�Lightweight XML support for Python.

XML is an inherently hierarchical data format, and the most natural way to
represent it is with a tree.  This module has two classes for this purpose:

   1. ElementTree represents the whole XML document as a tree and

   2. Element represents a single node in this tree.

Interactions with the whole document (reading and writing to/from files) are
usually done on the ElementTree level.  Interactions with a single XML element
and its sub-elements are done on the Element level.

Element is a flexible container object designed to store hierarchical data
structures in memory. It can be described as a cross between a list and a
dictionary.  Each Element has a number of properties associated with it:

   'tag' - a string containing the element's name.

   'attributes' - a Python dictionary storing the element's attributes.

   'text' - a string containing the element's text content.

   'tail' - an optional string containing text after the element's end tag.

   And a number of child elements stored in a Python sequence.

To create an element instance, use the Element constructor,
or the SubElement factory function.

You can also use the ElementTree class to wrap an element structure
and convert it to and from XML.

)�Comment�dump�Element�ElementTree�
fromstring�fromstringlist�indent�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�
XMLPullParser�register_namespace�canonicalize�C14NWriterTargetz1.3.0�N�)�ElementPathc��\rSrSrSrSrg)r�kz�An error when parsing an XML document.

In addition to its exception value, a ParseError contains
two extra attributes:
    'code'     - the specific exception code
    'position' - the line and column of the error

�N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r!��</opt/alt/python313/lib64/python3.13/xml/etree/ElementTree.pyrrks���	r(rc��[US5$)z2Return True if *element* appears to be an Element.�tag)�hasattr)�elements r)r	r	ys���7�E�"�"r(c���\rSrSrSrSrSrSrSr04Sjr	Sr
SrSrSr
S	rS
rSrSrS
rSrSrSrSrSSjrSSjrSSjrSSjrSrSSjrSrSrSrSSjr Sr!Sr"g) r�~a8An XML element.

This class is the reference implementation of the Element interface.

An element's length is its number of subelements.  That means if you
want to check if an element is truly empty, you should check BOTH
its length AND its text attribute.

The element tag, attribute names, and attribute values can be either
bytes or strings.

*tag* is the element name.  *attrib* is an optional dictionary containing
element attributes. *extra* are additional element attributes given as
keyword arguments.

Example form:
    <tag attrib>text<child/>...</tag>tail

Nc��[U[5(d#[SURR<35eXl0UEUEUl/Ulg)Nzattrib must be dict, not )�
isinstance�dict�	TypeError�	__class__r"r+�attrib�	_children)�selfr+r5�extras    r)�__init__�Element.__init__�sM���&�$�'�'��� � �)�)�,�-�
-���)��)�5�)�����r(c�`�SURRUR[U54-$)Nz<%s %r at %#x>)r4r"r+�id�r7s r)�__repr__�Element.__repr__�s&���4�>�>�#:�#:�D�H�H�b��h�"O�O�Or(c�$�URX5$)z�Create a new element with the same type.

*tag* is a string containing the element name.
*attrib* is a dictionary containing the element attributes.

Do not call this method, use the SubElement factory function instead.

)r4)r7r+r5s   r)�makeelement�Element.makeelement�s���~�~�c�*�*r(c��URURUR5nURUlURUlXSS&U$�N)rAr+r5�text�tail)r7�elems  r)�__copy__�Element.__copy__�s>��������$�+�+�6���I�I��	��I�I��	��Q���r(c�,�[UR5$rD)�lenr6r=s r)�__len__�Element.__len__�s���4�>�>�"�"r(c�f�[R"S[SS9 [UR5S:g$)Nz�Testing an element's truth value will always return True in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.���
stacklevelr)�warnings�warn�DeprecationWarningrKr6r=s r)�__bool__�Element.__bool__�s1���
�
�
K�
�1�		��4�>�>�"�a�'�'r(c� �URU$rD�r6�r7�indexs  r)�__getitem__�Element.__getitem__�s���~�~�e�$�$r(c��[U[5(aUHnURU5 M OURU5 X RU'grD)r1�slice�_assert_is_elementr6)r7rZr-�elts    r)�__setitem__�Element.__setitem__�sC���e�U�#�#����'�'��,��
�#�#�G�,� '���u�r(c��URU	grDrXrYs  r)�__delitem__�Element.__delitem__�s���N�N�5�!r(c�\�URU5 URRU5 g)z�Add *subelement* to the end of this element.

The new element will appear in document order after the last existing
subelement (or directly after the text, if it's the first subelement),
but before the end tag for this element.

N�r_r6�append�r7�
subelements  r)rh�Element.append�s$��	
���
�+������j�)r(c�n�UH/nURU5 URRU5 M1 g)z[Append subelements from a sequence.

*elements* is a sequence with zero or more elements.

Nrg)r7�elementsr-s   r)�extend�Element.extend�s.�� �G��#�#�G�,��N�N�!�!�'�*� r(c�\�URU5 URRX5 g)z(Insert *subelement* at position *index*.N)r_r6�insert)r7rZrjs   r)rq�Element.insert�s"�����
�+������e�0r(c�p�[U[5(d![S[U5R-5eg)Nzexpected an Element, not %s)r1�_Element_Pyr3�typer")r7�es  r)r_�Element._assert_is_element�s1���!�[�)�)��9�D��G�<L�<L�L�M�M�*r(c�:�URRU5 g)ayRemove matching subelement.

Unlike the find methods, this method compares elements based on
identity, NOT ON tag value or contents.  To remove subelements by
other means, the easiest way is to use a list comprehension to
select what elements to keep, and then use slice assignment to update
the parent element.

ValueError is raised if a matching element could not be found.

N)r6�removeris  r)ry�Element.removes��	
�����j�)r(c�0�[R"XU5$)z�Find first matching element by tag name or path.

*path* is a string having either an element tag or an XPath,
*namespaces* is an optional mapping from namespace prefix to full name.

Return the first matching element, or None if no element was found.

)r�find�r7�path�
namespacess   r)r|�Element.finds������J�7�7r(c�0�[R"XX#5$)a�Find text for first matching element by tag name or path.

*path* is a string having either an element tag or an XPath,
*default* is the value to return if the element was not found,
*namespaces* is an optional mapping from namespace prefix to full name.

Return text content of first matching element, or default value if
none was found.  Note that if an element is found having no text
content, the empty string is returned.

)r�findtext�r7r~�defaultrs    r)r��Element.findtexts���#�#�D��D�Dr(c�0�[R"XU5$)z�Find all matching subelements by tag name or path.

*path* is a string having either an element tag or an XPath,
*namespaces* is an optional mapping from namespace prefix to full name.

Returns list containing all matching elements in document order.

)r�findallr}s   r)r��Element.findall)s���"�"�4�z�:�:r(c�0�[R"XU5$)aFind all matching subelements by tag name or path.

*path* is a string having either an element tag or an XPath,
*namespaces* is an optional mapping from namespace prefix to full name.

Return an iterable yielding all matching elements in document order.

)r�iterfindr}s   r)r��Element.iterfind4s���#�#�D�
�;�;r(c�b�URR5 /UlS=UlUlg)z~Reset element.

This function removes all subelements, clears all attributes, and sets
the text and tail attributes to None.

N)r5�clearr6rErFr=s r)r��
Element.clear?s)��	
��������� $�$��	�D�Ir(c�8�URRX5$)a7Get element attribute.

Equivalent to attrib.get, but some implementations may handle this a
bit more efficiently.  *key* is what attribute to look for, and
*default* is what to return if the attribute was not found.

Returns a string containing the attribute value, or the default if
attribute was not found.

)r5�get)r7�keyr�s   r)r��Element.getJs���{�{���s�,�,r(c� �X RU'g)z�Set element attribute.

Equivalent to attrib[key] = value, but some implementations may handle
this a bit more efficiently.  *key* is what attribute to set, and
*value* is the attribute value to set it to.

N)r5)r7r��values   r)�set�Element.setWs��!���C�r(c�6�URR5$)z�Get list of attribute names.

Names are returned in an arbitrary order, just like an ordinary
Python dict.  Equivalent to attrib.keys()

)r5�keysr=s r)r��Element.keysas���{�{���!�!r(c�6�URR5$)z�Get element attributes as a sequence.

The attributes are returned in arbitrary order.  Equivalent to
attrib.items().

Return a list of (name, value) tuples.

)r5�itemsr=s r)r��
Element.itemsjs���{�{� � �"�"r(c#�# �US:XaSnUbURU:XaUv� URHnURU5Shv�N M gN	7f)a�Create tree iterator.

The iterator loops over the element and all subelements in document
order, returning all elements with a matching tag.

If the tree structure is modified during iteration, new or removed
elements may or may not be included.  To get a stable set, use the
list() function on the iterator, and loop over the resulting list.

*tag* is what tags to look for (default is to return all elements)

Return an iterator containing all the matching elements.

�*N)r+r6�iter)r7r+rvs   r)r��Element.iterusI����#�:��C��;�$�(�(�c�/��J����A��v�v�c�{�"�"� �"�s�AA�A�
Ac#�# �URn[U[5(dUbgURnU(aUv� UH4nUR	5Shv�N UR
nU(dM0Uv� M6 gN"7f)z}Create text iterator.

The iterator loops over the element and all subelements in document
order, returning all inner text.

N)r+r1�strrE�itertextrF)r7r+�trvs    r)r��Element.itertext�sd����h�h���#�s�#�#�����I�I����G��A��z�z�|�#�#����A��q���	�#�s�AA<�A:�A<�1
A<)r6r5r+rFrErD�NN)#r"r#r$r%r&r+r5rErFr9r>rArHrLrUr[rardrhrnrqr_ryr|r�r�r�r�r�r�r�r�r�r�r'r!r(r)rr~s����(�C��
�F�1��D���D��$&��P�	+��#�(�%�(�"�	*�+�1�
N�
*�	8�E�	;�	<�	%�-�!�"�	#�#�,r(rc�V�0UEUEnURX5nURU5 U$)a|Subelement factory which creates an element instance, and appends it
to an existing parent.

The element tag, attribute names, and attribute values can be either
bytes or Unicode strings.

*parent* is the parent element, *tag* is the subelements name, *attrib* is
an optional directory containing element attributes, *extra* are
additional attributes given as keyword arguments.

)rArh)�parentr+r5r8r-s     r)rr�s4��!��
 �%�
 �F�� � ��-�G�
�M�M�'���Nr(c�0�[[5nXlU$)z�Comment element factory.

This function creates a special element which the standard serializer
serializes as an XML comment.

*text* is a string containing the comment string.

)rrrE)rEr-s  r)rr�s���g��G��L��Nr(c�l�[[5nXlU(aURS-U-UlU$)aProcessing Instruction element factory.

This function creates a special element which the standard serializer
serializes as an XML comment.

*target* is a string containing the processing instruction, *text* is a
string containing the processing instruction contents, if any.

� )rrrE)�targetrEr-s   r)rr�s1���+�,�G��L���|�|�c�)�D�0����Nr(c�R�\rSrSrSrSSjrSrSrSrSr	S	r
S
rSrSr
S
rg)ri�a�Qualified name wrapper.

This class can be used to wrap a QName attribute value in order to get
proper namespace handing on output.

*text_or_uri* is a string containing the QName value either in the form
{uri}local, or if the tag argument is given, the URI part of a QName.

*tag* is an optional argument which if given, will make the first
argument (text_or_uri) be interpreted as a URI, and this argument (tag)
be interpreted as a local name.

Nc�2�U(a
SU<SU<3nXlg)N�{�}�rE)r7�text_or_urir+s   r)r9�QName.__init__�s���&1�3�7�K��	r(c��UR$rDr�r=s r)�__str__�
QName.__str__�s���y�y�r(c�T�SURR<SUR<S3$)N�<r��>)r4r"rEr=s r)r>�QName.__repr__�s�� �N�N�3�3�T�Y�Y�?�?r(c�,�[UR5$rD)�hashrEr=s r)�__hash__�QName.__hash__�s���D�I�I��r(c�|�[U[5(aURUR:*$URU:*$rD�r1rrE�r7�others  r)�__le__�QName.__le__��1���e�U�#�#��9�9��
�
�*�*��y�y�E�!�!r(c�|�[U[5(aURUR:$URU:$rDr�r�s  r)�__lt__�QName.__lt__��1���e�U�#�#��9�9�u�z�z�)�)��y�y�5� � r(c�|�[U[5(aURUR:�$URU:�$rDr�r�s  r)�__ge__�QName.__ge__�r�r(c�|�[U[5(aURUR:�$URU:�$rDr�r�s  r)�__gt__�QName.__gt__�r�r(c�|�[U[5(aURUR:H$URU:H$rDr�r�s  r)�__eq__�QName.__eq__�r�r(r�rD)r"r#r$r%r&r9r�r>r�r�r�r�r�r�r'r!r(r)rr�s5��� ��@��"�!�"�!�"r(rc��\rSrSrSrSSjrSrSrSSjrSSjr	SS	jr
SS
jrSSjrSSjr
SS
S.SjjrSrSrg)ria
An XML element hierarchy.

This class also provides support for serialization to and from
standard XML.

*element* is an optional root element node,
*file* is an optional file handle or file name of an XML file whose
contents will be used to initialize the tree with.

Nc�B�XlU(aURU5 ggrD)�_rootr)r7r-�files   r)r9�ElementTree.__init__
s���
���J�J�t��r(c��UR$)z!Return root element of this tree.�r�r=s r)�getroot�ElementTree.getroots���z�z�r(c��Xlg)z�Replace root element of this tree.

This will discard the current contents of the tree and replace it
with the given element.  Use with care!

Nr�)r7r-s  r)�_setroot�ElementTree._setroots	���
r(c�(�Sn[US5(d[US5nSnUcU[5n[US5(a:URU5UlURU(aUR5 $$UR
S5=n(a+URU5 UR
S5=n(aM+UR5UlURU(aUR5 $$!U(aUR5 ff=f)aLoad external XML document into element tree.

*source* is a file name or file object, *parser* is an optional parser
instance that defaults to XMLParser.

ParseError is raised if the parser fails to parse the document.

Returns the root element of the given source document.

F�read�rbT�_parse_wholei)r,�openrr�r��closer��feed)r7�source�parser�close_source�datas     r)r�ElementTree.parse!s������v�v�&�&��&�$�'�F��L�	��~�"����6�>�2�2�
"(�!4�!4�V�!<�D�J��:�:�������!�+�+�e�,�,�$�,����D�!�!�+�+�e�,�,�$�,�����D�J��:�:��������|������s�?C7�;AC7�> C7�7Dc�8�URRU5$)z�Create and return tree iterator for the root element.

The iterator loops over all elements in this tree, in document order.

*tag* is a string with the tag name to iterate over
(default is to return all elements).

)r�r��r7r+s  r)r��ElementTree.iterCs���z�z���s�#�#r(c��USSS:Xa"SU-n[R"SU-[SS9 URR	X5$)a4Find first matching element by tag name or path.

Same as getroot().find(path), which is Element.find()

*path* is a string having either an element tag or an XPath,
*namespaces* is an optional mapping from namespace prefix to full name.

Return the first matching element, or None if no element was found.

Nr�/�.��This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rrOrP)rRrS�
FutureWarningr�r|r}s   r)r|�ElementTree.findOsO�����8�s�?���:�D��M�M�-�/3�4��!�	
��z�z���t�0�0r(c��USSS:Xa"SU-n[R"SU-[SS9 URR	XU5$)a=Find first matching element by tag name or path.

Same as getroot().findtext(path),  which is Element.findtext()

*path* is a string having either an element tag or an XPath,
*namespaces* is an optional mapping from namespace prefix to full name.

Return the first matching element, or None if no element was found.

Nrr�r�r�rOrP)rRrSr�r�r�r�s    r)r��ElementTree.findtextesS�����8�s�?���:�D��M�M�-�/3�4��!�	
��z�z�"�"�4�*�=�=r(c��USSS:Xa"SU-n[R"SU-[SS9 URR	X5$)a9Find all matching subelements by tag name or path.

Same as getroot().findall(path), which is Element.findall().

*path* is a string having either an element tag or an XPath,
*namespaces* is an optional mapping from namespace prefix to full name.

Return list containing all matching elements in document order.

Nrr�r�r�rOrP)rRrSr�r�r�r}s   r)r��ElementTree.findall{sQ�����8�s�?���:�D��M�M�-�/3�4��!�	
��z�z�!�!�$�3�3r(c��USSS:Xa"SU-n[R"SU-[SS9 URR	X5$)a?Find all matching subelements by tag name or path.

Same as getroot().iterfind(path), which is element.iterfind()

*path* is a string having either an element tag or an XPath,
*namespaces* is an optional mapping from namespace prefix to full name.

Return an iterable yielding all matching elements in document order.

Nrr�r�r�rOrP)rRrSr�r�r�r}s   r)r��ElementTree.iterfind�sQ�����8�s�?���:�D��M�M�-�/3�4��!�	
��z�z�"�"�4�4�4r(T��short_empty_elementsc	���U(dSnOU[;a[SU-5eU(dUS:XaSnOSn[X5upxUS:Xa?U(d+Uc5UR5S:wa!UR5S;a
U"S	U<S
35 US:Xa[	XpR
5 O3[
UR
U5up�[UnU"XpR
X�US9 SSS5 g!,(df   g=f)
azWrite element tree to a file as XML.

Arguments:
  *file_or_filename* -- file name or a file object opened for writing

  *encoding* -- the output encoding (default: US-ASCII)

  *xml_declaration* -- bool indicating if an XML declaration should be
                       added to the output. If None, an XML declaration
                       is added if encoding IS NOT either of:
                       US-ASCII, UTF-8, or Unicode

  *default_namespace* -- sets the default XML namespace (for "xmlns")

  *method* -- either "xml" (default), "html, "text", or "c14n"

  *short_empty_elements* -- controls the formatting of elements
                            that contain no content. If True (default)
                            they are emitted as a single self-closed
                            tag, otherwise they are emitted as a pair
                            of start/end tags

�xmlzunknown method %r�c14n�utf-8�us-asciiN�unicode)r�rz<?xml version='1.0' encoding='z'?>
rEr�)�
_serialize�
ValueError�_get_writer�lower�_serialize_textr��_namespaces)r7�file_or_filename�encoding�xml_declaration�default_namespace�methodr��write�declared_encoding�qnamesr�	serializes            r)r
�ElementTree.write�s���:��F�
�:�
%��0�6�9�:�:�����"��%��
�)�
4�8R�����O�$�,��^�^�%��2�&�,�,�.�6K�K��%�(�)������z�z�2�%0����=N�%O�"��&�v�.�	��%���V�/C�E�5�
4�
4�s
�BC � 
C.c�"�URUSS9$)Nr�)r)r
)r7r�s  r)�
write_c14n�ElementTree.write_c14n�s���z�z�$�v�z�.�.r(r�r�rD)NNNN)r"r#r$r%r&r9r�r�rr�r|r�r�r�r
rr'r!r(r)rrsZ��	���� �D
$�1�,>�,4�,5�.�"� $��	3E�
$(�3E�j/r(rc#�# �URnUR5S:XaU[USS5=(d S4v� g[R"5n[U[R5(aUnO�[U[R5(a2[R"U5nURUR5 OF[R"5nSUlX$lURUl
URUl[R "UUSSS9nURUR5 URU4v� SSS5 g![a NWf=f!,(df   g=f![aP UR5S:XaSn[#USUSS	9nURU4v� SSS5 g!,(df   g=ff=f7f)
Nrr	r�c��g�NTr!r!r(r)�<lambda>�_get_writer.<locals>.<lambda>s��Dr(�xmlcharrefreplace�
)r	�errors�newline�w)r	r)r
r�getattr�
contextlib�	ExitStackr1�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�AttributeError�
TextIOWrapperr�)rr	r
�stackr�s     r)rr�s����-+� �&�&���>�>��y�(���!1�:�t�D�O��O�O��%�%�'�5��.��0A�0A�B�B�+�D�� 0�"�,�,�?�?��,�,�-=�>�D��N�N�4�;�;�/��,�,�.�D�$0�D�M�!&�J��)9�(A�(A��
�$4�$9�$9��	��'�'��19�/B�04�6�����t�{�{�+��j�j�(�*�*�9(�'��&*�����'(�'���'��>�>��y�(��H�
�"�C�(�,�.�15��*�*�h�&�&�.�.�.�.��	'�s��G�E:�AG�BE)�,"E�AE)�	G�
E&�#E)�%E&�&E)�)
E7�3G�:,G�&G�7G�?G�
G	�G�G�G�Gc�^^^�SS0m0mT(aSTT'UUU4SjnUR5GHXnURn[U[5(a#URT;aU"UR5 OD[U[
5(aUT;aU"U5 O UbU[LaU[La[U5 UR5HoupE[U[5(aURnUT;aU"U5 [U[5(dMKURT;dM]U"UR5 Mq URn[U[5(dGM3URT;dGMFU"UR5 GM[ TT4$)N�c�j>�USSS:XavUSSRSS5upTRU5nUc1[RU5nUcS[T5-nUS:waUTU'U(a
U<SU<3TU'gUTU'gT(a[	S5eUTU'g![
a [
U5 gf=f)Nrr�r�zns%dr��:z<cannot use non-qualified names with default_namespace option)�rsplitr��_namespace_maprKrr3�_raise_serialization_error)�qname�urir+�prefixrrrs    ���r)�	add_qname�_namespaces.<locals>.add_qname s����	.��R�a�y�C�� ���9�+�+�C��3���#����,���>�+�/�/��4�F��~�!'�#�j�/�!9�����*0�
�3���/5�s�$;�F�5�M�$'�F�5�M�$�$�3���!&��u�
���	.�&�u�-�	.�s�A8B�<B�B�B2�1B2)
r�r+r1rrEr�rr
r4r�)	rGrr8r+r�r�rErrs	 `     @@r)rrs7����D�\�F��J��(*�
�$�%�.�8�	�	����h�h���c�5�!�!��x�x�v�%��#�(�(�#��
��S�
!�
!��&� ��#���
�_��G�!3��2�
�&�s�+��*�*�,�J�C��#�u�%�%��h�h���&� ��#���%��'�'�E�J�J�f�,D��%�*�*�%�
'��y�y���d�E�"�"�t�y�y��'>��d�i�i� �'�(�:��r(c	��URnURnU[La
U"SU-5 GO�U[La
U"SU-5 GO�X&nUc/U(aU"[	U55 UHn[XUSUS9 M GOYU"SU-5 [
UR55n	U	(dU(a�U(aH[UR5SS9H+up�U(aSU-nU"SU<S	[U
5<S
35 M- U	Hhup�[U[5(aURn[U
[5(aX*Rn
O[U
5n
U"SX+<S	U
<S
35 Mj U(d[U5(dU(dDU"S5 U(aU"[	U55 UHn[XUSUS9 M U"S
U-S-5 OU"S5 UR(aU"[	UR55 gg)N�	<!--%s-->�<?%s?>r�r�c��US$�Nrr!��xs r)r� _serialize_xml.<locals>.<lambda>h���Q�q�Tr(�r�r1� xmlns�="�"r�r��</z />)r+rErr�
_escape_cdata�_serialize_xml�listr��sorted�_escape_attribr1rrKrF)r
rGrrr��kwargsr+rErvr��v�ks            r)rIrIRs���
�(�(�C��9�9�D�
�g�~�
�k�D� �!�	�%�	%�
�h��o���k���;���m�D�)�*����u���4H�J��
�#��)�������&�E��
�� &�z�'7�'7�'9�+9�!;���� #�a��A���*�1�-���	!;�"�D�A�!�!�U�+�+��F�F��!�!�U�+�+�"�6�6�N��*�1�-���&�)�Q�7�8�"��s�4�y�y�(<��c�
���-��-�.��A�"�5�V�T�8L�N���d�S�j�3�&�'��e���y�y�
�m�D�I�I�&�'�r(>�br�hr�col�img�wbr�area�base�link�meta�embed�frame�input�param�trackr��isindex�basefontc	�<�URnURnU[LaU"S[U5-5 GO�U[LaU"S[U5-5 GO�X%nUc0U(aU"[U55 UHn[XUS5 M GObU"SU-5 [
UR55nU(dU(a�U(aH[UR5SS9H+up�U
(aSU
-n
U"SU
<S[U	5<S	35 M- UHhup�[U
[5(aU
Rn
[U	[5(aX)Rn	O[U	5n	U"S
X*<SU	<S	35 Mj U"S5 UR5nU(a&US:XdUS
:Xa	U"U5 OU"[U55 UHn[XUS5 M U[;aU"SU-S-5 UR(aU"[UR55 gg)Nr;r<r�c��US$r>r!r?s r)r�!_serialize_html.<locals>.<lambda>�rBr(rCr1rDrErFr�r��script�stylerG)r+rErrHr�_serialize_htmlrJr�rKrLr1r�_escape_attrib_htmlr�
HTML_EMPTYrF)r
rGrrrMr+rErvr�rNrO�ltags            r)rere�s���
�(�(�C��9�9�D�
�g�~�
�k�M�$�/�/�0�	�%�	%�
�h��t�,�,�-��k���;���m�D�)�*�����&�$�7��
�#��)�������&�E��
�� &�z�'7�'7�'9�+9�!;���� #�a��A���*�1�-���	!;�"�D�A�!�!�U�+�+��F�F��!�!�U�+�+�"�6�6�N��/��2���&�)�Q�7�8�"�
�#�J��9�9�;�D���8�#�t�w���$�K��-��-�.�����&�$�7���:�%��d�S�j�3�&�'��y�y�
�m�D�I�I�&�'�r(c��UR5HnU"U5 M
 UR(aU"UR5 ggrD)r�rF)r
rG�parts   r)rr�s1���
�
���
�d�� ��y�y�
�d�i�i��r()r��htmlrEc���[R"SU5(a[S5e[[R55Hup#X!:XdX0:XdM[U	M U[U'g)a\Register a namespace prefix.

The registry is global, and any existing mapping for either the
given prefix or the namespace URI will be removed.

*prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
attributes in this namespace will be serialized with prefix if possible.

ValueError is raised if prefix is reserved or is invalid.

zns\d+$z'Prefix format reserved for internal useN)�re�matchrrJr3r�)r7r6rOrNs    r)rr�sX��
�x�x�	�6�"�"��B�C�C��^�)�)�+�,����8�q�{��q�!�-�!�N�3�r(r�rk�rdf�wsdl�xs�xsi�dc)�$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/1999/xhtmlz+http://www.w3.org/1999/02/22-rdf-syntax-ns#z http://schemas.xmlsoap.org/wsdl/z http://www.w3.org/2001/XMLSchemaz)http://www.w3.org/2001/XMLSchema-instancez http://purl.org/dc/elements/1.1/c�P�[SU<S[U5R<S35e)Nzcannot serialize z (type �))r3rur"r�s r)r4r4�s!��
�+/��d��1D�1D�E�
�
r(c���SU;aURSS5nSU;aURSS5nSU;aURSS5nU$![[4a [U5 gf=f)N�&�&amp;r��&lt;r��&gt;��replacer3r+r4r�s r)rHrH�so��)��$�;��<�<��W�-�D��$�;��<�<��V�,�D��$�;��<�<��V�,�D�����~�&�)�"�4�(�)���A	A�A*�)A*c��SU;aURSS5nSU;aURSS5nSU;aURSS5nSU;aURSS5nS	U;aURS	S
5nSU;aURSS5nS
U;aURS
S5nU$![[4a [U5 gf=f)Nrxryr�rzr�r{rF�&quot;�
z&#13;rz&#10;�	z&#09;r|r�s r)rLrLs���)��$�;��<�<��W�-�D��$�;��<�<��V�,�D��$�;��<�<��V�,�D��4�<��<�<��h�/�D��4�<��<�<��g�.�D��4�<��<�<��g�.�D��4�<��<�<��g�.�D�����~�&�)�"�4�(�)�s�B)B,�,C
�	C
c���SU;aURSS5nSU;aURSS5nSU;aURSS5nU$![[4a [U5 gf=f)Nrxryr�r{rFr�r|r�s r)rfrfsm��	)��$�;��<�<��W�-�D��$�;��<�<��V�,�D��4�<��<�<��h�/�D�����~�&�)�"�4�(�)�r~T)r
rr�c	��US:Xa[R"5O[R"5n[U5R	XaUUUUS9 UR5$)a�Generate string representation of XML element.

All subelements are included.  If encoding is "unicode", a string
is returned. Otherwise a bytestring is returned.

*element* is an Element instance, *encoding* is an optional output
encoding defaulting to US-ASCII, *method* is an optional output which can
be one of "xml" (default), "html", "text" or "c14n", *default_namespace*
sets the default XML namespace (for "xmlns").

Returns an (optionally) encoded string containing the XML data.

r�r
rrr�)r"�StringIO�BytesIOrr
�getvalue)r-r	rr
rr��streams       r)rr+sT�� '�)�3�R�[�[�]�����F������v�/>�1B�&,�4H�	�J�
�?�?��r(c�6�\rSrSrSrSrSrSrSrSr	Sr
g	)
�_ListDataStreamiCz7An auxiliary stream accumulating into a list reference.c��XlgrD��lst)r7r�s  r)r9�_ListDataStream.__init__Es���r(c��grr!r=s r)r(�_ListDataStream.writableH���r(c��grr!r=s r)r)�_ListDataStream.seekableKr�r(c�:�URRU5 grD)r�rh)r7�bs  r)r
�_ListDataStream.writeNs��������r(c�,�[UR5$rD)rKr�r=s r)r*�_ListDataStream.tellQs���4�8�8�}�r(r�N)r"r#r$r%r&r9r(r)r
r*r'r!r(r)r�r�Cs��A�����r(r�c	�X�/n[U5n[U5RXqUUUUS9 U$)Nr�)r�rr
)r-r	rr
rr�r�r�s        r)rrTsA��
�C�
�S�
!�F������v�/>�1B�&,�4H�	�J�
�Jr(c��[U[5(d[U5nUR[RSS9 UR5RnU(a	USS:wa [RRS5 gg)aWrite element tree or element structure to sys.stdout.

This function should be used for debugging only.

*elem* is either an ElementTree, or a single Element.  The exact output
format is implementation dependent.  In this version, it's written as an
ordinary XML file.

r)r	���rN)r1rr
�sys�stdoutr�rF)rGrFs  r)rrase���d�K�(�(��4� ���J�J�s�z�z�I�J�.��<�<�>���D��4��8�t�#��
�
�����$r(c��^^^�[U[5(aUR5nUS:a[SU35e[	U5(dgSUT--/mUUU4SjmT"US5 g)a�Indent an XML document by inserting newlines and indentation space
after elements.

*tree* is the ElementTree or Element to modify.  The (root) element
itself will not be changed, but the tail text of all elements in its
subtree will be adapted.

*space* is the whitespace to insert for each indentation level, two
space characters by default.

*level* is the initial indentation level. Setting this to a higher
value than 0 can be used for indenting subtrees that are more deeply
nested inside of a document.
rz,Initial indentation level must be >= 0, got Nrc��>�US-nTUnUR(aURR5(dX0lUHSn[	U5(aT"XB5 UR
(a!UR
R5(aMMX4lMU WR
R5(dTUUlgg![a TUT-nTRU5 N�f=fr>)�
IndexErrorrhrE�striprKrF)rG�level�child_level�child_indentation�child�_indent_children�indentations�spaces     ���r)r�� indent.<locals>._indent_children�s�����a�i��	3� ,�[� 9��
�y�y��	�	��� 1� 1�)�I��E��5�z�z� ��4��:�:�U�Z�Z�%5�%5�%7�%7�.�
�	��z�z���!�!�%�e�,�E�J�"���	3� ,�U� 3�e� ;����� 1�2�	3�s�C�#C-�,C-)r1rr�rrK)�treer�r�r�r�s ` @@r)rrtsg����$��$�$��|�|�~���q�y��G��w�O�P�P��t�9�9���5�5�=�(�)�L�-�,�T�1�r(c�<�[5nURX5 U$)z�Parse XML document into element tree.

*source* is a filename or file object containing XML data,
*parser* is an optional parser instance defaulting to XMLParser.

Return an ElementTree instance.

)rr)r�r�r�s   r)rr�s���=�D��J�J�v���Kr(c�^^^^^	�[XS9m[TS5(d[TS5mSmOSmUUU	4SjnU"T5m"UUU4SjS[RR
5nU"5nS	Ul[R"U5m	U$)
a&Incrementally parse XML document into ElementTree.

This class also reports what's going on to the user based on the
*events* it is initialized with.  The supported events are the strings
"start", "end", "start-ns" and "end-ns" (the "ns" events are used to get
detailed namespace information).  If *events* is omitted, only
"end" events are reported.

*source* is a filename or file object containing XML data, *events* is
a list of events to report back, *parser* is an optional parser instance.

Returns an iterator providing (event, elem) pairs.

)�events�_parserr�r�TFc3�|># �TR5Shv�N URS5nU(dOTRU5 MDTR5nTR5Shv�N T"5nUbX#lT(aUR5 ggN�N/!T(aUR5 ff=f7f)Ni@)�read_eventsr�r��_close_and_return_root�rootr�)r�r�r��itr��
pullparser�wrs    ���r)�iterator�iterparse.<locals>.iterator�s�����	��%�1�1�3�3�3��{�{�9�-��������%�
��4�4�6�D�!�-�-�/�/�/���B��~���������4�
0��
������s?�B<�B�B�AB�-B�.B�B<�B�B�B9�9B<c�N>�\rSrSrYRrUUU4SjrUU4SjrSrg)�$iterparse.<locals>.IterParseIteratori�c�T>�T(aTR5 TR5 grD�r�)r7r��genr�s ���r)r��*iterparse.<locals>.IterParseIterator.close�s���������I�I�Kr(c�6>�T(aTR5 ggrDr�)r7r�r�s ��r)�__del__�,iterparse.<locals>.IterParseIterator.__del__�s��������r(r!N)r"r#r$r%�__next__r�r�r')r�r�r�s���r)�IterParseIteratorr��s����<�<��	�
	�	r(r�N)	rr,r��collections�abc�Iteratorr��weakref�ref)
r�r�r�r�r�r�r�r�r�r�s
`     @@@@r)r
r
�s����"�f�=�J��6�6�"�"��f�d�#�������$�6�
�C���K�O�O�4�4��
�	�B��B�G�	���R��B�
�Ir(c�D�\rSrSrSSS.SjjrSrSrSrSrS	r	S
r
g)ri�N)r�c���[R"5UlU=(d [[	5S9UlUcSnUR
R
URU5 g)N�r�)�end)r��deque�
_events_queuerrr��
_setevents)r7r�r�s   r)r9�XMLPullParser.__init__�sL��
)�.�.�0����A�)�;�=�"A����>��F������� 2� 2�F�;r(c���URc[S5eU(aURRU5 gg![a%nURRU5 SnAgSnAff=f)�Feed encoded data to parser.Nz!feed() called after end of stream)r�rr��SyntaxErrorr�rh)r7r��excs   r)r��XMLPullParser.feeds`���<�<���@�A�A��
/����!�!�$�'����
/��"�"�)�)�#�.�.��
/�s�>�
A-�A(�(A-c�H�URR5nSUlU$rD)r�r�)r7r�s  r)r��$XMLPullParser._close_and_return_roots ���|�|�!�!�#������r(c�$�UR5 g)z�Finish feeding data to parser.

Unlike XMLParser, does not return the root element. Use
read_events() to consume elements from XMLPullParser.
N)r�r=s r)r��XMLPullParser.closes��	
�#�#�%r(c#�# �URnU(a5UR5n[U[5(aUeUv� U(aM4gg7f)z�Return an iterator over currently available (event, elem) pairs.

Events are consumed from the internal event queue as they are
retrieved from the iterator.
N)r��popleftr1�	Exception)r7r��events   r)r��XMLPullParser.read_eventss?����#�#����N�N�$�E��%��+�+������f�s�AA�
Ac�h�URc[S5eURR5 g)Nz"flush() called after end of stream)r�r�flushr=s r)r��XMLPullParser.flush+s(���<�<���A�B�B������r()r�r�rD)r"r#r$r%r9r�r�r�r�r�r'r!r(r)rr�s'��
<�t�
<�/��&��r(rc�t�U(d[[5S9nURU5 UR5$)aParse XML document from string constant.

This function can be used to embed "XML Literals" in Python code.

*text* is a string containing XML data, *parser* is an
optional parser instance, defaulting to the standard XMLParser.

Returns an Element instance.

r��rrr�r�)rEr�s  r)rr1s+����+�-�0��
�K�K����<�<�>�r(c���U(d[[5S9nURU5 UR5n0nUR	5H!nURS5nU(dMXCU'M# X#4$)aParse XML document from string constant for its IDs.

*text* is a string containing XML data, *parser* is an
optional parser instance, defaulting to the standard XMLParser.

Returns an (Element, dict) tuple, in which the
dict maps element id:s to elements.

r�r<)rrr�r�r�r�)rEr�r��idsrGr<s      r)rrBsb����+�-�0��
�K�K����<�<�>�D�
�C��	�	���
�X�X�d�^��
�2���G���9�r(c��U(d[[5S9nUHnURU5 M UR5$)z�Parse XML document from sequence of string fragments.

*sequence* is a list of other sequence, *parser* is an optional parser
instance, defaulting to the standard XMLParser.

Returns an Element instance.

r�r�)�sequencer�rEs   r)rrZs5����+�-�0�������D����<�<�>�r(c�d�\rSrSrSrSSSSSS.SjjrSrSrS	rS
r	Sr
SrSS
jrSr
Srg)rilaGeneric element structure builder.

This builder converts a sequence of start, data, and end method
calls to a well-formed element structure.

You can use this class to build an element structure using a custom XML
parser, or a parser for some other XML-like format.

*element_factory* is an optional element factory which is called
to create new Element instances, as necessary.

*comment_factory* is a factory to create comments to be used instead of
the standard factory.  If *insert_comments* is false (the default),
comments will not be inserted into the tree.

*pi_factory* is a factory to create processing instructions to be used
instead of the standard factory.  If *insert_pis* is false (the default),
processing instructions will not be inserted into the tree.
NF)�comment_factory�
pi_factory�insert_comments�
insert_pisc��/Ul/UlSUlSUlSUlUc[
nX lX@lUc[nX0l	XPl
Uc[nXlgrD)
�_data�_elem�_lastr��_tailr�_comment_factoryr�r�_pi_factoryr�r�_factory)r7�element_factoryr�r�r�r�s      r)r9�TreeBuilder.__init__�sd����
���
���
���
���
��"�%�O� /��.����.�J�%��$���"�%�O�'�
r(c��[UR5S:XdS5eURcS5eUR$)z;Flush builder buffers and return toplevel document Element.rzmissing end tagszmissing toplevel element)rKr�r�r=s r)r��TreeBuilder.close�s>���4�:�:��!�#�7�%7�7�#��z�z�%�A�'A�A�%��z�z�r(c�b�UR(a�URb�SRUR5nUR(a/URRbS5eXRlO.URR
bS5eXRl/Ulgg)Nr/zinternal error (tail)zinternal error (text))r�r��joinr�rFrE�r7rEs  r)�_flush�TreeBuilder._flush�s~���:�:��z�z�%��w�w�t�z�z�*���:�:��:�:�?�?�2�K�4K�K�2�&*�J�J�O��:�:�?�?�2�K�4K�K�2�&*�J�J�O��D�J�r(c�:�URRU5 g)zAdd text to current element.N)r�rh�r7r�s  r)r��TreeBuilder.data�s���
�
���$�r(c� �UR5 URX5=UlnUR(aURSR	U5 OUR
cX0lURR	U5 SUlU$)znOpen new element and return it.

*tag* is the element name, *attrs* is a dict containing element
attributes.

r�r)r�r�r�r�rhr�r�)r7r+�attrsrGs    r)�start�TreeBuilder.start�sl��	
���
� �M�M�#�5�5��
�T��:�:��J�J�r�N�!�!�$�'�
�Z�Z�
��J��
�
���$����
��r(c��UR5 URR5UlURRU:Xd$SURR<SU<S35eSUlUR$)z?Close and return current Element.

*tag* is the element name.

zend tag mismatch (expected z, got rvr)r�r��popr�r+r�r�s  r)r��TreeBuilder.end�sa��	
���
��Z�Z�^�^�%��
��z�z�~�~��$�	(��:�:�>�>�3�(�	(�$���
��z�z�r(c�P�URURURU5$)zPCreate a comment using the comment_factory.

*text* is the text of the comment.
)�_handle_singler�r�r�s  r)�comment�TreeBuilder.comment�s*��
�"�"��!�!�4�#7�#7��?�	?r(c�P�URURURX5$)z�Create a processing instruction using the pi_factory.

*target* is the target name of the processing instruction.
*text* is the data of the processing instruction, or ''.
)r	r�r�)r7r�rEs   r)�pi�TreeBuilder.pi�s(���"�"����d�o�o�v�=�	=r(c��U"U6nU(aLUR5 X@lUR(aURSRU5 SUlU$)Nr�r)r�r�r�rhr�)r7�factoryrq�argsrGs     r)r	�TreeBuilder._handle_single�sE����~����K�K�M��J��z�z��
�
�2��%�%�d�+��D�J��r()
r�r�r�r�r�r�r�r�r�r�rD)r"r#r$r%r&r9r�r�r�rr�r
r
r	r'r!r(r)rrlsC���&(�!%�$�!&�5�(�(�
� ��"�?�=�r(rc�j�\rSrSrSrSSS.SjrSrSrSrS	r	S
r
SrSrS
r
SrSrSrSrg)ri�aMElement structure builder for XML source data based on the expat parser.

*target* is an optional target object which defaults to an instance of the
standard TreeBuilder class, *encoding* is an optional encoding string
which if given, overrides the encoding specified in the XML file:
http://www.iana.org/assignments/character-sets

N)r�r	c��SSKJn UR	US5nUc
[5nU=UlUlU=UlUl	URUl0UlURUl[US5(aUR Ul[US5(aUR$Ul[US5(aUR(Ul[US5(aUR,Ul[US	5(aUR0Ul[US
5(aUR4Ul[US5(aUR8UlSUlSUlSUl 0Ul!S
URD-Ul#g![a" SSKnGN�![a [S5ef=ff=f![Ha gf=f)Nr��expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�rr��start_ns�end_nsr�r
r
rzExpat %d.%d.%d)%�xml.parsersr�ImportError�pyexpat�ParserCreaterr�r�r��_target�error�_error�_names�_default�DefaultHandlerExpandr,�_start�StartElementHandler�_end�EndElementHandler�	_start_ns�StartNamespaceDeclHandler�_end_ns�EndNamespaceDeclHandlerr��CharacterDataHandlerr
�CommentHandlerr
�ProcessingInstructionHandler�buffer_text�ordered_attributes�_doctype�entity�version_info�versionr+)r7r�r	rr�s     r)r9�XMLParser.__init__�s���	�)��#�#�H�c�2���>� �]�F�%+�+���d�l�%+�+���d�l��k�k������&*�m�m��#��6�7�#�#�)-���F�&��6�5�!�!�'+�y�y�F�$��6�:�&�&�/3�~�~�F�,��6�8�$�$�-1�\�\�F�*��6�6�"�"�*0�+�+�F�'��6�9�%�%�$*�N�N�F�!��6�4� � �28�)�)�F�/����$%��!���
����	�+�e�.@�.@�@�D�L��M�	�
�'���
�!�M���
��	��N�	��	�s/�F�7F;�
F8�F�F4�4F8�;
G�Gc�B�URnURnUGHnUS:Xa SUlXTUR4SjnXclM*US:XaXTUR
4SjnXclMIUS:Xa;[URS5(aXTUR4SjnOXT4S	jnXcl
M�US
:Xa;[URS5(aXTUR4SjnOXT4S
jnXclM�US:XaXTU4SjnXcl
M�US:XaXTU4SjnXclM�[SU-5e g)Nrrc�"�U"X$"X545 grDr!)r+�	attrib_inr�rhrs     r)�handler�%XMLParser._setevents.<locals>.handler)s���E�5��#8�9�:r(r�c�"�U"X"U545 grDr!)r+r�rhr�s    r)r8r9.s���E�3�s�8�,�-r(zstart-nsrc�"�U"X$"X545 grDr!)r7r6r�rhrs     r)r8r95s����x��'<�=�>r(c�>�U"X =(d SU=(d S445 g�Nr/r!)r7r6r�rhs    r)r8r99s�����"�c�i�R�'@�A�Br(zend-nsrc�"�U"X"U545 grDr!)r7r�rhrs    r)r8r9?s����v�f�~�6�7r(c��U"US45 grDr!)r7r�rhs   r)r8r9Cs����t�}�-r(r
c�H�U"XRRU545 grD)r�r
)rEr�rhr7s    r)r8r9Gs���E�;�;�#6�#6�t�#<�=�>r(r
c�H�U"X$RRX545 grD)r�r
)�	pi_targetr�r�rhr7s     r)r8r9Ks���E�;�;�>�>�)�#B�C�Dr(zunknown event %r)r�rhr/r#r$r%r&r,r�r'r(r)r*r,r-r)r7�events_queue�events_to_reportr�rh�
event_namer8s       r)r��XMLParser._seteventss�������$�$��*�J��W�$�,-��)�2<�"&�+�+�;�.5�*��u�$�'1� $�	�	�.�,3�(��z�)��4�;�;�
�3�3�3=�)-���?�4>�C�3:�0��x�'��4�;�;��1�1�.8�'+�|�|�8�/9�.�18�.��y�(�(2��?�(/�%��t�#�3=�!%�E�7>�3� �!3�j�!@�A�A�U+r(c�x�[U5nURUlURUR4UlUerD)r�code�lineno�offset�position)r7r��errs   r)�_raiseerror�XMLParser._raiseerrorRs0�������:�:����|�|�U�\�\�1����	r(c�~�URUnU$![a UnSU;aSU-nX RU'U$f=f)Nr�r�)r �KeyError)r7r��names   r)�_fixname�XMLParser._fixnameXsS��	$��;�;�s�#�D�����	$��D��d�{��T�z��#�K�K�����	$�s��%<�<c�^�URRU=(d SU=(d S5$r=)r�r�r7r7r6s   r)r'�XMLParser._start_nscs!���{�{�#�#�F�L�b�#�)��<�<r(c�J�URRU=(d S5$r=)r�r)r7r7s  r)r)�XMLParser._end_nsfs���{�{�!�!�&�,�B�/�/r(c���URnU"U5n0nU(a.[S[U5S5HnX%S-XC"X%5'M URR	X5$)NrrOr)rR�rangerKr�r)r7r+�	attr_list�fixnamer5�is      r)r#�XMLParser._startisa���-�-���c�l������1�c�)�n�a�0��09�A�#���w�y�|�,�-�1��{�{� � ��-�-r(c�V�URRURU55$rD)r�r�rRr�s  r)r%�XMLParser._endus���{�{���t�}�}�S�1�2�2r(c�L�USSnUS:Xa1URRnU"URUSS5 gUS:XaUSS	S
:Xa/UlgURGb"US:XaSUlgUR5nU(dgURR!U5 [#UR5nUS:�a�URSnUS
:Xa"US:XaURup�p�U	(aU	SSn	OUS:XaUS:XaURup�n
Sn	Og[%URS5(a URR'X�U
SS5 O,[%US5(a[(R*"S[,5 SUlggg![a gf=f![a� SSKJn URSXRRURR4-5nSUlURRUlURRUl
Uef=f)Nrrxr�rrz'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�rO�PUBLIC��SYSTEM��doctypezaThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.)r�r�r+r1rPrrrr��ErrorLineNumber�ErrorColumnNumberrHrIrJr0r�rhrKr,rhrRrS�RuntimeWarning)r7rEr7�data_handlerrrL�nrurQ�pubid�systems           r)r!�XMLParser._defaultxs����b�q����S�=�
�#�{�{�/�/��
��T�[�[��a���4�5��s�]�t�B�Q�x�;�6��D�M�
�]�]�
&���}� $��
���:�:�<�D����M�M� � ��&��D�M�M�"�A��1�u��}�}�Q�'���8�#��Q��04�
�
�-�D��� %�a������X�%�!�q�&�)-���&�D�� �E���4�;�;�	�2�2��K�K�'�'��V�A�b�\�B��T�9�-�-��M�M�M�&�(�
!%��
�'�'��#"�
��
���

�-��k�k�=��;�;�6�6��K�K�1�1�3�3���
���!�[�[�8�8��
�!�[�[�:�:��
��	�

�s�F�F�
F�F�BH#c��URRUS5 g!URanURU5 SnAgSnAff=f)r�FN)r��ParserrM)r7r�rNs   r)r��XMLParser.feed�s@��	 ��K�K���d�E�*���{�{�	 ����Q����	 �s��A
�A�A
c�2�URRSS5 URR
nU"5U?U?U?U?$!URanURU5 SnANLSnAff=f![a Of=fU?U?U?U?g!U?U?U?U?f=f)z;Finish feeding data to parser and return element structure.r(TN)	r�rrrrMr�r�r�rr+)r7rN�
close_handlers   r)r��XMLParser.close�s���	 ��K�K���c�4�(�		*� �K�K�-�-�M�!�?���T�\���T�\���{�{�	 ����Q����	 ���	��	���
��T�\���T�\����T�\���T�\�s?�A�A2�B�A/�A*�*A/�2
A?�<B�>A?�?B�
Bc�z�URR5nURRS5 URRSS5 URRU5 g!URanURU5 SnANBSnAff=f!URRU5 f=f)NFr()r��GetReparseDeferralEnabled�SetReparseDeferralEnabledrrrrM)r7�was_enabledrNs   r)r��XMLParser.flush�s����k�k�;�;�=��	?��K�K�1�1�%�8��K�K���c�5�)�
�K�K�1�1�+�>���{�{�	 ����Q����	 ��
�K�K�1�1�+�>�s)�7A/�/B�?B�B�B�B�B:)	r0rr r�rr1r�r�r3)r"r#r$r%r&r9r�rMrRr'r)r#r%r!r�r�r�r'r!r(r)rr�sN���"&��+�Z3B�j�	�=�0�
.�3�4%�l �*�"?r(r)�out�	from_filec� �UcUc[S5eSnUc[R"5=pA[[	UR
40UD6S9nUb"UR
U5 UR5 OUb	[X%S9 UbUR5$S$)aConvert XML to its C14N 2.0 serialised form.

If *out* is provided, it must be a file or file-like object that receives
the serialised canonical XML output (text, not bytes) through its ``.write()``
method.  To write to a file, open it in text mode with encoding "utf-8".
If *out* is not provided, this function returns the output as text string.

Either *xml_data* (an XML string) or *from_file* (a file path or
file-like object) must be provided as input.

The configuration options are the same as for the ``C14NWriterTarget``.
Nz:Either 'xml_data' or 'from_file' must be provided as inputr�)r�)
rr"r�rrr
r�r�rr�)�xml_datar|r}�options�sior�s      r)rr�s�����I�-��U�V�V�
�C�
�{��K�K�M�!��
�.�s�y�y�D�G�D�
E�F������H������	�	�
�i�'� �_�3�<�<�>�6�$�6r(z	^\w+:\w+$c��\rSrSrSrSSSSSSSS.Sjr\4SjrSrSS	jr	S
r
SR4SjrS
r
SrSSjrSrSrSrSrg)ri�a�
Canonicalization writer target for the XMLParser.

Serialises parse events to XML C14N 2.0.

The *write* function is used for writing out the resulting data stream
as text (not bytes).  To write to a file, open it in text mode with encoding
"utf-8" and pass its ``.write`` method.

Configuration options:

- *with_comments*: set to true to include comments
- *strip_text*: set to true to strip whitespace before and after text content
- *rewrite_prefixes*: set to true to replace namespace prefixes by "n{number}"
- *qname_aware_tags*: a set of qname aware tag names in which prefixes
                      should be replaced in text content
- *qname_aware_attrs*: a set of qname aware attribute names in which prefixes
                       should be replaced in text content
- *exclude_attrs*: a set of attribute names that should not be serialised
- *exclude_tags*: a set of tag names that should not be serialised
FN)�
with_comments�
strip_text�rewrite_prefixes�qname_aware_tags�qname_aware_attrs�
exclude_attrs�exclude_tagsc�\�Xl/UlX lX0lU(a[	U5OSUlU(a[	U5OSUlX@lU(a[	U5UlOSUlU(a[	U5RUl
OSUl
S//Ul/UlU(d6URR[[R!555 URR/5 0UlS/UlSUlSUlSUlSUlg)N)rtr�Fr)�_writer��_with_comments�_strip_textr��_exclude_attrs�
_exclude_tags�_rewrite_prefixes�_qname_aware_tags�intersection�_find_qname_aware_attrs�_declared_ns_stack�	_ns_stackrhrJr3r��_prefix_map�_preserve_space�_pending_start�
_root_seen�
_root_done�_ignored_depth)	r7r
r�r�r�r�r�r�r�s	         r)r9�C14NWriterTarget.__init__
s�������
�+��%��4A�c�-�0�t���2>�S��.�D���!1���%(�)9�%:�D�"�%)�D�"��+.�/@�+A�+N�+N�D�(�+/�D�(�
<�$
�#��������N�N�!�!�$�~�';�';�'=�">�?������b�!���� %�w���"�����������r(c#�T# �U"U5HnU(dMUShv�N M gN	7frDr!)r7�ns_stack�	_reversedrs    r)�_iter_namespaces�!C14NWriterTarget._iter_namespaces/s%���#�H�-�J��z�%�%�%�.�%�s�(�(�&�
(c��URSS5up#URUR5HupEXR:XdMSUSU3s $ [SUSUS35e)Nr1rr�r�zPrefix z of QName "�" is not declared in scope)�splitr�r�r)r7�
prefixed_namer7rQr6�ps      r)�_resolve_prefix_name�%C14NWriterTarget._resolve_prefix_name4sf��$�*�*�3��2����+�+�D�N�N�;�F�C��{��C�5��4�&�)�)�<��7�6�(�+�m�_�D^�_�`�`r(c��Uc%USSS:XaUSSRSS5OSU4up#OUn[5nURUR5H4upVXR:XaXd;aU(aUSU3OUX24s $UR	U5 M6 UR
(amX R;aURUnO&S[UR53=o`RU'URSRX&45 USU3X24$U(d
SU;aX3U4$URUR5H=upVXR:XdMURSRX&45 U(aUSU3OUX24s $ U(dX3U4$[SUS	35e)
Nrr�r�r/r1rmr�zNamespace "r�)r2r�r�r��addr�r�rKrhr�r)r7r5r6r+�
prefixes_seen�ur7s       r)�_qname�C14NWriterTarget._qname;s����;�38��!�9��3C�u�Q�R�y�'�'��Q�/�"�e��H�C���C���
��.�.�t�/F�/F�G�I�A��x�F�7�,2�&���3�%�(��S�E�E����f�%�H��!�!��&�&�&��)�)�#�.��34�S��9I�9I�5J�4K�1L�L��)�)�#�.��#�#�B�'�.�.��}�=��X�Q�s�e�$�c�.�.��r��.��S�=� ��.�.�t�~�~�>�I�A��x��'�'��+�2�2�C�=�A�,2�&���3�%�(��S�E�E�?�
��S�=� ��;�s�e�+E�F�G�Gr(c�^�UR(dURRU5 ggrD)r�r�rhr�s  r)r��C14NWriterTarget.data`s"���"�"��J�J���d�#�#r(r/c��U"UR5nURSS2	UR(a$URS(dUR5nURbFURSso0lU(a[U5(aUOSnUR"/UQUP76 UbgU(a-UR(aUR[U55 ggg�Nr�)
r�r�r�r�r��_looks_like_prefix_namer#r�r��_escape_cdata_c14n)r7�
_join_textr�r�
qname_texts     r)r��C14NWriterTarget._flushds����$�*�*�%���J�J�q�M����D�$8�$8��$<��:�:�<�D����*�(,�(;�(;�T�%�D�%�!%�*A�$�*G�*G��T�J��K�K�*��*�z�*��%���D�O�O��K�K�*�4�0�1�$�4r(c��UR(agUR(aUR5 URSR	X!45 gr�)r�r�r�r�rhrUs   r)r�C14NWriterTarget.start_nsrs7�������:�:��K�K�M����r��!�!�3�-�0r(c�v�URb6UR(dXR;aU=RS-
slgUR(aUR5 /nURRU5 URbXR;a
XU4UlgURXU5 gr>)	r�r�r�r�r�rhr�r�r#)r7r+r�new_namespacess    r)r�C14NWriterTarget.startzs������)��#�#�s�.@�.@�'@����1�$����:�:��K�K�M������&�&�~�6��!�!�-�#�9O�9O�2O�#&�~�">�D������C��/r(c��URb<U(a5UR5VVs0sHupVXPR;dMXV_M nnnU1Ukn0nUb&URU5=o�U'URU	5 URbhU(aaUR	U5n
U
(aFU
H?nX+n[U5(dMURU5=o�U'URU	5 MA OSn
OSn
URn
[USS9Vs0sHo�U
"U5_M
 nnU(a6UVVs/sHunnU(aSU-OSU4PM nnnUR5 O/nU(a][UR55H@upVU
bXZ;aXh;a
X�USnX�unnnURU(aUOUU45 MB URS5nURRU(aUS:HOURS5 URnU"S	X�S-5 U(a<U"S
RUVVs/sHupVSUS[U5S
3PM snn55 U"S5 UbU"[X�US55 SUlUR"R/5 gs snnfs snfs snnfs snnf)Nc�&�URSS5$)Nr�r)r�)rms r)r�)C14NWriterTarget._start.<locals>.<lambda>�s��!�'�'�#�q�/r(rCzxmlns:�xmlnsrz+{http://www.w3.org/XML/1998/namespace}space�preserver�r�r/r�rErFr�T)r�r�r�r�r�r�r�rK�sortrhr�r�r�r��_escape_attrib_c14nr�r�r�)r7r+rr�r�rOrNr�resolved_namesr5�qattrs�	attr_namer��parse_qnamerm�
parsed_qnamesr6r7r[�
attr_qname�space_behaviourr
s                      r)r#�C14NWriterTarget._start�s������*�u�&+�k�k�m�T�m�d�a�q�@S�@S�7S�T�Q�T�m�E�T���������!�15�1J�1J�:�1V�V�E�:�.��J�J�u���'�'�3���1�1�%�8�F��!'�I�!�,�E�.�u�5�5�8<�8Q�8Q�RW�8X�X��u� 5��
�
�5�)�	"(����F��k�k��4:��1�53�4�53�q�K��N�*�53�
�4��$2��#1�K�C��'-��F�"�'�3�?�#1�
��
�N�N���I���u�{�{�}�-����%�!�+�!�:M�%�Q�&7�8��;�A�-:�-=�*�
�I�s�� � ��*��A�!F�G�.� �)�)�$Q�R�����#�#�-<�O�z�)��%�%�b�)�	+�
����
�c�M�&�q�)�)�*���"�'�'�)�T�)�$�!�Q�q�c��$7��$:�#;�1�=�)�T�U�V�
�c�
��!��$�]�*�3M�%N�q�%Q�R�S���������b�!��CU��04��
��8Us�J,�J,�
J2�*J7�;J=c��UR(aU=RS-slgUR(aUR5 URSUR	U5SS35 UR
R
5 [UR
5S:HUlURR
5 URR
5 g)NrrGrr�)r�r�r�r�r�r�rrKr�r�r�r�s  r)r��C14NWriterTarget.end�s���������1�$����:�:��K�K�M����b����S�)�!�,�-�Q�/�0���� � �"��d�2�2�3�q�8������#�#�%������r(c�x�UR(dgUR(agUR(aURS5 O2UR(a!UR
(aUR
5 URS[U5S35 UR(dURS5 gg)Nrz<!--z-->)r�r�r�r�r�r�r�r�r�s  r)r
�C14NWriterTarget.comment�sw���"�"�������?�?��K�K���
�_�_�����K�K�M����d�-�d�3�4�C�8�9�����K�K���r(c�t�UR(agUR(aURS5 O2UR(a!UR(aUR5 URU(aSUS[
U5S3OSUS35 UR(dURS5 gg)Nrz<?r�z?>)r�r�r�r�r�r�r�)r7r�r�s   r)r
�C14NWriterTarget.pi�s��������?�?��K�K���
�_�_�����K�K�M����:>�b����,�T�2�3�2�6�b���PR�O�	U�����K�K���r()r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rD)r"r#r$r%r&r9�reversedr�r�r�r�r�r�rrr#r�r
r
r'r!r(r)rr�sj���, %���"&�$�#�$�# �J4<�&�
a�#H�J$�!#���2�1�0�"C"�J
��
r(rc�
�SU;aURSS5nSU;aURSS5nSU;aURSS5nSU;aURSS5nU$![[4a [U5 gf=f)	Nrxryr�rzr�r{r��&#xD;r|r�s r)r�r��s���)��$�;��<�<��W�-�D��$�;��<�<��V�,�D��$�;��<�<��V�,�D��4�<��<�<��g�.�D�����~�&�)�"�4�(�)�s�A!A$�$B�Bc�j�SU;aURSS5nSU;aURSS5nSU;aURSS5nSU;aURSS5nS	U;aURS	S
5nSU;aURSS5nU$![[4a [U5 gf=f)
Nrxryr�rzrFr�r�z&#x9;rz&#xA;r�r�r|r�s r)r�r�	s���)��$�;��<�<��W�-�D��$�;��<�<��V�,�D��$�;��<�<��X�.�D��4�<��<�<��g�.�D��4�<��<�<��g�.�D��4�<��<�<��g�.�D�����~�&�)�"�4�(�)�s�BB�B2�1B2)r�)�_set_factoriesrDr�)z  r)@r&�__all__rr�rmrRr"r��collections.abcr r�r/rr�rr	rrrrr
rr�contextmanagerrrrIrgrerrrr3r4rHrLrfrr#r�rrrrr
rrrrrrrr�compile�UNICODErnr�rr�r�rt�_elementtreer�rr!r(r)�<module>r�s��!�P��(��
�	��	������		��		�#�
^�^�B	$&��$�� ��+"�+"�`\/�\/�B���/+��/+�b;�z0(�d�
�0(�d�����
�!�*-2�$*�38�(.�(,�16�(,���%3��!�
�
)� )�8)��!�T�"&��0�b�'�'��"
�!%��&*�
��&/�l�<�~7�7�t�"�,�
�
�$v�v�th?�h?�Z7�t�t�7�<�*�*�\�2�:�:�>�D�D����D)�&)�.3��K��+��7�1�2���	��	�s�%
E<�<F�F

?>