/home/lnzliplg/public_html/etree.zip
PKE�\E��g%%ElementPath.pynu�[���#
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl   created
# 2003-05-28 fl   added support for // etc
# 2003-08-27 fl   fixed parsing of periods in element names
# 2007-09-10 fl   new selection engine
# 2007-09-12 fl   fixed parent selector
# 2007-09-13 fl   added iterfind; changed findall to return a list
# 2007-11-30 fl   added namespaces support
# 2009-10-30 fl   added child element value filter
#
# Copyright (c) 2003-2009 by Fredrik Lundh.  All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2009 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.

##
# Implementation module for XPath support.  There's usually no reason
# to import this module directly; the <b>ElementTree</b> does this for
# you, if needed.
##

import re

xpath_tokenizer_re = re.compile(
    "("
    "'[^']*'|\"[^\"]*\"|"
    "::|"
    "//?|"
    "\.\.|"
    "\(\)|"
    "[/.*:\[\]\(\)@=])|"
    "((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|"
    "\s+"
    )

def xpath_tokenizer(pattern, namespaces=None):
    for token in xpath_tokenizer_re.findall(pattern):
        tag = token[1]
        if tag and tag[0] != "{" and ":" in tag:
            try:
                prefix, uri = tag.split(":", 1)
                if not namespaces:
                    raise KeyError
                yield token[0], "{%s}%s" % (namespaces[prefix], uri)
            except KeyError:
                raise SyntaxError("prefix %r not found in prefix map" % prefix)
        else:
            yield token

def get_parent_map(context):
    parent_map = context.parent_map
    if parent_map is None:
        context.parent_map = parent_map = {}
        for p in context.root.iter():
            for e in p:
                parent_map[e] = p
    return parent_map

def prepare_child(next, token):
    tag = token[1]
    def select(context, result):
        for elem in result:
            for e in elem:
                if e.tag == tag:
                    yield e
    return select

def prepare_star(next, token):
    def select(context, result):
        for elem in result:
            for e in elem:
                yield e
    return select

def prepare_self(next, token):
    def select(context, result):
        for elem in result:
            yield elem
    return select

def prepare_descendant(next, token):
    token = next()
    if token[0] == "*":
        tag = "*"
    elif not token[0]:
        tag = token[1]
    else:
        raise SyntaxError("invalid descendant")
    def select(context, result):
        for elem in result:
            for e in elem.iter(tag):
                if e is not elem:
                    yield e
    return select

def prepare_parent(next, token):
    def select(context, result):
        # FIXME: raise error if .. is applied at toplevel?
        parent_map = get_parent_map(context)
        result_map = {}
        for elem in result:
            if elem in parent_map:
                parent = parent_map[elem]
                if parent not in result_map:
                    result_map[parent] = None
                    yield parent
    return select

def prepare_predicate(next, token):
    # FIXME: replace with real parser!!! refs:
    # http://effbot.org/zone/simple-iterator-parser.htm
    # http://javascript.crockford.com/tdop/tdop.html
    signature = []
    predicate = []
    while 1:
        token = next()
        if token[0] == "]":
            break
        if token[0] and token[0][:1] in "'\"":
            token = "'", token[0][1:-1]
        signature.append(token[0] or "-")
        predicate.append(token[1])
    signature = "".join(signature)
    # use signature to determine predicate type
    if signature == "@-":
        # [@attribute] predicate
        key = predicate[1]
        def select(context, result):
            for elem in result:
                if elem.get(key) is not None:
                    yield elem
        return select
    if signature == "@-='":
        # [@attribute='value']
        key = predicate[1]
        value = predicate[-1]
        def select(context, result):
            for elem in result:
                if elem.get(key) == value:
                    yield elem
        return select
    if signature == "-" and not re.match("\d+$", predicate[0]):
        # [tag]
        tag = predicate[0]
        def select(context, result):
            for elem in result:
                if elem.find(tag) is not None:
                    yield elem
        return select
    if signature == "-='" and not re.match("\d+$", predicate[0]):
        # [tag='value']
        tag = predicate[0]
        value = predicate[-1]
        def select(context, result):
            for elem in result:
                for e in elem.findall(tag):
                    if "".join(e.itertext()) == value:
                        yield elem
                        break
        return select
    if signature == "-" or signature == "-()" or signature == "-()-":
        # [index] or [last()] or [last()-index]
        if signature == "-":
            index = int(predicate[0]) - 1
        else:
            if predicate[0] != "last":
                raise SyntaxError("unsupported function")
            if signature == "-()-":
                try:
                    index = int(predicate[2]) - 1
                except ValueError:
                    raise SyntaxError("unsupported expression")
            else:
                index = -1
        def select(context, result):
            parent_map = get_parent_map(context)
            for elem in result:
                try:
                    parent = parent_map[elem]
                    # FIXME: what if the selector is "*" ?
                    elems = list(parent.findall(elem.tag))
                    if elems[index] is elem:
                        yield elem
                except (IndexError, KeyError):
                    pass
        return select
    raise SyntaxError("invalid predicate")

ops = {
    "": prepare_child,
    "*": prepare_star,
    ".": prepare_self,
    "..": prepare_parent,
    "//": prepare_descendant,
    "[": prepare_predicate,
    }

_cache = {}

class _SelectorContext:
    parent_map = None
    def __init__(self, root):
        self.root = root

# --------------------------------------------------------------------

##
# Generate all matching objects.

def iterfind(elem, path, namespaces=None):
    # compile selector pattern
    if path[-1:] == "/":
        path = path + "*" # implicit all (FIXME: keep this?)
    try:
        selector = _cache[path]
    except KeyError:
        if len(_cache) > 100:
            _cache.clear()
        if path[:1] == "/":
            raise SyntaxError("cannot use absolute path on element")
        next = iter(xpath_tokenizer(path, namespaces)).next
        token = next()
        selector = []
        while 1:
            try:
                selector.append(ops[token[0]](next, token))
            except StopIteration:
                raise SyntaxError("invalid path")
            try:
                token = next()
                if token[0] == "/":
                    token = next()
            except StopIteration:
                break
        _cache[path] = selector
    # execute selector pattern
    result = [elem]
    context = _SelectorContext(elem)
    for select in selector:
        result = select(context, result)
    return result

##
# Find first matching object.

def find(elem, path, namespaces=None):
    try:
        return iterfind(elem, path, namespaces).next()
    except StopIteration:
        return None

##
# Find all matching objects.

def findall(elem, path, namespaces=None):
    return list(iterfind(elem, path, namespaces))

##
# Find text for first matching object.

def findtext(elem, path, default=None, namespaces=None):
    try:
        elem = iterfind(elem, path, namespaces).next()
        return elem.text or ""
    except StopIteration:
        return default
PKE�\�b�2��'__pycache__/cElementTree.cpython-38.pycnu�[���U

e5dR�@sddlTdS)�)�*N)Zxml.etree.ElementTree�rr�./usr/lib64/python3.8/xml/etree/cElementTree.py�<module>�PKE�\��J--/__pycache__/ElementInclude.cpython-38.opt-1.pycnu�[���U

e5d�@sPddlZddlmZdZedZedZGdd�de�Zdd	d
�Zd
dd�Z	dS)�N�)�ElementTreez!{http://www.w3.org/2001/XInclude}�includeZfallbackc@seZdZdS)�FatalIncludeErrorN)�__name__�
__module__�__qualname__�r	r	�0/usr/lib64/python3.8/xml/etree/ElementInclude.pyr>src	Cs\|dkr.t|d��}t�|���}W5QRXn*|s6d}t|d|d��}|��}W5QRX|S)N�xml�rbzUTF-8�r)�encoding)�openr�parseZgetroot�read)�hrefrr�file�datar	r	r
�default_loaderMsrcCsh|dkrt}d}|t|�k�rd||}|jtk�r4|�d�}|�dd�}|dkr�|||�}|dkrrtd||f��t�|�}|jr�|jp�d|j|_|||<n�|dk�r&||||�d��}|dkr�td||f��|r�||d	}|jp�d||jp�d|_n|j�pd||j�pd|_||=qntd
|��n&|jt	k�rPtd|j��n
t
||�|d	}qdS)Nrrrrzcannot load %r as %r��textrrz)unknown parse type in xi:include tag (%r)z0xi:fallback tag must be child of xi:include (%r))r�len�tag�XINCLUDE_INCLUDE�getr�copy�tailr�XINCLUDE_FALLBACKr)�elem�loader�i�errZnoderr	r	r
rcsN


�



���
)N)N)
rrrZXINCLUDErr�SyntaxErrorrrrr	r	r	r
�<module>3s
PKE�\�b�2��-__pycache__/cElementTree.cpython-38.opt-1.pycnu�[���U

e5dR�@sddlTdS)�)�*N)Zxml.etree.ElementTree�rr�./usr/lib64/python3.8/xml/etree/cElementTree.py�<module>�PKE�\�%�'��)__pycache__/__init__.cpython-38.opt-2.pycnu�[���U

e5dD�@sdS)N�rrr�*/usr/lib64/python3.8/xml/etree/__init__.py�<module>�PKE�\��J--/__pycache__/ElementInclude.cpython-38.opt-2.pycnu�[���U

e5d�@sPddlZddlmZdZedZedZGdd�de�Zdd	d
�Zd
dd�Z	dS)�N�)�ElementTreez!{http://www.w3.org/2001/XInclude}�includeZfallbackc@seZdZdS)�FatalIncludeErrorN)�__name__�
__module__�__qualname__�r	r	�0/usr/lib64/python3.8/xml/etree/ElementInclude.pyr>src	Cs\|dkr.t|d��}t�|���}W5QRXn*|s6d}t|d|d��}|��}W5QRX|S)N�xml�rbzUTF-8�r)�encoding)�openr�parseZgetroot�read)�hrefrr�file�datar	r	r
�default_loaderMsrcCsh|dkrt}d}|t|�k�rd||}|jtk�r4|�d�}|�dd�}|dkr�|||�}|dkrrtd||f��t�|�}|jr�|jp�d|j|_|||<n�|dk�r&||||�d��}|dkr�td||f��|r�||d	}|jp�d||jp�d|_n|j�pd||j�pd|_||=qntd
|��n&|jt	k�rPtd|j��n
t
||�|d	}qdS)Nrrrrzcannot load %r as %r��textrrz)unknown parse type in xi:include tag (%r)z0xi:fallback tag must be child of xi:include (%r))r�len�tag�XINCLUDE_INCLUDE�getr�copy�tailr�XINCLUDE_FALLBACKr)�elem�loader�i�errZnoderr	r	r
rcsN


�



���
)N)N)
rrrZXINCLUDErr�SyntaxErrorrrrr	r	r	r
�<module>3s
PKE�\�r�� � &__pycache__/ElementPath.cpython-38.pycnu�[���U

e5d>3�@s�ddlZe�d�Zd"dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zeee	ee
ed�Z
iZGdd�d�Zd#dd�Zd$dd�Zd%dd�Zd&d d!�ZdS)'�Nz\('[^']*'|\"[^\"]*\"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+c		cs�|r|�d�nd}d}t�|�D]�}|\}}|r�|ddkr�d|kr�|�dd�\}}z"|s^t�|d|||ffVWq�tk
r�td|�d�Yq�Xn"|r�|s�|d||ffVn|Vd}q |V|d	k}q dS)
N�Fr�{�:�z{%s}%sz!prefix %r not found in prefix map�@)�get�xpath_tokenizer_re�findall�split�KeyError�SyntaxError)	�pattern�
namespacesZdefault_namespaceZparsing_attribute�tokenZttype�tag�prefixZuri�r�-/usr/lib64/python3.8/xml/etree/ElementPath.py�xpath_tokenizerIs&rcCs>|j}|dkr:i|_}|j��D]}|D]}|||<q*q"|S�N)�
parent_map�root�iter)�contextr�p�errr�get_parent_mapas
rcCs |dd�dkp|dd�dkS)N��{*}����}*r�rrrr�_is_wildcard_tagksr"cs�tt���dkr"��fdd�}n��dkr:��fdd�}n��dd�dkr��dd��tt��d���dd�������fd	d�}nL�d
d�dkrƈdd��tdt��������fd
d�}ntd�����|S)Nz{*}*c3s |D]}�|j��r|VqdSrr!�r�result�elem��_isinstance�_strrr�selectusz_prepare_tag.<locals>.selectz{}*c3s0|D]&}|j}�|��r|ddkr|VqdS)Nrrr!�rr$r%Zel_tagr&rrr){srr�c3s8|D].}|j}|�ks,�|��r|��kr|VqdSrr!r*)r'r(�no_ns�suffixrrrr)�srr ���c3s0|D]&}|j}�|��r|��kr|VqdSrr!r*)r'r(�ns�ns_onlyrrr)�szinternal parser error, got )�
isinstance�str�slice�len�RuntimeError)rr)r)r'r(r,r/r0r-rr�_prepare_tagos 
r6csR|d�t��r&t����fdd�}n(�dd�dkrB�dd���fdd�}|S)Nrcsdd�}�|||��S)Ncss|D]}|EdHqdSrr)r$r%rrr�select_child�sz3prepare_child.<locals>.select.<locals>.select_childr�rr$r7��
select_tagrrr)�szprepare_child.<locals>.selectr+�{}c3s(|D]}|D]}|j�kr|VqqdSrr!�rr$r%rr!rrr)�s
)r"r6��nextrr)r�r:rr�
prepare_child�sr@cCsdd�}|S)Ncss|D]}|EdHqdSrrr#rrrr)�szprepare_star.<locals>.selectrr=rrr�prepare_star�srAcCsdd�}|S)Ncss|EdHdSrr)rr$rrrr)�szprepare_self.<locals>.selectrr=rrr�prepare_self�srBcs�z
|�}Wntk
r YdSX|ddkr4d�n|dsF|d�ntd��t��rlt����fdd�}n(�dd�dkr��dd���fd	d�}|S)
Nr�*rzinvalid descendantcsdd�}�|||��S)Ncss*|D] }|��D]}||k	r|VqqdSr�r)r$r%rrrrr7�sz8prepare_descendant.<locals>.select.<locals>.select_childrr8r9rrr)�sz"prepare_descendant.<locals>.selectr+r;c3s,|D]"}|���D]}||k	r|VqqdSrrDr<r!rrr)�s)�
StopIterationrr"r6r=rr?r�prepare_descendant�s 

rFcCsdd�}|S)Ncss@t|�}i}|D]*}||kr||}||krd||<|VqdSr)r)rr$rZ
result_mapr%�parentrrrr)�szprepare_parent.<locals>.selectrr=rrr�prepare_parent�s
rHcsLg}g}z
|�}Wntk
r(YdSX|ddkr8q�|dkrBq|drr|ddd�dkrrd|ddd�f}|�|dp�d�|�|d�qd	�|�}|d
kr�|d��fdd�}|S|d
kr�|d�|d���fdd�}|S|dk�rt�d|d��s|d��fdd�}|S|dk�sB|dk�rxt�d|d��sx|d�|d���rh��fdd�}n�fdd�}|S|dk�s�|dk�s�|dk�r@|dk�r�t|d�d��dk�r0td��nl|ddk�r�td��|dk�r,zt|d�d�Wntk
�rtd��YnX�dk�r0td��nd��fdd�}|Std��dS) Nr�])rrrz'"�'r.�-rz@-c3s"|D]}|���dk	r|VqdSr�rr#)�keyrrr)�sz!prepare_predicate.<locals>.selectz@-='c3s"|D]}|����kr|VqdSrrLr#)rM�valuerrr)sz\-?\d+$c3s"|D]}|���dk	r|VqdSr)�findr#r!rrr)sz.='z-='c3s:|D]0}|���D] }d�|����kr|VqqqdS�Nr)r	�join�itertextr<)rrNrrr)s
c3s&|D]}d�|����kr|VqdSrP)rQrRr#)rNrrr)sz-()z-()-zXPath position >= 1 expectedZlastzunsupported functionr+zunsupported expressionrz)XPath offset from last() must be negativec
3s^t|�}|D]L}z.||}t|�|j��}|�|kr<|VWqttfk
rVYqXqdSr)r�listr	r�
IndexErrorr)rr$rr%rGZelems)�indexrrr)5s
zinvalid predicate)rE�appendrQ�re�match�intr�
ValueError)r>rZ	signatureZ	predicater)r)rUrMrrNr�prepare_predicate�sj

&





r[)rrC�.z..z//�[c@seZdZdZdd�ZdS)�_SelectorContextNcCs
||_dSr)r)�selfrrrr�__init__Psz_SelectorContext.__init__)�__name__�
__module__�__qualname__rr`rrrrr^Nsr^c
Csj|dd�dkr|d}|f}|r6|tt|����7}zt|}W�n�tk
�r@tt�dkrjt��|dd�dkr�td��tt	||��j
}z
|�}Wntk
r�YYdSXg}z|�t
|d||��Wntk
r�td�d�YnXz|�}|ddk�r|�}Wq�tk
�r0Y�q4Yq�Xq�|t|<YnX|g}t|�}|D]}	|	||�}�qT|S)	Nr.�/rC�drz#cannot use absolute path on elementrzinvalid path)�tuple�sorted�items�_cacherr4�clearrrr�__next__rErV�opsr^)
r%�pathrZ	cache_keyZselectorr>rr$rr)rrr�iterfindXsD


rncCstt|||�d�Sr)r>rn�r%rmrrrrrO�srOcCstt|||��Sr)rSrnrorrrr	�sr	cCs:ztt|||��}|jpdWStk
r4|YSXdSrP)r>rn�textrE)r%rm�defaultrrrr�findtext�s
rr)N)N)N)N)NN)rW�compilerrrr"r6r@rArBrFrHr[rlrir^rnrOr	rrrrrr�<module>;s4�

)
b�	

,

PKE�\��J--)__pycache__/ElementInclude.cpython-38.pycnu�[���U

e5d�@sPddlZddlmZdZedZedZGdd�de�Zdd	d
�Zd
dd�Z	dS)�N�)�ElementTreez!{http://www.w3.org/2001/XInclude}�includeZfallbackc@seZdZdS)�FatalIncludeErrorN)�__name__�
__module__�__qualname__�r	r	�0/usr/lib64/python3.8/xml/etree/ElementInclude.pyr>src	Cs\|dkr.t|d��}t�|���}W5QRXn*|s6d}t|d|d��}|��}W5QRX|S)N�xml�rbzUTF-8�r)�encoding)�openr�parseZgetroot�read)�hrefrr�file�datar	r	r
�default_loaderMsrcCsh|dkrt}d}|t|�k�rd||}|jtk�r4|�d�}|�dd�}|dkr�|||�}|dkrrtd||f��t�|�}|jr�|jp�d|j|_|||<n�|dk�r&||||�d��}|dkr�td||f��|r�||d	}|jp�d||jp�d|_n|j�pd||j�pd|_||=qntd
|��n&|jt	k�rPtd|j��n
t
||�|d	}qdS)Nrrrrzcannot load %r as %r��textrrz)unknown parse type in xi:include tag (%r)z0xi:fallback tag must be child of xi:include (%r))r�len�tag�XINCLUDE_INCLUDE�getr�copy�tailr�XINCLUDE_FALLBACKr)�elem�loader�i�errZnoderr	r	r
rcsN


�



���
)N)N)
rrrZXINCLUDErr�SyntaxErrorrrrr	r	r	r
�<module>3s
PKE�\�r�� � ,__pycache__/ElementPath.cpython-38.opt-2.pycnu�[���U

e5d>3�@s�ddlZe�d�Zd"dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zeee	ee
ed�Z
iZGdd�d�Zd#dd�Zd$dd�Zd%dd�Zd&d d!�ZdS)'�Nz\('[^']*'|\"[^\"]*\"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+c		cs�|r|�d�nd}d}t�|�D]�}|\}}|r�|ddkr�d|kr�|�dd�\}}z"|s^t�|d|||ffVWq�tk
r�td|�d�Yq�Xn"|r�|s�|d||ffVn|Vd}q |V|d	k}q dS)
N�Fr�{�:�z{%s}%sz!prefix %r not found in prefix map�@)�get�xpath_tokenizer_re�findall�split�KeyError�SyntaxError)	�pattern�
namespacesZdefault_namespaceZparsing_attribute�tokenZttype�tag�prefixZuri�r�-/usr/lib64/python3.8/xml/etree/ElementPath.py�xpath_tokenizerIs&rcCs>|j}|dkr:i|_}|j��D]}|D]}|||<q*q"|S�N)�
parent_map�root�iter)�contextr�p�errr�get_parent_mapas
rcCs |dd�dkp|dd�dkS)N��{*}����}*r�rrrr�_is_wildcard_tagksr"cs�tt���dkr"��fdd�}n��dkr:��fdd�}n��dd�dkr��dd��tt��d���dd�������fd	d�}nL�d
d�dkrƈdd��tdt��������fd
d�}ntd�����|S)Nz{*}*c3s |D]}�|j��r|VqdSrr!�r�result�elem��_isinstance�_strrr�selectusz_prepare_tag.<locals>.selectz{}*c3s0|D]&}|j}�|��r|ddkr|VqdS)Nrrr!�rr$r%Zel_tagr&rrr){srr�c3s8|D].}|j}|�ks,�|��r|��kr|VqdSrr!r*)r'r(�no_ns�suffixrrrr)�srr ���c3s0|D]&}|j}�|��r|��kr|VqdSrr!r*)r'r(�ns�ns_onlyrrr)�szinternal parser error, got )�
isinstance�str�slice�len�RuntimeError)rr)r)r'r(r,r/r0r-rr�_prepare_tagos 
r6csR|d�t��r&t����fdd�}n(�dd�dkrB�dd���fdd�}|S)Nrcsdd�}�|||��S)Ncss|D]}|EdHqdSrr)r$r%rrr�select_child�sz3prepare_child.<locals>.select.<locals>.select_childr�rr$r7��
select_tagrrr)�szprepare_child.<locals>.selectr+�{}c3s(|D]}|D]}|j�kr|VqqdSrr!�rr$r%rr!rrr)�s
)r"r6��nextrr)r�r:rr�
prepare_child�sr@cCsdd�}|S)Ncss|D]}|EdHqdSrrr#rrrr)�szprepare_star.<locals>.selectrr=rrr�prepare_star�srAcCsdd�}|S)Ncss|EdHdSrr)rr$rrrr)�szprepare_self.<locals>.selectrr=rrr�prepare_self�srBcs�z
|�}Wntk
r YdSX|ddkr4d�n|dsF|d�ntd��t��rlt����fdd�}n(�dd�dkr��dd���fd	d�}|S)
Nr�*rzinvalid descendantcsdd�}�|||��S)Ncss*|D] }|��D]}||k	r|VqqdSr�r)r$r%rrrrr7�sz8prepare_descendant.<locals>.select.<locals>.select_childrr8r9rrr)�sz"prepare_descendant.<locals>.selectr+r;c3s,|D]"}|���D]}||k	r|VqqdSrrDr<r!rrr)�s)�
StopIterationrr"r6r=rr?r�prepare_descendant�s 

rFcCsdd�}|S)Ncss@t|�}i}|D]*}||kr||}||krd||<|VqdSr)r)rr$rZ
result_mapr%�parentrrrr)�szprepare_parent.<locals>.selectrr=rrr�prepare_parent�s
rHcsLg}g}z
|�}Wntk
r(YdSX|ddkr8q�|dkrBq|drr|ddd�dkrrd|ddd�f}|�|dp�d�|�|d�qd	�|�}|d
kr�|d��fdd�}|S|d
kr�|d�|d���fdd�}|S|dk�rt�d|d��s|d��fdd�}|S|dk�sB|dk�rxt�d|d��sx|d�|d���rh��fdd�}n�fdd�}|S|dk�s�|dk�s�|dk�r@|dk�r�t|d�d��dk�r0td��nl|ddk�r�td��|dk�r,zt|d�d�Wntk
�rtd��YnX�dk�r0td��nd��fdd�}|Std��dS) Nr�])rrrz'"�'r.�-rz@-c3s"|D]}|���dk	r|VqdSr�rr#)�keyrrr)�sz!prepare_predicate.<locals>.selectz@-='c3s"|D]}|����kr|VqdSrrLr#)rM�valuerrr)sz\-?\d+$c3s"|D]}|���dk	r|VqdSr)�findr#r!rrr)sz.='z-='c3s:|D]0}|���D] }d�|����kr|VqqqdS�Nr)r	�join�itertextr<)rrNrrr)s
c3s&|D]}d�|����kr|VqdSrP)rQrRr#)rNrrr)sz-()z-()-zXPath position >= 1 expectedZlastzunsupported functionr+zunsupported expressionrz)XPath offset from last() must be negativec
3s^t|�}|D]L}z.||}t|�|j��}|�|kr<|VWqttfk
rVYqXqdSr)r�listr	r�
IndexErrorr)rr$rr%rGZelems)�indexrrr)5s
zinvalid predicate)rE�appendrQ�re�match�intr�
ValueError)r>rZ	signatureZ	predicater)r)rUrMrrNr�prepare_predicate�sj

&





r[)rrC�.z..z//�[c@seZdZdZdd�ZdS)�_SelectorContextNcCs
||_dSr)r)�selfrrrr�__init__Psz_SelectorContext.__init__)�__name__�
__module__�__qualname__rr`rrrrr^Nsr^c
Csj|dd�dkr|d}|f}|r6|tt|����7}zt|}W�n�tk
�r@tt�dkrjt��|dd�dkr�td��tt	||��j
}z
|�}Wntk
r�YYdSXg}z|�t
|d||��Wntk
r�td�d�YnXz|�}|ddk�r|�}Wq�tk
�r0Y�q4Yq�Xq�|t|<YnX|g}t|�}|D]}	|	||�}�qT|S)	Nr.�/rC�drz#cannot use absolute path on elementrzinvalid path)�tuple�sorted�items�_cacherr4�clearrrr�__next__rErV�opsr^)
r%�pathrZ	cache_keyZselectorr>rr$rr)rrr�iterfindXsD


rncCstt|||�d�Sr)r>rn�r%rmrrrrrO�srOcCstt|||��Sr)rSrnrorrrr	�sr	cCs:ztt|||��}|jpdWStk
r4|YSXdSrP)r>rn�textrE)r%rm�defaultrrrr�findtext�s
rr)N)N)N)N)NN)rW�compilerrrr"r6r@rArBrFrHr[rlrir^rnrOr	rrrrrr�<module>;s4�

)
b�	

,

PKE�\�%�'��#__pycache__/__init__.cpython-38.pycnu�[���U

e5dD�@sdS)N�rrr�*/usr/lib64/python3.8/xml/etree/__init__.py�<module>�PKE�\�b�2��-__pycache__/cElementTree.cpython-38.opt-2.pycnu�[���U

e5dR�@sddlTdS)�)�*N)Zxml.etree.ElementTree�rr�./usr/lib64/python3.8/xml/etree/cElementTree.py�<module>�PKE�\�r�� � ,__pycache__/ElementPath.cpython-38.opt-1.pycnu�[���U

e5d>3�@s�ddlZe�d�Zd"dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zeee	ee
ed�Z
iZGdd�d�Zd#dd�Zd$dd�Zd%dd�Zd&d d!�ZdS)'�Nz\('[^']*'|\"[^\"]*\"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+c		cs�|r|�d�nd}d}t�|�D]�}|\}}|r�|ddkr�d|kr�|�dd�\}}z"|s^t�|d|||ffVWq�tk
r�td|�d�Yq�Xn"|r�|s�|d||ffVn|Vd}q |V|d	k}q dS)
N�Fr�{�:�z{%s}%sz!prefix %r not found in prefix map�@)�get�xpath_tokenizer_re�findall�split�KeyError�SyntaxError)	�pattern�
namespacesZdefault_namespaceZparsing_attribute�tokenZttype�tag�prefixZuri�r�-/usr/lib64/python3.8/xml/etree/ElementPath.py�xpath_tokenizerIs&rcCs>|j}|dkr:i|_}|j��D]}|D]}|||<q*q"|S�N)�
parent_map�root�iter)�contextr�p�errr�get_parent_mapas
rcCs |dd�dkp|dd�dkS)N��{*}����}*r�rrrr�_is_wildcard_tagksr"cs�tt���dkr"��fdd�}n��dkr:��fdd�}n��dd�dkr��dd��tt��d���dd�������fd	d�}nL�d
d�dkrƈdd��tdt��������fd
d�}ntd�����|S)Nz{*}*c3s |D]}�|j��r|VqdSrr!�r�result�elem��_isinstance�_strrr�selectusz_prepare_tag.<locals>.selectz{}*c3s0|D]&}|j}�|��r|ddkr|VqdS)Nrrr!�rr$r%Zel_tagr&rrr){srr�c3s8|D].}|j}|�ks,�|��r|��kr|VqdSrr!r*)r'r(�no_ns�suffixrrrr)�srr ���c3s0|D]&}|j}�|��r|��kr|VqdSrr!r*)r'r(�ns�ns_onlyrrr)�szinternal parser error, got )�
isinstance�str�slice�len�RuntimeError)rr)r)r'r(r,r/r0r-rr�_prepare_tagos 
r6csR|d�t��r&t����fdd�}n(�dd�dkrB�dd���fdd�}|S)Nrcsdd�}�|||��S)Ncss|D]}|EdHqdSrr)r$r%rrr�select_child�sz3prepare_child.<locals>.select.<locals>.select_childr�rr$r7��
select_tagrrr)�szprepare_child.<locals>.selectr+�{}c3s(|D]}|D]}|j�kr|VqqdSrr!�rr$r%rr!rrr)�s
)r"r6��nextrr)r�r:rr�
prepare_child�sr@cCsdd�}|S)Ncss|D]}|EdHqdSrrr#rrrr)�szprepare_star.<locals>.selectrr=rrr�prepare_star�srAcCsdd�}|S)Ncss|EdHdSrr)rr$rrrr)�szprepare_self.<locals>.selectrr=rrr�prepare_self�srBcs�z
|�}Wntk
r YdSX|ddkr4d�n|dsF|d�ntd��t��rlt����fdd�}n(�dd�dkr��dd���fd	d�}|S)
Nr�*rzinvalid descendantcsdd�}�|||��S)Ncss*|D] }|��D]}||k	r|VqqdSr�r)r$r%rrrrr7�sz8prepare_descendant.<locals>.select.<locals>.select_childrr8r9rrr)�sz"prepare_descendant.<locals>.selectr+r;c3s,|D]"}|���D]}||k	r|VqqdSrrDr<r!rrr)�s)�
StopIterationrr"r6r=rr?r�prepare_descendant�s 

rFcCsdd�}|S)Ncss@t|�}i}|D]*}||kr||}||krd||<|VqdSr)r)rr$rZ
result_mapr%�parentrrrr)�szprepare_parent.<locals>.selectrr=rrr�prepare_parent�s
rHcsLg}g}z
|�}Wntk
r(YdSX|ddkr8q�|dkrBq|drr|ddd�dkrrd|ddd�f}|�|dp�d�|�|d�qd	�|�}|d
kr�|d��fdd�}|S|d
kr�|d�|d���fdd�}|S|dk�rt�d|d��s|d��fdd�}|S|dk�sB|dk�rxt�d|d��sx|d�|d���rh��fdd�}n�fdd�}|S|dk�s�|dk�s�|dk�r@|dk�r�t|d�d��dk�r0td��nl|ddk�r�td��|dk�r,zt|d�d�Wntk
�rtd��YnX�dk�r0td��nd��fdd�}|Std��dS) Nr�])rrrz'"�'r.�-rz@-c3s"|D]}|���dk	r|VqdSr�rr#)�keyrrr)�sz!prepare_predicate.<locals>.selectz@-='c3s"|D]}|����kr|VqdSrrLr#)rM�valuerrr)sz\-?\d+$c3s"|D]}|���dk	r|VqdSr)�findr#r!rrr)sz.='z-='c3s:|D]0}|���D] }d�|����kr|VqqqdS�Nr)r	�join�itertextr<)rrNrrr)s
c3s&|D]}d�|����kr|VqdSrP)rQrRr#)rNrrr)sz-()z-()-zXPath position >= 1 expectedZlastzunsupported functionr+zunsupported expressionrz)XPath offset from last() must be negativec
3s^t|�}|D]L}z.||}t|�|j��}|�|kr<|VWqttfk
rVYqXqdSr)r�listr	r�
IndexErrorr)rr$rr%rGZelems)�indexrrr)5s
zinvalid predicate)rE�appendrQ�re�match�intr�
ValueError)r>rZ	signatureZ	predicater)r)rUrMrrNr�prepare_predicate�sj

&





r[)rrC�.z..z//�[c@seZdZdZdd�ZdS)�_SelectorContextNcCs
||_dSr)r)�selfrrrr�__init__Psz_SelectorContext.__init__)�__name__�
__module__�__qualname__rr`rrrrr^Nsr^c
Csj|dd�dkr|d}|f}|r6|tt|����7}zt|}W�n�tk
�r@tt�dkrjt��|dd�dkr�td��tt	||��j
}z
|�}Wntk
r�YYdSXg}z|�t
|d||��Wntk
r�td�d�YnXz|�}|ddk�r|�}Wq�tk
�r0Y�q4Yq�Xq�|t|<YnX|g}t|�}|D]}	|	||�}�qT|S)	Nr.�/rC�drz#cannot use absolute path on elementrzinvalid path)�tuple�sorted�items�_cacherr4�clearrrr�__next__rErV�opsr^)
r%�pathrZ	cache_keyZselectorr>rr$rr)rrr�iterfindXsD


rncCstt|||�d�Sr)r>rn�r%rmrrrrrO�srOcCstt|||��Sr)rSrnrorrrr	�sr	cCs:ztt|||��}|jpdWStk
r4|YSXdSrP)r>rn�textrE)r%rm�defaultrrrr�findtext�s
rr)N)N)N)N)NN)rW�compilerrrr"r6r@rArBrFrHr[rlrir^rnrOr	rrrrrr�<module>;s4�

)
b�	

,

PKE�\�%�'��)__pycache__/__init__.cpython-38.opt-1.pycnu�[���U

e5dD�@sdS)N�rrr�*/usr/lib64/python3.8/xml/etree/__init__.py�<module>�PKE�\n=mE��,__pycache__/ElementTree.cpython-38.opt-1.pycnu�[���U

e5d��@s�dZddddddddd	d
ddd
ddddddddddddgZdZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZGdd
�d
e�Z
d d�ZGd!d�d�Zifd"d�Zd]d#d�Zd^d$d�ZeZGd%d
�d
�ZGd&d�d�Ze	jd'd(��Zd_d)d*�Zd+d,�Zd-Zzee�ZWnek
�r.YnXd.d/�Zd0d1�Zeeed2�Zd3d�Z d4d5d6d7d8d9d:d;�Z!e!e _!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%d`dddDdE�dFd�Z&GdGdH�dHej'�Z(dadddDdE�dId�Z)dJd�Z*dbdKd	�Z+dcdLd�Z,GdMd�d�Z-dddNd�Z.dedOd�Z/e.Z0dfdPd�Z1GdQd�d�Z2GdRd�d�Z3dgdddS�dTd�Z4e�5dUej6�j7Z8GdVd�d�Z9dWdX�Z:dYdZ�Z;zeZ<dd[l=Tdd\l=m>Z>Wne?k
�r�YnXe>ee�dS)haLightweight 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�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�
XMLPullParser�register_namespace�canonicalize�C14NWriterTargetz1.3.0�N�)�ElementPathc@seZdZdZdS)r
z�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__�__doc__�r!r!�-/usr/lib64/python3.8/xml/etree/ElementTree.pyr
jscCs
t|d�S)z2Return True if *element* appears to be an Element.�tag)�hasattr)�elementr!r!r"rxsc@s
eZdZdZdZdZdZdZifdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd9d!d"�Zd:d#d$�Zd;d%d&�Zd<d'd(�Zd)d*�Zd=d+d,�Zd-d.�Zd/d0�Zd1d2�Zd>d3d4�Z d?d5d6�Z!d7d8�Z"dS)@rahAn 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

    NcKs6t|t�std|jjf��||_||�|_g|_dS)Nzattrib must be dict, not %s)�
isinstance�dict�	TypeError�	__class__rr#�attrib�	_children)�selfr#r*�extrar!r!r"�__init__�s
�
zElement.__init__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)r)rr#�id�r,r!r!r"�__repr__�szElement.__repr__cCs|�||�S)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.

        )r))r,r#r*r!r!r"�makeelement�s	zElement.makeelementcCs0|�|j|j�}|j|_|j|_||dd�<|S)z�Return copy of current element.

        This creates a shallow copy. Subelements will be shared with the
        original tree.

        N)r2r#r*�text�tail)r,�elemr!r!r"�copy�s
zElement.copycCs
t|j�S�N)�lenr+r0r!r!r"�__len__�szElement.__len__cCstjdtdd�t|j�dkS)NzyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.���
stacklevelr)�warnings�warn�
FutureWarningr8r+r0r!r!r"�__bool__�s�zElement.__bool__cCs
|j|Sr7�r+�r,�indexr!r!r"�__getitem__�szElement.__getitem__cCs8t|t�r |D]}|�|�qn
|�|�||j|<dSr7)r&�slice�_assert_is_elementr+)r,rCr%Zeltr!r!r"�__setitem__�s


zElement.__setitem__cCs|j|=dSr7rArBr!r!r"�__delitem__�szElement.__delitem__cCs|�|�|j�|�dS)aAdd *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�rFr+�append�r,�
subelementr!r!r"rJ�s
zElement.appendcCs$|D]}|�|�|j�|�qdS)zkAppend subelements from a sequence.

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

        NrI)r,�elementsr%r!r!r"�extend�s
zElement.extendcCs|�|�|j�||�dS)z(Insert *subelement* at position *index*.N)rFr+�insert)r,rCrLr!r!r"rO�s
zElement.insertcCs t|t�stdt|�j��dS)Nzexpected an Element, not %s)r&�_Element_Pyr(�typer)r,�er!r!r"rF�s
zElement._assert_is_elementcCs|j�|�dS)a�Remove 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)r+�removerKr!r!r"rSs
zElement.removecCstjdtdd�|jS)z`(Deprecated) Return all subelements.

        Elements are returned in document order.

        zaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.r:r;)r=r>�DeprecationWarningr+r0r!r!r"�getchildrens�zElement.getchildrencCst�|||�S)aFind 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�r,�path�
namespacesr!r!r"rV!s	zElement.findcCst�||||�S)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�r,rX�defaultrYr!r!r"rZ,szElement.findtextcCst�|||�S)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.

        Returns list containing all matching elements in document order.

        )r�findallrWr!r!r"r]:s	zElement.findallcCst�|||�S)a 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.

        Return an iterable yielding all matching elements in document order.

        )r�iterfindrWr!r!r"r^Es	zElement.iterfindcCs |j��g|_d|_|_dS)z�Reset element.

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

        N)r*�clearr+r3r4r0r!r!r"r_Ps
z
Element.clearcCs|j�||�S)agGet 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.

        )r*�get)r,�keyr\r!r!r"r`[szElement.getcCs||j|<dS)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)r*)r,ra�valuer!r!r"�sethszElement.setcCs
|j��S)z�Get list of attribute names.

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

        )r*�keysr0r!r!r"rdrszElement.keyscCs
|j��S)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.

        )r*�itemsr0r!r!r"re{s	z
Element.itemsccsD|dkrd}|dks|j|kr$|V|jD]}|�|�EdHq*dS)aCreate 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#r+�iter)r,r#rRr!r!r"rg�s
zElement.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.r:r;�r=r>rT�listrg�r,r#r!r!r"�getiterator�s�zElement.getiteratorccsX|j}t|t�s|dk	rdS|j}|r,|V|D]"}|��EdH|j}|r0|Vq0dS)z�Create text iterator.

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

        N)r#r&�strr3�itertextr4)r,r#�trRr!r!r"rm�szElement.itertext)N)NN)N)N)N)N)N)#rrrr r#r*r3r4r.r1r2r6r9r@rDrGrHrJrNrOrFrSrUrVrZr]r^r_r`rcrdrergrkrmr!r!r!r"r}s@	








	

cKs"||�}|�||�}|�|�|S)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.

    )r2rJ)�parentr#r*r-r%r!r!r"r�s
cCstt�}||_|S)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.

    )rrr3)r3r%r!r!r"r�s	cCs&tt�}||_|r"|jd||_|S)a*Processing 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.

    � )rrr3)�targetr3r%r!r!r"r�s

c@sZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)r
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.

    NcCs|rd||f}||_dS)Nz{%s}%s�r3)r,Ztext_or_urir#r!r!r"r.�szQName.__init__cCs|jSr7rrr0r!r!r"�__str__�sz
QName.__str__cCsd|jj|jfS)Nz<%s %r>)r)rr3r0r!r!r"r1szQName.__repr__cCs
t|j�Sr7)�hashr3r0r!r!r"�__hash__szQName.__hash__cCs t|t�r|j|jkS|j|kSr7�r&r
r3�r,�otherr!r!r"�__le__s
zQName.__le__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__lt__s
zQName.__lt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__ge__s
zQName.__ge__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__gt__s
zQName.__gt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__eq__s
zQName.__eq__)N)
rrrr r.rsr1ruryrzr{r|r}r!r!r!r"r
�s
c@s�eZdZdZddd�Zdd�Zdd�Zdd	d
�Zddd�Zd d
d�Z	d!dd�Z
d"dd�Zd#dd�Zd$dd�Z
d%dd�dd�Zdd�ZdS)&ra%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.

    NcCs||_|r|�|�dSr7)�_rootr	)r,r%�filer!r!r"r.'szElementTree.__init__cCs|jS)z!Return root element of this tree.�r~r0r!r!r"�getroot-szElementTree.getrootcCs
||_dS)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�)r,r%r!r!r"�_setroot1szElementTree._setrootcCs�d}t|d�st|d�}d}z^|dkrLt�}t|d�rL|�|�|_|jW�2S|�d�}|s\qh|�|�qL|��|_|jW�S|r�|��XdS)a=Load 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�rbTN�_parse_wholei)r$�open�closerr�r~r��feed)r,�source�parser�close_source�datar!r!r"r	;s$






zElementTree.parsecCs|j�|�S)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~rgrjr!r!r"rg`s
zElementTree.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.r:r;rhrjr!r!r"rkms�zElementTree.getiteratorcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)a\Find 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 %rr:r;)r=r>r?r~rVrWr!r!r"rVus��zElementTree.findcCs<|dd�dkr,d|}tjd|tdd�|j�|||�S)aeFind 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�r:r;)r=r>r?r~rZr[r!r!r"rZ�s��zElementTree.findtextcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)aaFind 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�r:r;)r=r>r?r~r]rWr!r!r"r]�s��zElementTree.findallcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)agFind 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�r:r;)r=r>r?r~r^rWr!r!r"r^�s��zElementTree.iterfindT��short_empty_elementsc	Cs�|s
d}n|tkrtd|��|s4|dkr0d}nd}|��}t||���}|dkr�|sd|dkr�|dkr�|}	|dkr�d	dl}
|
��}	|d
|	f�|dkr�t||j�n,t|j|�\}}t|}
|
||j|||d�W5QRXdS)
a�Write 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)r�r��unicoder�rz$<?xml version='1.0' encoding='%s'?>
r3r�)	�
_serialize�
ValueError�lower�_get_writer�localeZgetpreferredencoding�_serialize_textr~�_namespaces)r,�file_or_filename�encoding�xml_declaration�default_namespace�methodr�Z	enc_lower�writeZdeclared_encodingr��qnamesrYZ	serializer!r!r"r��s:����zElementTree.writecCs|j|dd�S)Nr�)r�)r�)r,rr!r!r"�
write_c14nszElementTree.write_c14n)NN)N)N)N)N)NN)N)N)NNNN)rrrr r.r�r�r	rgrkrVrZr]r^r�r�r!r!r!r"rs&



%





��:ccs"z
|j}WnPtk
rZ|dkr.t|d�}nt|d|dd�}|�|jVW5QRXYn�X|dkrl|Vn�t����}t|tj�r�|}nft|tj�r�t�	|�}|�
|j�nBt��}dd�|_||_z|j
|_
|j|_Wntk
r�YnXtj||ddd�}|�
|j�|jVW5QRXdS)	Nr��w�xmlcharrefreplace)r��errorscSsdS�NTr!r!r!r!r"�<lambda>0�z_get_writer.<locals>.<lambda>�
)r�r��newline)r��AttributeErrorr��
contextlib�	ExitStackr&�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�
TextIOWrapper)r�r�r�r�stackr!r!r"r�sB
�


�r�csddi�i��rd��<���fdd�}|��D]�}|j}t|t�rZ|j�kr�||j�n<t|t�rv|�kr�||�n |dk	r�|tk	r�|tk	r�t|�|�	�D]F\}}t|t�r�|j}|�kr�||�t|t�r�|j�kr�||j�q�|j}t|t�r0|j�kr0||j�q0��fS)N�cs�z�|dd�dkr�|dd��dd�\}}��|�}|dkrjt�|�}|dkrZdt��}|dkrj|�|<|r�d||f�|<q�|�|<n�r�td��|�|<Wntk
r�t|�YnXdS)Nr�{�}zns%dr�z%s:%sz<cannot use non-qualified names with default_namespace option)�rsplitr`�_namespace_mapr8r�r(�_raise_serialization_error)�qname�urir#�prefix�r�rYr�r!r"�	add_qnameMs(


�z_namespaces.<locals>.add_qname)
rgr#r&r
r3rlrrr�re)r5r�r�r#rarbr3r!r�r"r�Bs4




r�cKs�|j}|j}|tkr$|d|��nv|tkr<|d|��n^||}|dkr||r\|t|��|D]}t|||d|d�q`�n|d|�t|���}	|	s�|�r2|r�t|��dd�d�D](\}
}|r�d|}|d	|t	|
�f�q�|	D]L\}}
t
|t�r�|j}t
|
t��r||
j}
nt	|
�}
|d
|||
f�q�|�sHt|��sH|�s�|d�|�rb|t|��|D]}t|||d|d��qf|d|d�n|d
�|j
�r�|t|j
��dS)N�	<!--%s-->�<?%s?>r��<cSs|dS�Nrr!��xr!r!r"r��r�z _serialize_xml.<locals>.<lambda>�ra�:�
 xmlns%s="%s"� %s="%s"�>�</z />)r#r3rr�
_escape_cdata�_serialize_xmlrire�sorted�_escape_attribr&r
r8r4)r�r5r�rYr��kwargsr#r3rRre�v�kr!r!r"r�s\
�
��


�
r�)
Zarea�baseZbasefont�br�col�frameZhrZimg�inputZisindex�link�metaZparamcKs�|j}|j}|tkr(|dt|���n�|tkrD|dt|���nh||}|dkr�|rd|t|��|D]}t|||d�qh�n,|d|�t|���}|s�|�r8|r�t|��dd�d�D](\}	}
|
r�d|
}
|d|
t	|	�f�q�|D]N\}
}	t
|
t��r|
j}
t
|	t��r||	j}	nt|	�}	|d	||
|	f�q�|d
�|�
�}|�rx|dk�sb|dk�rl||�n|t|��|D]}t|||d��q||tk�r�|d
|d
�|j�r�|t|j��dS)Nr�r�r�cSs|dSr�r!r�r!r!r"r��r�z!_serialize_html.<locals>.<lambda>r�r�r�r�r�ZscriptZstyler�)r#r3rr�r�_serialize_htmlrirer�r�r&r
�_escape_attrib_htmlr��
HTML_EMPTYr4)r�r5r�rYr�r#r3rRrer�r�Zltagr!r!r"r��sX
��


r�cCs*|��D]}||�q|jr&||j�dSr7)rmr4)r�r5�partr!r!r"r��s
r�)r��htmlr3cCsLt�d|�rtd��tt���D]\}}||ks8||kr t|=q |t|<dS)atRegister 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�matchr�rir�re)r�r�r�r�r!r!r"r�sr�r�ZrdfZwsdlZxsZxsiZdc)�$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/cCstd|t|�jf��dS)Nzcannot serialize %r (type %s))r(rQrrrr!r!r"r�s�r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)N�&�&amp;r��&lt;r��&gt;��replacer(r�r�rrr!r!r"r�!sr�c	Cs�z�d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd
�}d
|kr�|�d
d�}d
|kr�|�d
d�}|WSttfk
r�t|�YnXdS)Nr�r�r�r�r�r��"�&quot;z
r��
z&#10;�	z&#09;r�rrr!r!r"r�1s(r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)Nr�r�r�r�r�r�r�rrr!r!r"r�Msr�T)r�r�r�cCs:|dkrt��nt��}t|�j||||||d�|��S)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�r�r�r�)r��StringIO�BytesIOrr��getvalue)r%r�r�r�r�r��streamr!r!r"r\s�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_ListDataStreamz7An auxiliary stream accumulating into a list reference.cCs
||_dSr7)�lst)r,r�r!r!r"r.vsz_ListDataStream.__init__cCsdSr�r!r0r!r!r"r�ysz_ListDataStream.writablecCsdSr�r!r0r!r!r"r�|sz_ListDataStream.seekablecCs|j�|�dSr7)r�rJ)r,�br!r!r"r�sz_ListDataStream.writecCs
t|j�Sr7)r8r�r0r!r!r"r��sz_ListDataStream.tellN)	rrrr r.r�r�r�r�r!r!r!r"r�tsr�cCs*g}t|�}t|�j||||||d�|S)Nr�)r�rr�)r%r�r�r�r�r�r�r�r!r!r"r�s�cCsLt|t�st|�}|jtjdd�|��j}|r<|ddkrHtj�d�dS)a#Write 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����r�N)r&rr��sys�stdoutr�r4)r5r4r!r!r"r�s

cCst�}|�||�|S)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��treer!r!r"r	�s	csft||d������fdd��G�fdd�dtjj�}|��d�_�~d�t�d�sbt�d	��d
��S)aJIncrementally 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�_parserc3s^zJ���EdH��d�}|s q,��|�q���}���EdH|�_W5�rX���XdS)Ni@)r��read_eventsr�r��_close_and_return_root�root)r�r)r��it�
pullparserr�r!r"�iterator�s

ziterparse.<locals>.iteratorcseZdZ��jZdS)z$iterparse.<locals>.IterParseIteratorN)rrr�__next__r!)rr!r"�IterParseIterator�srNFr�r�T)r�collections�abc�Iteratorrr$r�)r�r�r�rr!)r�rrrr�r"r�s

c@s<eZdZd
dd�dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rN)rcCs<t��|_|ptt�d�|_|dkr(d}|j�|j|�dS)N�rq)�end)r	�deque�
_events_queuerrr�
_setevents)r,r�rr!r!r"r.�s

zXMLPullParser.__init__c
CsZ|jdkrtd��|rVz|j�|�Wn.tk
rT}z|j�|�W5d}~XYnXdS)�Feed encoded data to parser.Nz!feed() called after end of stream)rr�r��SyntaxErrorrrJ)r,r��excr!r!r"r��s
zXMLPullParser.feedcCs|j��}d|_|Sr7)rr�)r,rr!r!r"r�s
z$XMLPullParser._close_and_return_rootcCs|��dS)z�Finish feeding data to parser.

        Unlike XMLParser, does not return the root element. Use
        read_events() to consume elements from XMLPullParser.
        N)rr0r!r!r"r�szXMLPullParser.closeccs.|j}|r*|��}t|t�r"|�q|VqdS)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�popleftr&�	Exception)r,r��eventr!r!r"rs
zXMLPullParser.read_events)N)rrrr.r�rr�rr!r!r!r"r�s

cCs"|stt�d�}|�|�|��S)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�)r3r�r!r!r"rs
cCsR|stt�d�}|�|�|��}i}|��D]}|�d�}|r.|||<q.||fS)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�rgr`)r3r�r�Zidsr5r/r!r!r"r,s



cCs,|stt�d�}|D]}|�|�q|��S)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)Zsequencer�r3r!r!r"rDs
	c@sheZdZdZdddddd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
ddd�Zdd�ZdS)ra8Generic 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_piscCsdg|_g|_d|_d|_d|_|dkr*t}||_||_|dkrBt}||_	||_
|dkrZt}||_dSr7)
�_data�_elem�_lastr~�_tailr�_comment_factoryrr�_pi_factoryrr�_factory)r,Zelement_factoryrrrrr!r!r"r.js zTreeBuilder.__init__cCs|jS)z;Flush builder buffers and return toplevel document Element.r�r0r!r!r"r�~szTreeBuilder.closecCs>|jr:|jdk	r4d�|j�}|jr,||j_n||j_g|_dS�Nr�)rr�joinrr4r3�r,r3r!r!r"�_flush�s

zTreeBuilder._flushcCs|j�|�dS)zAdd text to current element.N)rrJ�r,r�r!r!r"r��szTreeBuilder.datacCsX|��|�||�|_}|jr2|jd�|�n|jdkrB||_|j�|�d|_|S)z�Open new element and return it.

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

        r�Nr)r&r"rrrJr~r)r,r#�attrsr5r!r!r"�start�s
zTreeBuilder.startcCs |��|j��|_d|_|jS)zOClose and return current Element.

        *tag* is the element name.

        r)r&r�poprrrjr!r!r"r
�szTreeBuilder.endcCs|�|j|j|�S)z`Create a comment using the comment_factory.

        *text* is the text of the comment.
        )�_handle_singler rr%r!r!r"�comment�s
�zTreeBuilder.commentcCs|�|j|j||�S)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)r,rqr3r!r!r"�pi�s�zTreeBuilder.picGs:||�}|r6|��||_|jr0|jd�|�d|_|S)Nr�r)r&rrrJr)r,�factoryrO�argsr5r!r!r"r+�szTreeBuilder._handle_single)N)N)
rrrr r.r�r&r�r)r
r,r-r+r!r!r!r"rVs�
	c@speZdZdZddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)raaElement 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)rqr�cCsdzddlm}Wn>tk
rNzddl}Wntk
rHtd��YnXYnX|�|d�}|dkrjt�}||_|_||_|_	|j
|_i|_|j
|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d	�r�|j|_t|d
��r|j|_t|d��r|j|_d|_d|_d|_ d|_!i|_"zd
|j#|_$Wnt%k
�r^YnXdS)Nr��expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�r)r
�start_ns�end_nsr�r,r-rzExpat %d.%d.%d)&�xml.parsersr1�ImportErrorZpyexpatZParserCreaterr�rrq�_target�error�_error�_names�_defaultZDefaultHandlerExpandr$�_start�StartElementHandler�_end�EndElementHandler�	_start_ns�StartNamespaceDeclHandler�_end_ns�EndNamespaceDeclHandlerr�ZCharacterDataHandlerr,�CommentHandlerr-�ProcessingInstructionHandlerZbuffer_text�ordered_attributes�specified_attributes�_doctype�entity�version_info�versionr�)r,rqr�r1r�r!r!r"r.�sP�




zXMLParser.__init__cCs8|j}|j}|D�] }|dkrDd|_d|_|||jfdd�}||_q|dkrf|||jfdd�}||_q|dkr�t|j	d�r�|||j
fd	d�}n||fd
d�}||_q|dkr�t|j	d�r�|||jfd
d�}n||fdd�}||_
q|dk�r|||fdd�}||_q|dk�r&|||fdd�}||_qtd|��qdS)Nr)rcSs|||||�f�dSr7r!)r#Z	attrib_inrrJr)r!r!r"�handlersz%XMLParser._setevents.<locals>.handlerr
cSs||||�f�dSr7r!)r#rrJr
r!r!r"rKszstart-nsr2cSs|||||�f�dSr7r!)r�r�rrJr2r!r!r"rK!scSs|||p
d|pdff�dSr#r!)r�r�rrJr!r!r"rK%szend-nsr3cSs||||�f�dSr7r!)r�rrJr3r!r!r"rK+scSs||df�dSr7r!)r�rrJr!r!r"rK/sr,cSs|||j�|�f�dSr7)rqr,)r3rrJr,r!r!r"rK3sr-cSs|||j�||�f�dSr7)rqr-)Z	pi_targetr�rrJr,r!r!r"rK7szunknown event %r)rrJrErFr;r<r=r>r$rqr?r@rArBrCrDr�)r,Zevents_queueZevents_to_reportr�rJZ
event_namerKr!r!r"rsL
�
�
��

�
zXMLParser._seteventscCs&t|�}|j|_|j|jf|_|�dSr7)r
�code�lineno�offsetZposition)r,rb�errr!r!r"�_raiseerror>szXMLParser._raiseerrorcCsFz|j|}Wn2tk
r@|}d|kr2d|}||j|<YnX|S)Nr�r�)r9�KeyError)r,ra�namer!r!r"�_fixnameDszXMLParser._fixnamecCs|j�|pd|pd�Sr#)rqr2�r,r�r�r!r!r"r?OszXMLParser._start_nscCs|j�|pd�Sr#)rqr3)r,r�r!r!r"rARszXMLParser._end_nscCsR|j}||�}i}|rDtdt|�d�D]}||d||||�<q&|j�||�S)Nrr:r)rS�ranger8rqr))r,r#�	attr_listZfixnamer*�ir!r!r"r;UszXMLParser._startcCs|j�|�|��Sr7)rqr
rSrjr!r!r"r=aszXMLParser._endc	Cs�|dd�}|dkr�z|jj}Wntk
r6YdSXz||j|dd��WnZtk
r�ddlm}|�d||jj	|jj
f�}d|_|jj	|_|jj
|_
|�YnX�n"|dkr�|dd	�d
kr�g|_�n|jdk	�r�|dkr�d|_dS|��}|�sdS|j�|�t|j�}|dk�r�|jd}|d
k�rd|dk�rd|j\}}}	}
|	�r�|	dd�}	n*|dk�r�|dk�r�|j\}}}
d}	ndSt|jd��r�|j�||	|
dd��nt|d��r�t�dt�d|_dS)Nrr�r�rr0z'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�r:ZPUBLIC�ZSYSTEM��doctypezaThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.)rqr�r�rHrQr4r1r7r�ZErrorLineNumberZErrorColumnNumberrLrMrNrG�striprJr8r$r\r=r>�RuntimeWarning)r,r3r�Zdata_handlerr1rO�nrQrRZpubid�systemr!r!r"r:dsd���





�zXMLParser._defaultc
CsFz|j�|d�Wn.|jk
r@}z|�|�W5d}~XYnXdS)rrN)r��Parser8rP)r,r�r�r!r!r"r��szXMLParser.feedc
Cs�z|j�dd�Wn.|jk
r@}z|�|�W5d}~XYnXz0z|jj}Wntk
rdYnX|�W�SW5|`|`|`|`XdS)z;Finish feeding data to parser and return element structure.r�rN)	r�rar8rPrrqr6r�r�)r,r�Z
close_handlerr!r!r"r��szXMLParser.close)rrrr r.rrPrSr?rAr;r=r:r�r�r!r!r!r"r�s	.66)�out�	from_filecKs�|dkr|dkrtd��d}|dkr0t��}}tt|jf|�d�}|dk	r`|�|�|��n|dk	rtt||d�|dk	r�|�	�SdS)a3Convert 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�)
r�r�r�rrr�r�r�r	r�)Zxml_datarbrcZoptionsZsior�r!r!r"r�s


z	^\w+:\w+$c@s�eZdZdZdddddddd�dd�Zefdd�Zd	d
�Zddd�Zd
d�Z	dj
fdd�Zdd�Zdd�Z
ddd�Zdd�Zdd�Zdd�ZdS) ra�
    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	Cs�||_g|_||_||_|r$t|�nd|_|r6t|�nd|_||_|rRt|�|_nd|_|rjt|�j	|_
nd|_
dgg|_g|_|s�|j�
tt����|j�
g�i|_dg|_d|_d|_d|_d|_dS)N)r�r�Fr)�_writer�_with_comments�_strip_textrc�_exclude_attrs�
_exclude_tags�_rewrite_prefixes�_qname_aware_tags�intersection�_find_qname_aware_attrs�_declared_ns_stack�	_ns_stackrJrir�re�_prefix_map�_preserve_space�_pending_start�
_root_seen�
_root_done�_ignored_depth)	r,r�rdrerfrgrhrirjr!r!r"r.�s2�zC14NWriterTarget.__init__ccs ||�D]}|r|EdHqdSr7r!)r,Zns_stackZ	_reversedrYr!r!r"�_iter_namespacessz!C14NWriterTarget._iter_namespacescCs\|�dd�\}}|�|j�D]$\}}||krd|�d|��Sqtd|�d|�d���dS)Nr�rr�r�zPrefix z of QName "�" is not declared in scope)�splitr|rur�)r,Z
prefixed_namer�rRr��pr!r!r"�_resolve_prefix_names
z%C14NWriterTarget._resolve_prefix_namecCs�|dkr:|dd�dkr,|dd��dd�nd|f\}}n|}t�}|�|j�D]B\}}||kr�||kr�|rz|�d|��n|||fS|�|�qP|jr�||jkr�|j|}ndt|j���}|j|<|jd�||f�|�d|��||fS|�sd|k�r|||fS|�|j	�D]J\}}||k�r|jd�||f�|�rR|�d|��n|||fS�q|�st|||fSt
d|�d	���dS)
Nrr�r�r�r�r_r�zNamespace "r})r�rcr|rt�addrprvr8rJrur�)r,r�r�r#Z
prefixes_seen�ur�r!r!r"�_qnames.2 


&
zC14NWriterTarget._qnamecCs|js|j�|�dSr7)r{rrJr'r!r!r"r�CszC14NWriterTarget.datar�cCs�||j�}|jdd�=|jr.|jds.|��}|jdk	rv|jd}|_|rVt|�rV|nd}|j||f��|dk	rvdS|r�|jr�|�t	|��dS�Nr�)
rrmrwr]rx�_looks_like_prefix_namer;ryrk�_escape_cdata_c14n)r,Z
_join_textr�r/�
qname_textr!r!r"r&Gs


zC14NWriterTarget._flushcCs0|jr
dS|jr|��|jd�||f�dSr�)r{rr&rurJrTr!r!r"r2Us
zC14NWriterTarget.start_nscCs�|jdk	r,|js||jkr,|jd7_dS|jr:|��g}|j�|�|jdk	rn||jkrn|||f|_dS|�|||�dSr�)	ror{rr&rtrJrqrxr;)r,r#r(�new_namespacesr!r!r"r)]s
��zC14NWriterTarget.startcs�jdk	r$|r$�fdd�|��D�}|h|�}i}|dk	rV��|�}||<|�|��jdk	r�|r���|�}|r�|D]0}	||	}
t|
�rv��|
�}||
<|�|�qvq�d}nd}�j��fdd�t|dd�d�D�}|r�dd�|D�}|��ng}|�rjt|���D]^\}
}|dk	�r@|
|k�r@||k�r@|||d	}||
\}}	}|�	|�r\|n|	|f��q
|�
d
�}�j�	|�r�|dkn�jd��j}|d
||d	�|�r�|d�
dd�|D���|d�|dk	�r�|t|||d	��d�_�j�	g�dS)Ncs i|]\}}|�jkr||�qSr!)rn��.0r�r�r0r!r"�
<dictcomp>ps
z+C14NWriterTarget._start.<locals>.<dictcomp>csi|]}|�|��qSr!r!)r�r_)�parse_qnamer!r"r��scSs|�dd�S)Nr�r)r~)r_r!r!r"r��r�z)C14NWriterTarget._start.<locals>.<lambda>r�cSs$g|]\}}|rd|nd|f�qS)zxmlns:Zxmlnsr!)r�r�r�r!r!r"�
<listcomp>�s�z+C14NWriterTarget._start.<locals>.<listcomp>rz+{http://www.w3.org/XML/1998/namespace}spaceZpreserver�r�r�cSs&g|]\}}d|�dt|��d��qS)rpz="r�)�_escape_attrib_c14nr�r!r!r"r��sr�T)rnrer�r�rsr�r�r��sortrJr`rwrkr$r�ryru)r,r#r(r�r�r�Zresolved_namesr�ZqattrsZ	attr_namerbZ
parsed_qnamesrVr�r�Z
attr_qnamer�Zspace_behaviourr�r!)r�r,r"r;ns`


�
�

�
zC14NWriterTarget._startcCst|jr|jd8_dS|jr&|��|�d|�|�d�d��|j��t|j�dk|_|j	��|j
��dS)Nrr�rr�)r{rr&rkr�rwr*r8rzrtrurjr!r!r"r
�s

zC14NWriterTarget.endcCsd|js
dS|jrdS|jr&|�d�n|jr:|jr:|��|�dt|��d��|js`|�d�dS)Nr�z<!--z-->)rlr{rzrkryrr&r�r%r!r!r"r,�szC14NWriterTarget.commentcCsp|jr
dS|jr|�d�n|jr0|jr0|��|�|rNd|�dt|��d�n
d|�d��|jsl|�d�dS)Nr�z<?rpz?>)r{rzrkryrr&r�)r,rqr�r!r!r"r-�s$�zC14NWriterTarget.pi)N)N)rrrr r.�reversedr|r�r�r�r$r&r2r)r;r
r,r-r!r!r!r"r�s(�%
%
E
c	Cs|zVd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}|WSttfk
rvt|�YnXdS)	Nr�r�r�r�r�r�r��&#xD;r�rrr!r!r"r��sr�c	Cs�z~d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd�}|WSttfk
r�t|�YnXdS)
Nr�r�r�r�r�r�r�z&#x9;r�z&#xA;r�r�r�rrr!r!r"r��s r�)rf)�_set_factories)N)N)N)NN)NN)N)NN)N)N)N)N)@r �__all__rr�r�r=r�r	Zcollections.abcr�r�rrr
rrrrrrr
r�contextmanagerr�r�r�r�rc�	NameErrorr�r�r�rr�r�r�r�r�rr�r�rrr	rrrrrrrrr�compile�UNICODEr�r�rr�r�rPZ_elementtreer�r5r!r!r!r"�<module>s�J�>

0s
3
=22�	�
��


05


zgPKE�\��H�H�&__pycache__/ElementTree.cpython-38.pycnu�[���U

e5d��@s�dZddddddddd	d
ddd
ddddddddddddgZdZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZGdd
�d
e�Z
d d�ZGd!d�d�Zifd"d�Zd]d#d�Zd^d$d�ZeZGd%d
�d
�ZGd&d�d�Ze	jd'd(��Zd_d)d*�Zd+d,�Zd-Zzee�ZWnek
�r.YnXd.d/�Zd0d1�Zeeed2�Zd3d�Z d4d5d6d7d8d9d:d;�Z!e!e _!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%d`dddDdE�dFd�Z&GdGdH�dHej'�Z(dadddDdE�dId�Z)dJd�Z*dbdKd	�Z+dcdLd�Z,GdMd�d�Z-dddNd�Z.dedOd�Z/e.Z0dfdPd�Z1GdQd�d�Z2GdRd�d�Z3dgdddS�dTd�Z4e�5dUej6�j7Z8GdVd�d�Z9dWdX�Z:dYdZ�Z;zeZ<dd[l=Tdd\l=m>Z>Wne?k
�r�YnXe>ee�dS)haLightweight 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�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�
XMLPullParser�register_namespace�canonicalize�C14NWriterTargetz1.3.0�N�)�ElementPathc@seZdZdZdS)r
z�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__�__doc__�r!r!�-/usr/lib64/python3.8/xml/etree/ElementTree.pyr
jscCs
t|d�S)z2Return True if *element* appears to be an Element.�tag)�hasattr)�elementr!r!r"rxsc@s
eZdZdZdZdZdZdZifdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd9d!d"�Zd:d#d$�Zd;d%d&�Zd<d'd(�Zd)d*�Zd=d+d,�Zd-d.�Zd/d0�Zd1d2�Zd>d3d4�Z d?d5d6�Z!d7d8�Z"dS)@rahAn 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

    NcKs6t|t�std|jjf��||_||�|_g|_dS)Nzattrib must be dict, not %s)�
isinstance�dict�	TypeError�	__class__rr#�attrib�	_children)�selfr#r*�extrar!r!r"�__init__�s
�
zElement.__init__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)r)rr#�id�r,r!r!r"�__repr__�szElement.__repr__cCs|�||�S)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.

        )r))r,r#r*r!r!r"�makeelement�s	zElement.makeelementcCs0|�|j|j�}|j|_|j|_||dd�<|S)z�Return copy of current element.

        This creates a shallow copy. Subelements will be shared with the
        original tree.

        N)r2r#r*�text�tail)r,�elemr!r!r"�copy�s
zElement.copycCs
t|j�S�N)�lenr+r0r!r!r"�__len__�szElement.__len__cCstjdtdd�t|j�dkS)NzyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.���
stacklevelr)�warnings�warn�
FutureWarningr8r+r0r!r!r"�__bool__�s�zElement.__bool__cCs
|j|Sr7�r+�r,�indexr!r!r"�__getitem__�szElement.__getitem__cCs8t|t�r |D]}|�|�qn
|�|�||j|<dSr7)r&�slice�_assert_is_elementr+)r,rCr%Zeltr!r!r"�__setitem__�s


zElement.__setitem__cCs|j|=dSr7rArBr!r!r"�__delitem__�szElement.__delitem__cCs|�|�|j�|�dS)aAdd *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�rFr+�append�r,�
subelementr!r!r"rJ�s
zElement.appendcCs$|D]}|�|�|j�|�qdS)zkAppend subelements from a sequence.

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

        NrI)r,�elementsr%r!r!r"�extend�s
zElement.extendcCs|�|�|j�||�dS)z(Insert *subelement* at position *index*.N)rFr+�insert)r,rCrLr!r!r"rO�s
zElement.insertcCs t|t�stdt|�j��dS)Nzexpected an Element, not %s)r&�_Element_Pyr(�typer)r,�er!r!r"rF�s
zElement._assert_is_elementcCs|j�|�dS)a�Remove 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)r+�removerKr!r!r"rSs
zElement.removecCstjdtdd�|jS)z`(Deprecated) Return all subelements.

        Elements are returned in document order.

        zaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.r:r;)r=r>�DeprecationWarningr+r0r!r!r"�getchildrens�zElement.getchildrencCst�|||�S)aFind 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�r,�path�
namespacesr!r!r"rV!s	zElement.findcCst�||||�S)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�r,rX�defaultrYr!r!r"rZ,szElement.findtextcCst�|||�S)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.

        Returns list containing all matching elements in document order.

        )r�findallrWr!r!r"r]:s	zElement.findallcCst�|||�S)a 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.

        Return an iterable yielding all matching elements in document order.

        )r�iterfindrWr!r!r"r^Es	zElement.iterfindcCs |j��g|_d|_|_dS)z�Reset element.

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

        N)r*�clearr+r3r4r0r!r!r"r_Ps
z
Element.clearcCs|j�||�S)agGet 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.

        )r*�get)r,�keyr\r!r!r"r`[szElement.getcCs||j|<dS)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)r*)r,ra�valuer!r!r"�sethszElement.setcCs
|j��S)z�Get list of attribute names.

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

        )r*�keysr0r!r!r"rdrszElement.keyscCs
|j��S)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.

        )r*�itemsr0r!r!r"re{s	z
Element.itemsccsD|dkrd}|dks|j|kr$|V|jD]}|�|�EdHq*dS)aCreate 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#r+�iter)r,r#rRr!r!r"rg�s
zElement.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.r:r;�r=r>rT�listrg�r,r#r!r!r"�getiterator�s�zElement.getiteratorccsX|j}t|t�s|dk	rdS|j}|r,|V|D]"}|��EdH|j}|r0|Vq0dS)z�Create text iterator.

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

        N)r#r&�strr3�itertextr4)r,r#�trRr!r!r"rm�szElement.itertext)N)NN)N)N)N)N)N)#rrrr r#r*r3r4r.r1r2r6r9r@rDrGrHrJrNrOrFrSrUrVrZr]r^r_r`rcrdrergrkrmr!r!r!r"r}s@	








	

cKs"||�}|�||�}|�|�|S)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.

    )r2rJ)�parentr#r*r-r%r!r!r"r�s
cCstt�}||_|S)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.

    )rrr3)r3r%r!r!r"r�s	cCs&tt�}||_|r"|jd||_|S)a*Processing 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.

    � )rrr3)�targetr3r%r!r!r"r�s

c@sZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)r
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.

    NcCs|rd||f}||_dS)Nz{%s}%s�r3)r,Ztext_or_urir#r!r!r"r.�szQName.__init__cCs|jSr7rrr0r!r!r"�__str__�sz
QName.__str__cCsd|jj|jfS)Nz<%s %r>)r)rr3r0r!r!r"r1szQName.__repr__cCs
t|j�Sr7)�hashr3r0r!r!r"�__hash__szQName.__hash__cCs t|t�r|j|jkS|j|kSr7�r&r
r3�r,�otherr!r!r"�__le__s
zQName.__le__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__lt__s
zQName.__lt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__ge__s
zQName.__ge__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__gt__s
zQName.__gt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__eq__s
zQName.__eq__)N)
rrrr r.rsr1ruryrzr{r|r}r!r!r!r"r
�s
c@s�eZdZdZddd�Zdd�Zdd�Zdd	d
�Zddd�Zd d
d�Z	d!dd�Z
d"dd�Zd#dd�Zd$dd�Z
d%dd�dd�Zdd�ZdS)&ra%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.

    NcCs||_|r|�|�dSr7)�_rootr	)r,r%�filer!r!r"r.'szElementTree.__init__cCs|jS)z!Return root element of this tree.�r~r0r!r!r"�getroot-szElementTree.getrootcCs
||_dS)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�)r,r%r!r!r"�_setroot1szElementTree._setrootcCs�d}t|d�st|d�}d}z^|dkrLt�}t|d�rL|�|�|_|jW�2S|�d�}|s\qh|�|�qL|��|_|jW�S|r�|��XdS)a=Load 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�rbTN�_parse_wholei)r$�open�closerr�r~r��feed)r,�source�parser�close_source�datar!r!r"r	;s$






zElementTree.parsecCs|j�|�S)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~rgrjr!r!r"rg`s
zElementTree.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.r:r;rhrjr!r!r"rkms�zElementTree.getiteratorcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)a\Find 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 %rr:r;)r=r>r?r~rVrWr!r!r"rVus��zElementTree.findcCs<|dd�dkr,d|}tjd|tdd�|j�|||�S)aeFind 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�r:r;)r=r>r?r~rZr[r!r!r"rZ�s��zElementTree.findtextcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)aaFind 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�r:r;)r=r>r?r~r]rWr!r!r"r]�s��zElementTree.findallcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)agFind 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�r:r;)r=r>r?r~r^rWr!r!r"r^�s��zElementTree.iterfindT��short_empty_elementsc	Cs�|s
d}n|tkrtd|��|s4|dkr0d}nd}|��}t||���}|dkr�|sd|dkr�|dkr�|}	|dkr�d	dl}
|
��}	|d
|	f�|dkr�t||j�n,t|j|�\}}t|}
|
||j|||d�W5QRXdS)
a�Write 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)r�r��unicoder�rz$<?xml version='1.0' encoding='%s'?>
r3r�)	�
_serialize�
ValueError�lower�_get_writer�localeZgetpreferredencoding�_serialize_textr~�_namespaces)r,�file_or_filename�encoding�xml_declaration�default_namespace�methodr�Z	enc_lower�writeZdeclared_encodingr��qnamesrYZ	serializer!r!r"r��s:����zElementTree.writecCs|j|dd�S)Nr�)r�)r�)r,rr!r!r"�
write_c14nszElementTree.write_c14n)NN)N)N)N)N)NN)N)N)NNNN)rrrr r.r�r�r	rgrkrVrZr]r^r�r�r!r!r!r"rs&



%





��:ccs"z
|j}WnPtk
rZ|dkr.t|d�}nt|d|dd�}|�|jVW5QRXYn�X|dkrl|Vn�t����}t|tj�r�|}nft|tj�r�t�	|�}|�
|j�nBt��}dd�|_||_z|j
|_
|j|_Wntk
r�YnXtj||ddd�}|�
|j�|jVW5QRXdS)	Nr��w�xmlcharrefreplace)r��errorscSsdS�NTr!r!r!r!r"�<lambda>0�z_get_writer.<locals>.<lambda>�
)r�r��newline)r��AttributeErrorr��
contextlib�	ExitStackr&�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�
TextIOWrapper)r�r�r�r�stackr!r!r"r�sB
�


�r�csddi�i��rd��<���fdd�}|��D]�}|j}t|t�rZ|j�kr�||j�n<t|t�rv|�kr�||�n |dk	r�|tk	r�|tk	r�t|�|�	�D]F\}}t|t�r�|j}|�kr�||�t|t�r�|j�kr�||j�q�|j}t|t�r0|j�kr0||j�q0��fS)N�cs�z�|dd�dkr�|dd��dd�\}}��|�}|dkrjt�|�}|dkrZdt��}|dkrj|�|<|r�d||f�|<q�|�|<n�r�td��|�|<Wntk
r�t|�YnXdS)Nr�{�}zns%dr�z%s:%sz<cannot use non-qualified names with default_namespace option)�rsplitr`�_namespace_mapr8r�r(�_raise_serialization_error)�qname�urir#�prefix�r�rYr�r!r"�	add_qnameMs(


�z_namespaces.<locals>.add_qname)
rgr#r&r
r3rlrrr�re)r5r�r�r#rarbr3r!r�r"r�Bs4




r�cKs�|j}|j}|tkr$|d|��nv|tkr<|d|��n^||}|dkr||r\|t|��|D]}t|||d|d�q`�n|d|�t|���}	|	s�|�r2|r�t|��dd�d�D](\}
}|r�d|}|d	|t	|
�f�q�|	D]L\}}
t
|t�r�|j}t
|
t��r||
j}
nt	|
�}
|d
|||
f�q�|�sHt|��sH|�s�|d�|�rb|t|��|D]}t|||d|d��qf|d|d�n|d
�|j
�r�|t|j
��dS)N�	<!--%s-->�<?%s?>r��<cSs|dS�Nrr!��xr!r!r"r��r�z _serialize_xml.<locals>.<lambda>�ra�:�
 xmlns%s="%s"� %s="%s"�>�</z />)r#r3rr�
_escape_cdata�_serialize_xmlrire�sorted�_escape_attribr&r
r8r4)r�r5r�rYr��kwargsr#r3rRre�v�kr!r!r"r�s\
�
��


�
r�)
Zarea�baseZbasefont�br�col�frameZhrZimg�inputZisindex�link�metaZparamcKs�|j}|j}|tkr(|dt|���n�|tkrD|dt|���nh||}|dkr�|rd|t|��|D]}t|||d�qh�n,|d|�t|���}|s�|�r8|r�t|��dd�d�D](\}	}
|
r�d|
}
|d|
t	|	�f�q�|D]N\}
}	t
|
t��r|
j}
t
|	t��r||	j}	nt|	�}	|d	||
|	f�q�|d
�|�
�}|�rx|dk�sb|dk�rl||�n|t|��|D]}t|||d��q||tk�r�|d
|d
�|j�r�|t|j��dS)Nr�r�r�cSs|dSr�r!r�r!r!r"r��r�z!_serialize_html.<locals>.<lambda>r�r�r�r�r�ZscriptZstyler�)r#r3rr�r�_serialize_htmlrirer�r�r&r
�_escape_attrib_htmlr��
HTML_EMPTYr4)r�r5r�rYr�r#r3rRrer�r�Zltagr!r!r"r��sX
��


r�cCs*|��D]}||�q|jr&||j�dSr7)rmr4)r�r5�partr!r!r"r��s
r�)r��htmlr3cCsLt�d|�rtd��tt���D]\}}||ks8||kr t|=q |t|<dS)atRegister 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�matchr�rir�re)r�r�r�r�r!r!r"r�sr�r�ZrdfZwsdlZxsZxsiZdc)�$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/cCstd|t|�jf��dS)Nzcannot serialize %r (type %s))r(rQrrrr!r!r"r�s�r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)N�&�&amp;r��&lt;r��&gt;��replacer(r�r�rrr!r!r"r�!sr�c	Cs�z�d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd
�}d
|kr�|�d
d�}d
|kr�|�d
d�}|WSttfk
r�t|�YnXdS)Nr�r�r�r�r�r��"�&quot;z
r��
z&#10;�	z&#09;r�rrr!r!r"r�1s(r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)Nr�r�r�r�r�r�r�rrr!r!r"r�Msr�T)r�r�r�cCs:|dkrt��nt��}t|�j||||||d�|��S)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�r�r�r�)r��StringIO�BytesIOrr��getvalue)r%r�r�r�r�r��streamr!r!r"r\s�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_ListDataStreamz7An auxiliary stream accumulating into a list reference.cCs
||_dSr7)�lst)r,r�r!r!r"r.vsz_ListDataStream.__init__cCsdSr�r!r0r!r!r"r�ysz_ListDataStream.writablecCsdSr�r!r0r!r!r"r�|sz_ListDataStream.seekablecCs|j�|�dSr7)r�rJ)r,�br!r!r"r�sz_ListDataStream.writecCs
t|j�Sr7)r8r�r0r!r!r"r��sz_ListDataStream.tellN)	rrrr r.r�r�r�r�r!r!r!r"r�tsr�cCs*g}t|�}t|�j||||||d�|S)Nr�)r�rr�)r%r�r�r�r�r�r�r�r!r!r"r�s�cCsLt|t�st|�}|jtjdd�|��j}|r<|ddkrHtj�d�dS)a#Write 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����r�N)r&rr��sys�stdoutr�r4)r5r4r!r!r"r�s

cCst�}|�||�|S)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��treer!r!r"r	�s	csft||d������fdd��G�fdd�dtjj�}|��d�_�~d�t�d�sbt�d	��d
��S)aJIncrementally 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�_parserc3s^zJ���EdH��d�}|s q,��|�q���}���EdH|�_W5�rX���XdS)Ni@)r��read_eventsr�r��_close_and_return_root�root)r�r)r��it�
pullparserr�r!r"�iterator�s

ziterparse.<locals>.iteratorcseZdZ��jZdS)z$iterparse.<locals>.IterParseIteratorN)rrr�__next__r!)rr!r"�IterParseIterator�srNFr�r�T)r�collections�abc�Iteratorrr$r�)r�r�r�rr!)r�rrrr�r"r�s

c@s<eZdZd
dd�dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rN)rcCs<t��|_|ptt�d�|_|dkr(d}|j�|j|�dS)N�rq)�end)r	�deque�
_events_queuerrr�
_setevents)r,r�rr!r!r"r.�s

zXMLPullParser.__init__c
CsZ|jdkrtd��|rVz|j�|�Wn.tk
rT}z|j�|�W5d}~XYnXdS)�Feed encoded data to parser.Nz!feed() called after end of stream)rr�r��SyntaxErrorrrJ)r,r��excr!r!r"r��s
zXMLPullParser.feedcCs|j��}d|_|Sr7)rr�)r,rr!r!r"r�s
z$XMLPullParser._close_and_return_rootcCs|��dS)z�Finish feeding data to parser.

        Unlike XMLParser, does not return the root element. Use
        read_events() to consume elements from XMLPullParser.
        N)rr0r!r!r"r�szXMLPullParser.closeccs.|j}|r*|��}t|t�r"|�q|VqdS)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�popleftr&�	Exception)r,r��eventr!r!r"rs
zXMLPullParser.read_events)N)rrrr.r�rr�rr!r!r!r"r�s

cCs"|stt�d�}|�|�|��S)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�)r3r�r!r!r"rs
cCsR|stt�d�}|�|�|��}i}|��D]}|�d�}|r.|||<q.||fS)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�rgr`)r3r�r�Zidsr5r/r!r!r"r,s



cCs,|stt�d�}|D]}|�|�q|��S)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)Zsequencer�r3r!r!r"rDs
	c@sheZdZdZdddddd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
ddd�Zdd�ZdS)ra8Generic 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_piscCsdg|_g|_d|_d|_d|_|dkr*t}||_||_|dkrBt}||_	||_
|dkrZt}||_dSr7)
�_data�_elem�_lastr~�_tailr�_comment_factoryrr�_pi_factoryrr�_factory)r,Zelement_factoryrrrrr!r!r"r.js zTreeBuilder.__init__cCs.t|j�dkstd��|jdk	s(td��|jS)z;Flush builder buffers and return toplevel document Element.rzmissing end tagsNzmissing toplevel element)r8r�AssertionErrorr~r0r!r!r"r�~szTreeBuilder.closecCsf|jrb|jdk	r\d�|j�}|jr@|jjdks6td��||j_n|jjdksTtd��||j_g|_dS)Nr�zinternal error (tail)zinternal error (text))rr�joinrr4r#r3�r,r3r!r!r"�_flush�s

zTreeBuilder._flushcCs|j�|�dS)zAdd text to current element.N)rrJ�r,r�r!r!r"r��szTreeBuilder.datacCsX|��|�||�|_}|jr2|jd�|�n|jdkrB||_|j�|�d|_|S)z�Open new element and return it.

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

        r�Nr)r&r"rrrJr~r)r,r#�attrsr5r!r!r"�start�s
zTreeBuilder.startcCs@|��|j��|_|jj|ks4td|jj|f��d|_|jS)zOClose and return current Element.

        *tag* is the element name.

        z&end tag mismatch (expected %s, got %s)r)r&r�poprr#r#rrjr!r!r"r
�s��zTreeBuilder.endcCs|�|j|j|�S)z`Create a comment using the comment_factory.

        *text* is the text of the comment.
        )�_handle_singler rr%r!r!r"�comment�s
�zTreeBuilder.commentcCs|�|j|j||�S)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)r,rqr3r!r!r"�pi�s�zTreeBuilder.picGs:||�}|r6|��||_|jr0|jd�|�d|_|S)Nr�r)r&rrrJr)r,�factoryrO�argsr5r!r!r"r+�szTreeBuilder._handle_single)N)N)
rrrr r.r�r&r�r)r
r,r-r+r!r!r!r"rVs�
	c@speZdZdZddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)raaElement 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)rqr�cCsdzddlm}Wn>tk
rNzddl}Wntk
rHtd��YnXYnX|�|d�}|dkrjt�}||_|_||_|_	|j
|_i|_|j
|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d	�r�|j|_t|d
��r|j|_t|d��r|j|_d|_d|_d|_ d|_!i|_"zd
|j#|_$Wnt%k
�r^YnXdS)Nr��expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�r)r
�start_ns�end_nsr�r,r-rzExpat %d.%d.%d)&�xml.parsersr1�ImportErrorZpyexpatZParserCreaterr�rrq�_target�error�_error�_names�_defaultZDefaultHandlerExpandr$�_start�StartElementHandler�_end�EndElementHandler�	_start_ns�StartNamespaceDeclHandler�_end_ns�EndNamespaceDeclHandlerr�ZCharacterDataHandlerr,�CommentHandlerr-�ProcessingInstructionHandlerZbuffer_text�ordered_attributes�specified_attributes�_doctype�entity�version_info�versionr�)r,rqr�r1r�r!r!r"r.�sP�




zXMLParser.__init__cCs8|j}|j}|D�] }|dkrDd|_d|_|||jfdd�}||_q|dkrf|||jfdd�}||_q|dkr�t|j	d�r�|||j
fd	d�}n||fd
d�}||_q|dkr�t|j	d�r�|||jfd
d�}n||fdd�}||_
q|dk�r|||fdd�}||_q|dk�r&|||fdd�}||_qtd|��qdS)Nr)rcSs|||||�f�dSr7r!)r#Z	attrib_inrrJr)r!r!r"�handlersz%XMLParser._setevents.<locals>.handlerr
cSs||||�f�dSr7r!)r#rrJr
r!r!r"rKszstart-nsr2cSs|||||�f�dSr7r!)r�r�rrJr2r!r!r"rK!scSs|||p
d|pdff�dS�Nr�r!)r�r�rrJr!r!r"rK%szend-nsr3cSs||||�f�dSr7r!)r�rrJr3r!r!r"rK+scSs||df�dSr7r!)r�rrJr!r!r"rK/sr,cSs|||j�|�f�dSr7)rqr,)r3rrJr,r!r!r"rK3sr-cSs|||j�||�f�dSr7)rqr-)Z	pi_targetr�rrJr,r!r!r"rK7szunknown event %r)rrJrErFr;r<r=r>r$rqr?r@rArBrCrDr�)r,Zevents_queueZevents_to_reportr�rJZ
event_namerKr!r!r"rsL
�
�
��

�
zXMLParser._seteventscCs&t|�}|j|_|j|jf|_|�dSr7)r
�code�lineno�offsetZposition)r,rb�errr!r!r"�_raiseerror>szXMLParser._raiseerrorcCsFz|j|}Wn2tk
r@|}d|kr2d|}||j|<YnX|S)Nr�r�)r9�KeyError)r,ra�namer!r!r"�_fixnameDszXMLParser._fixnamecCs|j�|pd|pd�SrL)rqr2�r,r�r�r!r!r"r?OszXMLParser._start_nscCs|j�|pd�SrL)rqr3)r,r�r!r!r"rARszXMLParser._end_nscCsR|j}||�}i}|rDtdt|�d�D]}||d||||�<q&|j�||�S)Nrr:r)rT�ranger8rqr))r,r#�	attr_listZfixnamer*�ir!r!r"r;UszXMLParser._startcCs|j�|�|��Sr7)rqr
rTrjr!r!r"r=aszXMLParser._endc	Cs�|dd�}|dkr�z|jj}Wntk
r6YdSXz||j|dd��WnZtk
r�ddlm}|�d||jj	|jj
f�}d|_|jj	|_|jj
|_
|�YnX�n"|dkr�|dd	�d
kr�g|_�n|jdk	�r�|dkr�d|_dS|��}|�sdS|j�|�t|j�}|dk�r�|jd}|d
k�rd|dk�rd|j\}}}	}
|	�r�|	dd�}	n*|dk�r�|dk�r�|j\}}}
d}	ndSt|jd��r�|j�||	|
dd��nt|d��r�t�dt�d|_dS)Nrr�r�rr0z'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�r:ZPUBLIC�ZSYSTEM��doctypezaThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.)rqr�r�rHrRr4r1r7r�ZErrorLineNumberZErrorColumnNumberrMrNrOrG�striprJr8r$r]r=r>�RuntimeWarning)r,r3r�Zdata_handlerr1rP�nrQrSZpubid�systemr!r!r"r:dsd���





�zXMLParser._defaultc
CsFz|j�|d�Wn.|jk
r@}z|�|�W5d}~XYnXdS)rrN)r��Parser8rQ)r,r�r�r!r!r"r��szXMLParser.feedc
Cs�z|j�dd�Wn.|jk
r@}z|�|�W5d}~XYnXz0z|jj}Wntk
rdYnX|�W�SW5|`|`|`|`XdS)z;Finish feeding data to parser and return element structure.r�rN)	r�rbr8rQrrqr6r�r�)r,r�Z
close_handlerr!r!r"r��szXMLParser.close)rrrr r.rrQrTr?rAr;r=r:r�r�r!r!r!r"r�s	.66)�out�	from_filecKs�|dkr|dkrtd��d}|dkr0t��}}tt|jf|�d�}|dk	r`|�|�|��n|dk	rtt||d�|dk	r�|�	�SdS)a3Convert 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�)
r�r�r�rrr�r�r�r	r�)Zxml_datarcrdZoptionsZsior�r!r!r"r�s


z	^\w+:\w+$c@s�eZdZdZdddddddd�dd�Zefdd�Zd	d
�Zddd�Zd
d�Z	dj
fdd�Zdd�Zdd�Z
ddd�Zdd�Zdd�Zdd�ZdS) ra�
    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	Cs�||_g|_||_||_|r$t|�nd|_|r6t|�nd|_||_|rRt|�|_nd|_|rjt|�j	|_
nd|_
dgg|_g|_|s�|j�
tt����|j�
g�i|_dg|_d|_d|_d|_d|_dS)N)r�r�Fr)�_writer�_with_comments�_strip_textrc�_exclude_attrs�
_exclude_tags�_rewrite_prefixes�_qname_aware_tags�intersection�_find_qname_aware_attrs�_declared_ns_stack�	_ns_stackrJrir�re�_prefix_map�_preserve_space�_pending_start�
_root_seen�
_root_done�_ignored_depth)	r,r�rerfrgrhrirjrkr!r!r"r.�s2�zC14NWriterTarget.__init__ccs ||�D]}|r|EdHqdSr7r!)r,Zns_stackZ	_reversedrYr!r!r"�_iter_namespacessz!C14NWriterTarget._iter_namespacescCs\|�dd�\}}|�|j�D]$\}}||krd|�d|��Sqtd|�d|�d���dS)Nr�rr�r�zPrefix z of QName "�" is not declared in scope)�splitr}rvr�)r,Z
prefixed_namer�rSr��pr!r!r"�_resolve_prefix_names
z%C14NWriterTarget._resolve_prefix_namecCs�|dkr:|dd�dkr,|dd��dd�nd|f\}}n|}t�}|�|j�D]B\}}||kr�||kr�|rz|�d|��n|||fS|�|�qP|jr�||jkr�|j|}ndt|j���}|j|<|jd�||f�|�d|��||fS|�sd|k�r|||fS|�|j	�D]J\}}||k�r|jd�||f�|�rR|�d|��n|||fS�q|�st|||fSt
d|�d	���dS)
Nrr�r�r�r�r`r�zNamespace "r~)r�rcr}ru�addrqrwr8rJrvr�)r,r�r�r#Z
prefixes_seen�ur�r!r!r"�_qnames.2 


&
zC14NWriterTarget._qnamecCs|js|j�|�dSr7)r|rrJr'r!r!r"r�CszC14NWriterTarget.datar�cCs�||j�}|jdd�=|jr.|jds.|��}|jdk	rv|jd}|_|rVt|�rV|nd}|j||f��|dk	rvdS|r�|jr�|�t	|��dS�Nr�)
rrnrxr^ry�_looks_like_prefix_namer;rzrl�_escape_cdata_c14n)r,Z
_join_textr�r/�
qname_textr!r!r"r&Gs


zC14NWriterTarget._flushcCs0|jr
dS|jr|��|jd�||f�dSr�)r|rr&rvrJrUr!r!r"r2Us
zC14NWriterTarget.start_nscCs�|jdk	r,|js||jkr,|jd7_dS|jr:|��g}|j�|�|jdk	rn||jkrn|||f|_dS|�|||�dSr�)	rpr|rr&rurJrrryr;)r,r#r(�new_namespacesr!r!r"r)]s
��zC14NWriterTarget.startcs�jdk	r$|r$�fdd�|��D�}|h|�}i}|dk	rV��|�}||<|�|��jdk	r�|r���|�}|r�|D]0}	||	}
t|
�rv��|
�}||
<|�|�qvq�d}nd}�j��fdd�t|dd�d�D�}|r�dd�|D�}|��ng}|�rjt|���D]^\}
}|dk	�r@|
|k�r@||k�r@|||d	}||
\}}	}|�	|�r\|n|	|f��q
|�
d
�}�j�	|�r�|dkn�jd��j}|d
||d	�|�r�|d�
dd�|D���|d�|dk	�r�|t|||d	��d�_�j�	g�dS)Ncs i|]\}}|�jkr||�qSr!)ro��.0r�r�r0r!r"�
<dictcomp>ps
z+C14NWriterTarget._start.<locals>.<dictcomp>csi|]}|�|��qSr!r!)r�r`)�parse_qnamer!r"r��scSs|�dd�S)Nr�r)r)r`r!r!r"r��r�z)C14NWriterTarget._start.<locals>.<lambda>r�cSs$g|]\}}|rd|nd|f�qS)zxmlns:Zxmlnsr!)r�r�r�r!r!r"�
<listcomp>�s�z+C14NWriterTarget._start.<locals>.<listcomp>rz+{http://www.w3.org/XML/1998/namespace}spaceZpreserver�r�r�cSs&g|]\}}d|�dt|��d��qS)rpz="r�)�_escape_attrib_c14nr�r!r!r"r��sr�T)rorer�r�rtr�r�r��sortrJr`rxrlr$r�rzrv)r,r#r(r�r�r�Zresolved_namesr�ZqattrsZ	attr_namerbZ
parsed_qnamesrWr�r�Z
attr_qnamer�Zspace_behaviourr�r!)r�r,r"r;ns`


�
�

�
zC14NWriterTarget._startcCst|jr|jd8_dS|jr&|��|�d|�|�d�d��|j��t|j�dk|_|j	��|j
��dS)Nrr�rr�)r|rr&rlr�rxr*r8r{rurvrjr!r!r"r
�s

zC14NWriterTarget.endcCsd|js
dS|jrdS|jr&|�d�n|jr:|jr:|��|�dt|��d��|js`|�d�dS)Nr�z<!--z-->)rmr|r{rlrzrr&r�r%r!r!r"r,�szC14NWriterTarget.commentcCsp|jr
dS|jr|�d�n|jr0|jr0|��|�|rNd|�dt|��d�n
d|�d��|jsl|�d�dS)Nr�z<?rpz?>)r|r{rlrzrr&r�)r,rqr�r!r!r"r-�s$�zC14NWriterTarget.pi)N)N)rrrr r.�reversedr}r�r�r�r$r&r2r)r;r
r,r-r!r!r!r"r�s(�%
%
E
c	Cs|zVd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}|WSttfk
rvt|�YnXdS)	Nr�r�r�r�r�r�r��&#xD;r�rrr!r!r"r��sr�c	Cs�z~d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd�}|WSttfk
r�t|�YnXdS)
Nr�r�r�r�r�r�r�z&#x9;r�z&#xA;r�r�r�rrr!r!r"r��s r�)rf)�_set_factories)N)N)N)NN)NN)N)NN)N)N)N)N)@r �__all__rr�r�r=r�r	Zcollections.abcr�r�rrr
rrrrrrr
r�contextmanagerr�r�r�r�rc�	NameErrorr�r�r�rr�r�r�r�r�rr�r�rrr	rrrrrrrrr�compile�UNICODEr�r�rr�r�rPZ_elementtreer�r5r!r!r!r"�<module>s�J�>

0s
3
=22�	�
��


05


zgPKF�\4��1�1�,__pycache__/ElementTree.cpython-38.opt-2.pycnu�[���U

e5d��@s�dddddddddd	d
ddd
dddddddddddgZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
Gdd	�d	e�Zdd�Z
Gd d�d�Zifd!d
�Zd\d"d�Zd]d#d�ZeZGd$d�d�ZGd%d�d�Zejd&d'��Zd^d(d)�Zd*d+�Zd,Zzee�ZWnek
�r*YnXd-d.�Zd/d0�Zeeed1�Zd2d�Zd3d4d5d6d7d8d9d:�Z e e_ d;d<�Z!d=d>�Z"d?d@�Z#dAdB�Z$d_dddCdD�dEd�Z%GdFdG�dGej&�Z'd`dddCdD�dHd�Z(dId�Z)dadJd�Z*dbdKd�Z+GdLd�d�Z,dcdMd�Z-dddNd�Z.e-Z/dedOd�Z0GdPd�d�Z1GdQd�d�Z2dfdddR�dSd�Z3e�4dTej5�j6Z7GdUd�d�Z8dVdW�Z9dXdY�Z:zeZ;ddZl<Tdd[l<m=Z=Wne>k
�r�YnXe=ee�dS)g�Comment�dump�Element�ElementTree�
fromstring�fromstringlist�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�
XMLPullParser�register_namespace�canonicalize�C14NWriterTargetz1.3.0�N�)�ElementPathc@seZdZdS)r
N)�__name__�
__module__�__qualname__�r r �-/usr/lib64/python3.8/xml/etree/ElementTree.pyr
js	cCs
t|d�S)N�tag)�hasattr)�elementr r r!rxsc@seZdZdZdZdZdZifdd�Zdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd8d d!�Zd9d"d#�Zd:d$d%�Zd;d&d'�Zd(d)�Zd<d*d+�Zd,d-�Zd.d/�Zd0d1�Zd=d2d3�Zd>d4d5�Z d6d7�Z!dS)?rNcKs6t|t�std|jjf��||_||�|_g|_dS)Nzattrib must be dict, not %s)�
isinstance�dict�	TypeError�	__class__rr"�attrib�	_children)�selfr"r)�extrar r r!�__init__�s
�
zElement.__init__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)r(rr"�id�r+r r r!�__repr__�szElement.__repr__cCs|�||�S�N)r()r+r"r)r r r!�makeelement�s	zElement.makeelementcCs0|�|j|j�}|j|_|j|_||dd�<|Sr1)r2r"r)�text�tail)r+�elemr r r!�copy�s
zElement.copycCs
t|j�Sr1)�lenr*r/r r r!�__len__�szElement.__len__cCstjdtdd�t|j�dkS)NzyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.���
stacklevelr)�warnings�warn�
FutureWarningr7r*r/r r r!�__bool__�s�zElement.__bool__cCs
|j|Sr1�r*�r+�indexr r r!�__getitem__�szElement.__getitem__cCs8t|t�r |D]}|�|�qn
|�|�||j|<dSr1)r%�slice�_assert_is_elementr*)r+rBr$Zeltr r r!�__setitem__�s


zElement.__setitem__cCs|j|=dSr1r@rAr r r!�__delitem__�szElement.__delitem__cCs|�|�|j�|�dSr1�rEr*�append�r+�
subelementr r r!rI�s
zElement.appendcCs$|D]}|�|�|j�|�qdSr1rH)r+�elementsr$r r r!�extend�s
zElement.extendcCs|�|�|j�||�dSr1)rEr*�insert)r+rBrKr r r!rN�s
zElement.insertcCs t|t�stdt|�j��dS)Nzexpected an Element, not %s)r%�_Element_Pyr'�typer)r+�er r r!rE�s
zElement._assert_is_elementcCs|j�|�dSr1)r*�removerJr r r!rRs
zElement.removecCstjdtdd�|jS)NzaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.r9r:)r<r=�DeprecationWarningr*r/r r r!�getchildrens�zElement.getchildrencCst�|||�Sr1)r�find�r+�path�
namespacesr r r!rU!s	zElement.findcCst�||||�Sr1)r�findtext�r+rW�defaultrXr r r!rY,szElement.findtextcCst�|||�Sr1)r�findallrVr r r!r\:s	zElement.findallcCst�|||�Sr1)r�iterfindrVr r r!r]Es	zElement.iterfindcCs |j��g|_d|_|_dSr1)r)�clearr*r3r4r/r r r!r^Ps
z
Element.clearcCs|j�||�Sr1)r)�get)r+�keyr[r r r!r_[szElement.getcCs||j|<dSr1)r))r+r`�valuer r r!�sethszElement.setcCs
|j��Sr1)r)�keysr/r r r!rcrszElement.keyscCs
|j��Sr1)r)�itemsr/r r r!rd{s	z
Element.itemsccsD|dkrd}|dks|j|kr$|V|jD]}|�|�EdHq*dS)N�*)r"r*�iter)r+r"rQr r r!rf�s
zElement.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.r9r:�r<r=rS�listrf�r+r"r r r!�getiterator�s�zElement.getiteratorccsX|j}t|t�s|dk	rdS|j}|r,|V|D]"}|��EdH|j}|r0|Vq0dSr1)r"r%�strr3�itertextr4)r+r"�trQr r r!rl�szElement.itertext)N)NN)N)N)N)N)N)"rrrr"r)r3r4r-r0r2r6r8r?rCrFrGrIrMrNrErRrTrUrYr\r]r^r_rbrcrdrfrjrlr r r r!r}s>	








	

cKs"||�}|�||�}|�|�|Sr1)r2rI)�parentr"r)r,r$r r r!r�s
cCstt�}||_|Sr1)rrr3)r3r$r r r!r�s	cCs&tt�}||_|r"|jd||_|S)N� )rrr3)�targetr3r$r r r!r�s

c@sVeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)r
NcCs|rd||f}||_dS)Nz{%s}%s�r3)r+Ztext_or_urir"r r r!r-�szQName.__init__cCs|jSr1rqr/r r r!�__str__�sz
QName.__str__cCsd|jj|jfS)Nz<%s %r>)r(rr3r/r r r!r0szQName.__repr__cCs
t|j�Sr1)�hashr3r/r r r!�__hash__szQName.__hash__cCs t|t�r|j|jkS|j|kSr1�r%r
r3�r+�otherr r r!�__le__s
zQName.__le__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__lt__s
zQName.__lt__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__ge__s
zQName.__ge__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__gt__s
zQName.__gt__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__eq__s
zQName.__eq__)N)rrrr-rrr0rtrxryrzr{r|r r r r!r
�s
c@s�eZdZddd�Zdd�Zdd�Zddd	�Zdd
d�Zddd
�Zd dd�Z	d!dd�Z
d"dd�Zd#dd�Zd$dd�dd�Z
dd�ZdS)%rNcCs||_|r|�|�dSr1)�_rootr	)r+r$�filer r r!r-'szElementTree.__init__cCs|jSr1�r}r/r r r!�getroot-szElementTree.getrootcCs
||_dSr1r)r+r$r r r!�_setroot1szElementTree._setrootcCs�d}t|d�st|d�}d}z^|dkrLt�}t|d�rL|�|�|_|jW�2S|�d�}|s\qh|�|�qL|��|_|jW�S|r�|��XdS)NF�read�rbT�_parse_wholei)r#�open�closerr�r}r��feed)r+�source�parser�close_source�datar r r!r	;s$






zElementTree.parsecCs|j�|�Sr1)r}rfrir r r!rf`s
zElementTree.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.r9r:rgrir r r!rjms�zElementTree.getiteratorcCs:|dd�dkr,d|}tjd|tdd�|j�||�S�Nr�/�.z�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 %rr9r:)r<r=r>r}rUrVr r r!rUus��zElementTree.findcCs<|dd�dkr,d|}tjd|tdd�|j�|||�Sr�)r<r=r>r}rYrZr r r!rY�s��zElementTree.findtextcCs:|dd�dkr,d|}tjd|tdd�|j�||�Sr�)r<r=r>r}r\rVr r r!r\�s��zElementTree.findallcCs:|dd�dkr,d|}tjd|tdd�|j�||�Sr�)r<r=r>r}r]rVr r r!r]�s��zElementTree.iterfindT��short_empty_elementsc	Cs�|s
d}n|tkrtd|��|s4|dkr0d}nd}|��}t||���}|dkr�|sd|dkr�|dkr�|}	|dkr�ddl}
|
��}	|d	|	f�|d
kr�t||j�n,t|j|�\}}t|}
|
||j|||d�W5QRXdS)N�xmlzunknown method %r�c14n�utf-8�us-ascii)r�r��unicoder�rz$<?xml version='1.0' encoding='%s'?>
r3r�)	�
_serialize�
ValueError�lower�_get_writer�localeZgetpreferredencoding�_serialize_textr}�_namespaces)r+�file_or_filename�encoding�xml_declaration�default_namespace�methodr�Z	enc_lower�writeZdeclared_encodingr��qnamesrXZ	serializer r r!r��s:����zElementTree.writecCs|j|dd�S)Nr�)r�)r�)r+r~r r r!�
write_c14nszElementTree.write_c14n)NN)N)N)N)N)NN)N)N)NNNN)rrrr-r�r�r	rfrjrUrYr\r]r�r�r r r r!rs$


%





��:ccs"z
|j}WnPtk
rZ|dkr.t|d�}nt|d|dd�}|�|jVW5QRXYn�X|dkrl|Vn�t����}t|tj�r�|}nft|tj�r�t�	|�}|�
|j�nBt��}dd�|_||_z|j
|_
|j|_Wntk
r�YnXtj||ddd�}|�
|j�|jVW5QRXdS)	Nr��w�xmlcharrefreplace)r��errorscSsdS�NTr r r r r!�<lambda>0�z_get_writer.<locals>.<lambda>�
)r�r��newline)r��AttributeErrorr��
contextlib�	ExitStackr%�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�
TextIOWrapper)r�r�r�r~�stackr r r!r�sB
�


�r�csddi�i��rd��<���fdd�}|��D]�}|j}t|t�rZ|j�kr�||j�n<t|t�rv|�kr�||�n |dk	r�|tk	r�|tk	r�t|�|�	�D]F\}}t|t�r�|j}|�kr�||�t|t�r�|j�kr�||j�q�|j}t|t�r0|j�kr0||j�q0��fS)N�cs�z�|dd�dkr�|dd��dd�\}}��|�}|dkrjt�|�}|dkrZdt��}|dkrj|�|<|r�d||f�|<q�|�|<n�r�td��|�|<Wntk
r�t|�YnXdS)Nr�{�}zns%dr�z%s:%sz<cannot use non-qualified names with default_namespace option)�rsplitr_�_namespace_mapr7r�r'�_raise_serialization_error)�qname�urir"�prefix�r�rXr�r r!�	add_qnameMs(


�z_namespaces.<locals>.add_qname)
rfr"r%r
r3rkrrr�rd)r5r�r�r"r`rar3r r�r!r�Bs4




r�cKs�|j}|j}|tkr$|d|��nv|tkr<|d|��n^||}|dkr||r\|t|��|D]}t|||d|d�q`�n|d|�t|���}	|	s�|�r2|r�t|��dd�d�D](\}
}|r�d|}|d	|t	|
�f�q�|	D]L\}}
t
|t�r�|j}t
|
t��r||
j}
nt	|
�}
|d
|||
f�q�|�sHt|��sH|�s�|d�|�rb|t|��|D]}t|||d|d��qf|d|d�n|d
�|j
�r�|t|j
��dS)N�	<!--%s-->�<?%s?>r��<cSs|dS�Nrr ��xr r r!r��r�z _serialize_xml.<locals>.<lambda>�r`�:�
 xmlns%s="%s"� %s="%s"�>�</z />)r"r3rr�
_escape_cdata�_serialize_xmlrhrd�sorted�_escape_attribr%r
r7r4)r�r5r�rXr��kwargsr"r3rQrd�v�kr r r!r�s\
�
��


�
r�)
Zarea�baseZbasefont�br�col�frameZhrZimg�inputZisindex�link�metaZparamcKs�|j}|j}|tkr(|dt|���n�|tkrD|dt|���nh||}|dkr�|rd|t|��|D]}t|||d�qh�n,|d|�t|���}|s�|�r8|r�t|��dd�d�D](\}	}
|
r�d|
}
|d|
t	|	�f�q�|D]N\}
}	t
|
t��r|
j}
t
|	t��r||	j}	nt|	�}	|d	||
|	f�q�|d
�|�
�}|�rx|dk�sb|dk�rl||�n|t|��|D]}t|||d��q||tk�r�|d
|d
�|j�r�|t|j��dS)Nr�r�r�cSs|dSr�r r�r r r!r��r�z!_serialize_html.<locals>.<lambda>r�r�r�r�r�ZscriptZstyler�)r"r3rr�r�_serialize_htmlrhrdr�r�r%r
�_escape_attrib_htmlr��
HTML_EMPTYr4)r�r5r�rXr�r"r3rQrdr�r�Zltagr r r!r��sX
��


r�cCs*|��D]}||�q|jr&||j�dSr1)rlr4)r�r5�partr r r!r��s
r�)r��htmlr3cCsLt�d|�rtd��tt���D]\}}||ks8||kr t|=q |t|<dS)Nzns\d+$z'Prefix format reserved for internal use)�re�matchr�rhr�rd)r�r�r�r�r r r!r�sr�r�ZrdfZwsdlZxsZxsiZdc)�$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/cCstd|t|�jf��dS)Nzcannot serialize %r (type %s))r'rPrrqr r r!r�s�r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)N�&�&amp;r��&lt;r��&gt;��replacer'r�r�rqr r r!r�!sr�c	Cs�z�d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd
�}d
|kr�|�d
d�}d
|kr�|�d
d�}|WSttfk
r�t|�YnXdS)Nr�r�r�r�r�r��"�&quot;z
r��
z&#10;�	z&#09;r�rqr r r!r�1s(r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)Nr�r�r�r�r�r�r�rqr r r!r�Msr�T)r�r�r�cCs:|dkrt��nt��}t|�j||||||d�|��S)Nr��r�r�r�r�)r��StringIO�BytesIOrr��getvalue)r$r�r�r�r�r��streamr r r!r\s�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_ListDataStreamcCs
||_dSr1)�lst)r+r�r r r!r-vsz_ListDataStream.__init__cCsdSr�r r/r r r!r�ysz_ListDataStream.writablecCsdSr�r r/r r r!r�|sz_ListDataStream.seekablecCs|j�|�dSr1)r�rI)r+�br r r!r�sz_ListDataStream.writecCs
t|j�Sr1)r7r�r/r r r!r��sz_ListDataStream.tellN)rrrr-r�r�r�r�r r r r!r�ts
r�cCs*g}t|�}t|�j||||||d�|S)Nr�)r�rr�)r$r�r�r�r�r�r�r�r r r!r�s�cCsLt|t�st|�}|jtjdd�|��j}|r<|ddkrHtj�d�dS)Nr�)r����r�)r%rr��sys�stdoutr�r4)r5r4r r r!r�s

cCst�}|�||�|Sr1)rr	)r�r��treer r r!r	�s	csft||d������fdd��G�fdd�dtjj�}|��d�_�~d�t�d�sbt�d��d	��S)
N)�events�_parserc3s^zJ���EdH��d�}|s q,��|�q���}���EdH|�_W5�rX���XdS)Ni@)r��read_eventsr�r��_close_and_return_root�root)r�r)r��it�
pullparserr�r r!�iterator�s

ziterparse.<locals>.iteratorcseZdZ��jZdS)z$iterparse.<locals>.IterParseIteratorN)rrr�__next__r )rr r!�IterParseIterator�srFr�r�T)r�collections�abc�Iteratorrr#r�)r�r�r�rr )r�rrrr�r!r�s

c@s<eZdZd
dd�dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rN)r�cCs<t��|_|ptt�d�|_|dkr(d}|j�|j|�dS)N�rp)�end)r�deque�
_events_queuerrr��
_setevents)r+r�r�r r r!r-�s

zXMLPullParser.__init__c
CsZ|jdkrtd��|rVz|j�|�Wn.tk
rT}z|j�|�W5d}~XYnXdS)Nz!feed() called after end of stream)r�r�r��SyntaxErrorrrI)r+r��excr r r!r��s
zXMLPullParser.feedcCs|j��}d|_|Sr1)r�r�)r+rr r r!r�s
z$XMLPullParser._close_and_return_rootcCs|��dSr1)rr/r r r!r�szXMLPullParser.closeccs.|j}|r*|��}t|t�r"|�q|VqdSr1)r�popleftr%�	Exception)r+r��eventr r r!rs
zXMLPullParser.read_events)N)rrrr-r�rr�rr r r r!r�s

cCs"|stt�d�}|�|�|��S�Nr�rrr�r�)r3r�r r r!rs
cCsR|stt�d�}|�|�|��}i}|��D]}|�d�}|r.|||<q.||fS)Nrr.)rrr�r�rfr_)r3r�r�Zidsr5r.r r r!r,s



cCs,|stt�d�}|D]}|�|�q|��Srr)Zsequencer�r3r r r!rDs
	c@sdeZdZdddddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	ddd�Z
dd�ZdS)rNF)�comment_factory�
pi_factory�insert_comments�
insert_piscCsdg|_g|_d|_d|_d|_|dkr*t}||_||_|dkrBt}||_	||_
|dkrZt}||_dSr1)
�_data�_elem�_lastr}�_tailr�_comment_factoryrr�_pi_factoryrr�_factory)r+Zelement_factoryrrrrr r r!r-js zTreeBuilder.__init__cCs|jSr1rr/r r r!r�~szTreeBuilder.closecCs>|jr:|jdk	r4d�|j�}|jr,||j_n||j_g|_dS�Nr�)rr�joinrr4r3�r+r3r r r!�_flush�s

zTreeBuilder._flushcCs|j�|�dSr1)rrI�r+r�r r r!r��szTreeBuilder.datacCsX|��|�||�|_}|jr2|jd�|�n|jdkrB||_|j�|�d|_|S)Nr�r)r%r!rrrIr}r)r+r"�attrsr5r r r!�start�s
zTreeBuilder.startcCs |��|j��|_d|_|jSr�)r%r�poprrrir r r!r�szTreeBuilder.endcCs|�|j|j|�Sr1)�_handle_singlerrr$r r r!�comment�s
�zTreeBuilder.commentcCs|�|j|j||�Sr1)r*r r)r+rpr3r r r!�pi�s�zTreeBuilder.picGs:||�}|r6|��||_|jr0|jd�|�d|_|S)Nr�r)r%rrrIr)r+�factoryrN�argsr5r r r!r*�szTreeBuilder._handle_single)N)N)rrrr-r�r%r�r(rr+r,r*r r r r!rVs�
	c@sleZdZddd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rN)rpr�cCsdzddlm}Wn>tk
rNzddl}Wntk
rHtd��YnXYnX|�|d�}|dkrjt�}||_|_||_|_	|j
|_i|_|j
|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d	�r�|j|_t|d
��r|j|_t|d��r|j|_d|_d|_d|_ d|_!i|_"zd
|j#|_$Wnt%k
�r^YnXdS)Nr��expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�r(r�start_ns�end_nsr�r+r,rzExpat %d.%d.%d)&�xml.parsersr0�ImportErrorZpyexpatZParserCreaterr�r�rp�_target�error�_error�_names�_defaultZDefaultHandlerExpandr#�_start�StartElementHandler�_end�EndElementHandler�	_start_ns�StartNamespaceDeclHandler�_end_ns�EndNamespaceDeclHandlerr�ZCharacterDataHandlerr+�CommentHandlerr,�ProcessingInstructionHandlerZbuffer_text�ordered_attributes�specified_attributes�_doctype�entity�version_info�versionr�)r+rpr�r0r�r r r!r-�sP�




zXMLParser.__init__cCs8|j}|j}|D�] }|dkrDd|_d|_|||jfdd�}||_q|dkrf|||jfdd�}||_q|dkr�t|j	d�r�|||j
fd	d�}n||fd
d�}||_q|dkr�t|j	d�r�|||jfd
d�}n||fdd�}||_
q|dk�r|||fdd�}||_q|dk�r&|||fdd�}||_qtd|��qdS)Nr(rcSs|||||�f�dSr1r )r"Z	attrib_inrrIr(r r r!�handlersz%XMLParser._setevents.<locals>.handlerrcSs||||�f�dSr1r )r"rrIrr r r!rJszstart-nsr1cSs|||||�f�dSr1r )r�r�rrIr1r r r!rJ!scSs|||p
d|pdff�dSr"r )r�r�rrIr r r!rJ%szend-nsr2cSs||||�f�dSr1r )r�rrIr2r r r!rJ+scSs||df�dSr1r )r�rrIr r r!rJ/sr+cSs|||j�|�f�dSr1)rpr+)r3rrIr+r r r!rJ3sr,cSs|||j�||�f�dSr1)rpr,)Z	pi_targetr�rrIr+r r r!rJ7szunknown event %r)r�rIrDrEr:r;r<r=r#rpr>r?r@rArBrCr�)r+Zevents_queueZevents_to_reportr�rIZ
event_namerJr r r!rsL
�
�
��

�
zXMLParser._seteventscCs&t|�}|j|_|j|jf|_|�dSr1)r
�code�lineno�offsetZposition)r+ra�errr r r!�_raiseerror>szXMLParser._raiseerrorcCsFz|j|}Wn2tk
r@|}d|kr2d|}||j|<YnX|S)Nr�r�)r8�KeyError)r+r`�namer r r!�_fixnameDszXMLParser._fixnamecCs|j�|pd|pd�Sr")rpr1�r+r�r�r r r!r>OszXMLParser._start_nscCs|j�|pd�Sr")rpr2)r+r�r r r!r@RszXMLParser._end_nscCsR|j}||�}i}|rDtdt|�d�D]}||d||||�<q&|j�||�S)Nrr9r)rR�ranger7rpr()r+r"�	attr_listZfixnamer)�ir r r!r:UszXMLParser._startcCs|j�|�|��Sr1)rprrRrir r r!r<aszXMLParser._endc	Cs�|dd�}|dkr�z|jj}Wntk
r6YdSXz||j|dd��WnZtk
r�ddlm}|�d||jj	|jj
f�}d|_|jj	|_|jj
|_
|�YnX�n"|dkr�|dd	�d
kr�g|_�n|jdk	�r�|dkr�d|_dS|��}|�sdS|j�|�t|j�}|dk�r�|jd}|d
k�rd|dk�rd|j\}}}	}
|	�r�|	dd�}	n*|dk�r�|dk�r�|j\}}}
d}	ndSt|jd��r�|j�||	|
dd��nt|d��r�t�dt�d|_dS)Nrr�r�rr/z'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�r9ZPUBLIC�ZSYSTEM��doctypezaThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.)rpr�r�rGrPr3r0r6r�ZErrorLineNumberZErrorColumnNumberrKrLrMrF�striprIr7r#r[r<r=�RuntimeWarning)r+r3r�Zdata_handlerr0rN�nrPrQZpubid�systemr r r!r9dsd���





�zXMLParser._defaultc
CsFz|j�|d�Wn.|jk
r@}z|�|�W5d}~XYnXdS)Nr)r��Parser7rO)r+r�r�r r r!r��szXMLParser.feedc
Cs�z|j�dd�Wn.|jk
r@}z|�|�W5d}~XYnXz0z|jj}Wntk
rdYnX|�W�SW5|`|`|`|`XdS)Nr�r)	r�r`r7rOr�rpr5r�r�)r+r�Z
close_handlerr r r!r��szXMLParser.close)rrrr-rrOrRr>r@r:r<r9r�r�r r r r!r�s
.66)�out�	from_filecKs�|dkr|dkrtd��d}|dkr0t��}}tt|jf|�d�}|dk	r`|�|�|��n|dk	rtt||d�|dk	r�|�	�SdS)Nz:Either 'xml_data' or 'from_file' must be provided as inputr)r�)
r�r�r�rrr�r�r�r	r�)Zxml_datararbZoptionsZsior�r r r!r�s


z	^\w+:\w+$c@s�eZdZdddddddd�dd�Zefdd�Zdd	�Zdd
d�Zdd
�Zdj	fdd�Z
dd�Zdd�Zddd�Z
dd�Zdd�Zdd�ZdS)rFN)�
with_comments�
strip_text�rewrite_prefixes�qname_aware_tags�qname_aware_attrs�
exclude_attrs�exclude_tagsc	Cs�||_g|_||_||_|r$t|�nd|_|r6t|�nd|_||_|rRt|�|_nd|_|rjt|�j	|_
nd|_
dgg|_g|_|s�|j�
tt����|j�
g�i|_dg|_d|_d|_d|_d|_dS)N)r�r�Fr)�_writer�_with_comments�_strip_textrb�_exclude_attrs�
_exclude_tags�_rewrite_prefixes�_qname_aware_tags�intersection�_find_qname_aware_attrs�_declared_ns_stack�	_ns_stackrIrhr�rd�_prefix_map�_preserve_space�_pending_start�
_root_seen�
_root_done�_ignored_depth)	r+r�rcrdrerfrgrhrir r r!r-�s2�zC14NWriterTarget.__init__ccs ||�D]}|r|EdHqdSr1r )r+Zns_stackZ	_reversedrXr r r!�_iter_namespacessz!C14NWriterTarget._iter_namespacescCs\|�dd�\}}|�|j�D]$\}}||krd|�d|��Sqtd|�d|�d���dS)Nr�rr�r�zPrefix z of QName "�" is not declared in scope)�splitr{rtr�)r+Z
prefixed_namer�rQr��pr r r!�_resolve_prefix_names
z%C14NWriterTarget._resolve_prefix_namecCs�|dkr:|dd�dkr,|dd��dd�nd|f\}}n|}t�}|�|j�D]B\}}||kr�||kr�|rz|�d|��n|||fS|�|�qP|jr�||jkr�|j|}ndt|j���}|j|<|jd�||f�|�d|��||fS|�sd|k�r|||fS|�|j	�D]J\}}||k�r|jd�||f�|�rR|�d|��n|||fS�q|�st|||fSt
d|�d	���dS)
Nrr�r�r�r�r^r�zNamespace "r|)r�rbr{rs�addrorur7rIrtr�)r+r�r�r"Z
prefixes_seen�ur�r r r!�_qnames.2 


&
zC14NWriterTarget._qnamecCs|js|j�|�dSr1)rzrrIr&r r r!r�CszC14NWriterTarget.datar�cCs�||j�}|jdd�=|jr.|jds.|��}|jdk	rv|jd}|_|rVt|�rV|nd}|j||f��|dk	rvdS|r�|jr�|�t	|��dS�Nr�)
rrlrvr\rw�_looks_like_prefix_namer:rxrj�_escape_cdata_c14n)r+Z
_join_textr�r.�
qname_textr r r!r%Gs


zC14NWriterTarget._flushcCs0|jr
dS|jr|��|jd�||f�dSr�)rzrr%rtrIrSr r r!r1Us
zC14NWriterTarget.start_nscCs�|jdk	r,|js||jkr,|jd7_dS|jr:|��g}|j�|�|jdk	rn||jkrn|||f|_dS|�|||�dSr�)	rnrzrr%rsrIrprwr:)r+r"r'�new_namespacesr r r!r(]s
��zC14NWriterTarget.startcs�jdk	r$|r$�fdd�|��D�}|h|�}i}|dk	rV��|�}||<|�|��jdk	r�|r���|�}|r�|D]0}	||	}
t|
�rv��|
�}||
<|�|�qvq�d}nd}�j��fdd�t|dd�d�D�}|r�dd�|D�}|��ng}|�rjt|���D]^\}
}|dk	�r@|
|k�r@||k�r@|||d	}||
\}}	}|�	|�r\|n|	|f��q
|�
d
�}�j�	|�r�|dkn�jd��j}|d
||d	�|�r�|d�
dd�|D���|d�|dk	�r�|t|||d	��d�_�j�	g�dS)Ncs i|]\}}|�jkr||�qSr )rm��.0r�r�r/r r!�
<dictcomp>ps
z+C14NWriterTarget._start.<locals>.<dictcomp>csi|]}|�|��qSr r )r�r^)�parse_qnamer r!r��scSs|�dd�S)Nr�r)r})r^r r r!r��r�z)C14NWriterTarget._start.<locals>.<lambda>r�cSs$g|]\}}|rd|nd|f�qS)zxmlns:Zxmlnsr )r�r�r�r r r!�
<listcomp>�s�z+C14NWriterTarget._start.<locals>.<listcomp>rz+{http://www.w3.org/XML/1998/namespace}spaceZpreserver�r�r�cSs&g|]\}}d|�dt|��d��qS)roz="r�)�_escape_attrib_c14nr�r r r!r��sr�T)rmrdrr�rrr�r�r��sortrIr_rvrjr#r�rxrt)r+r"r'r�r�r�Zresolved_namesr�ZqattrsZ	attr_nameraZ
parsed_qnamesrUr�r�Z
attr_qnamer�Zspace_behaviourr�r )r�r+r!r:ns`


�
�

�
zC14NWriterTarget._startcCst|jr|jd8_dS|jr&|��|�d|�|�d�d��|j��t|j�dk|_|j	��|j
��dS)Nrr�rr�)rzrr%rjr�rvr)r7ryrsrtrir r r!r�s

zC14NWriterTarget.endcCsd|js
dS|jrdS|jr&|�d�n|jr:|jr:|��|�dt|��d��|js`|�d�dS)Nr�z<!--z-->)rkrzryrjrxrr%r�r$r r r!r+�szC14NWriterTarget.commentcCsp|jr
dS|jr|�d�n|jr0|jr0|��|�|rNd|�dt|��d�n
d|�d��|jsl|�d�dS)Nr�z<?roz?>)rzryrjrxrr%r�)r+rpr�r r r!r,�s$�zC14NWriterTarget.pi)N)N)rrrr-�reversedr{rr�r�r#r%r1r(r:rr+r,r r r r!r�s&�%
%
E
c	Cs|zVd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}|WSttfk
rvt|�YnXdS)	Nr�r�r�r�r�r�r��&#xD;r�rqr r r!r��sr�c	Cs�z~d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd�}|WSttfk
r�t|�YnXdS)
Nr�r�r�r�r�r�r�z&#x9;r�z&#xA;r�r�r�rqr r r!r��s r�)re)�_set_factories)N)N)N)NN)NN)N)NN)N)N)N)N)?�__all__rr�r�r<r�rZcollections.abcr�r�rrr
rrrrrrr
r�contextmanagerr�r�r�r�rb�	NameErrorr�r�r�rr�r�r�r�r�rr�r�rrr	rrrrrrrrr�compile�UNICODEr�r�rr�r�rOZ_elementtreer�r4r r r r!�<module>Ks��>

0s
3
=22�	�
��


05


zgPKF�\�>)>>cElementTree.pynu�[���# Wrapper module for _elementtree

from _elementtree import *
PKF�\W�Z�DD__init__.pynu�[���# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package

# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
PKF�\�"/�����ElementTree.pynu�[���#
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl   added tostringlist/fromstringlist helpers
# 2006-07-05 fl   merged in selected changes from the 1.3 sandbox
# 2006-07-05 fl   removed support for 2.1 and earlier
# 2007-06-21 fl   added deprecation/future warnings
# 2007-08-25 fl   added doctype hook, added parser version attribute etc
# 2007-08-26 fl   added new serializer code (better namespace handling, etc)
# 2007-08-27 fl   warn for broken /tag searches on tree level
# 2007-09-02 fl   added html/text methods to serializer (experimental)
# 2007-09-05 fl   added method argument to tostring/tostringlist
# 2007-09-06 fl   improved error handling
# 2007-09-13 fl   added itertext, iterfind; assorted cleanups
# 2007-12-15 fl   added C14N hooks, copy method (experimental)
#
# Copyright (c) 1999-2008 by Fredrik Lundh.  All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.

__all__ = [
    # public symbols
    "Comment",
    "dump",
    "Element", "ElementTree",
    "fromstring", "fromstringlist",
    "iselement", "iterparse",
    "parse", "ParseError",
    "PI", "ProcessingInstruction",
    "QName",
    "SubElement",
    "tostring", "tostringlist",
    "TreeBuilder",
    "VERSION",
    "XML",
    "XMLParser", "XMLTreeBuilder",
    ]

VERSION = "1.3.0"

##
# The <b>Element</b> type is a flexible container object, designed to
# store hierarchical data structures in memory. The type can be
# described as a cross between a list and a dictionary.
# <p>
# Each element has a number of properties associated with it:
# <ul>
# <li>a <i>tag</i>. This is a string identifying what kind of data
# this element represents (the element type, in other words).</li>
# <li>a number of <i>attributes</i>, stored in a Python dictionary.</li>
# <li>a <i>text</i> string.</li>
# <li>an optional <i>tail</i> string.</li>
# <li>a number of <i>child elements</i>, stored in a Python sequence</li>
# </ul>
#
# To create an element instance, use the {@link #Element} constructor
# or the {@link #SubElement} factory function.
# <p>
# The {@link #ElementTree} class can be used to wrap an element
# structure, and convert it from and to XML.
##

import sys
import re
import warnings


class _SimpleElementPath(object):
    # emulate pre-1.2 find/findtext/findall behaviour
    def find(self, element, tag, namespaces=None):
        for elem in element:
            if elem.tag == tag:
                return elem
        return None
    def findtext(self, element, tag, default=None, namespaces=None):
        elem = self.find(element, tag)
        if elem is None:
            return default
        return elem.text or ""
    def iterfind(self, element, tag, namespaces=None):
        if tag[:3] == ".//":
            for elem in element.iter(tag[3:]):
                yield elem
        for elem in element:
            if elem.tag == tag:
                yield elem
    def findall(self, element, tag, namespaces=None):
        return list(self.iterfind(element, tag, namespaces))

try:
    from . import ElementPath
except ImportError:
    ElementPath = _SimpleElementPath()

##
# Parser error.  This is a subclass of <b>SyntaxError</b>.
# <p>
# In addition to the exception value, an exception instance contains a
# specific exception code in the <b>code</b> attribute, and the line and
# column of the error in the <b>position</b> attribute.

class ParseError(SyntaxError):
    pass

# --------------------------------------------------------------------

##
# Checks if an object appears to be a valid element object.
#
# @param An element instance.
# @return A true value if this is an element object.
# @defreturn flag

def iselement(element):
    # FIXME: not sure about this; might be a better idea to look
    # for tag/attrib/text attributes
    return isinstance(element, Element) or hasattr(element, "tag")

##
# Element class.  This class defines the Element interface, and
# provides a reference implementation of this interface.
# <p>
# The element name, attribute names, and attribute values can be
# either ASCII strings (ordinary Python strings containing only 7-bit
# ASCII characters) or Unicode strings.
#
# @param tag The element name.
# @param attrib An optional dictionary, containing element attributes.
# @param **extra Additional attributes, given as keyword arguments.
# @see Element
# @see SubElement
# @see Comment
# @see ProcessingInstruction

class Element(object):
    # <tag attrib>text<child/>...</tag>tail

    ##
    # (Attribute) Element tag.

    tag = None

    ##
    # (Attribute) Element attribute dictionary.  Where possible, use
    # {@link #Element.get},
    # {@link #Element.set},
    # {@link #Element.keys}, and
    # {@link #Element.items} to access
    # element attributes.

    attrib = None

    ##
    # (Attribute) Text before first subelement.  This is either a
    # string or the value None.  Note that if there was no text, this
    # attribute may be either None or an empty string, depending on
    # the parser.

    text = None

    ##
    # (Attribute) Text after this element's end tag, but before the
    # next sibling element's start tag.  This is either a string or
    # the value None.  Note that if there was no text, this attribute
    # may be either None or an empty string, depending on the parser.

    tail = None # text after end tag, if any

    # constructor

    def __init__(self, tag, attrib={}, **extra):
        attrib = attrib.copy()
        attrib.update(extra)
        self.tag = tag
        self.attrib = attrib
        self._children = []

    def __repr__(self):
        return "<Element %s at 0x%x>" % (repr(self.tag), id(self))

    ##
    # Creates a new element object of the same type as this element.
    #
    # @param tag Element tag.
    # @param attrib Element attributes, given as a dictionary.
    # @return A new element instance.

    def makeelement(self, tag, attrib):
        return self.__class__(tag, attrib)

    ##
    # (Experimental) Copies the current element.  This creates a
    # shallow copy; subelements will be shared with the original tree.
    #
    # @return A new element instance.

    def copy(self):
        elem = self.makeelement(self.tag, self.attrib)
        elem.text = self.text
        elem.tail = self.tail
        elem[:] = self
        return elem

    ##
    # Returns the number of subelements.  Note that this only counts
    # full elements; to check if there's any content in an element, you
    # have to check both the length and the <b>text</b> attribute.
    #
    # @return The number of subelements.

    def __len__(self):
        return len(self._children)

    def __nonzero__(self):
        warnings.warn(
            "The behavior of this method will change in future versions.  "
            "Use specific 'len(elem)' or 'elem is not None' test instead.",
            FutureWarning, stacklevel=2
            )
        return len(self._children) != 0 # emulate old behaviour, for now

    ##
    # Returns the given subelement, by index.
    #
    # @param index What subelement to return.
    # @return The given subelement.
    # @exception IndexError If the given element does not exist.

    def __getitem__(self, index):
        return self._children[index]

    ##
    # Replaces the given subelement, by index.
    #
    # @param index What subelement to replace.
    # @param element The new element value.
    # @exception IndexError If the given element does not exist.

    def __setitem__(self, index, element):
        # if isinstance(index, slice):
        #     for elt in element:
        #         assert iselement(elt)
        # else:
        #     assert iselement(element)
        self._children[index] = element

    ##
    # Deletes the given subelement, by index.
    #
    # @param index What subelement to delete.
    # @exception IndexError If the given element does not exist.

    def __delitem__(self, index):
        del self._children[index]

    ##
    # Adds a subelement to the end of this element.  In document order,
    # the new element will appear after the last existing subelement (or
    # directly after the text, if it's the first subelement), but before
    # the end tag for this element.
    #
    # @param element The element to add.

    def append(self, element):
        # assert iselement(element)
        self._children.append(element)

    ##
    # Appends subelements from a sequence.
    #
    # @param elements A sequence object with zero or more elements.
    # @since 1.3

    def extend(self, elements):
        # for element in elements:
        #     assert iselement(element)
        self._children.extend(elements)

    ##
    # Inserts a subelement at the given position in this element.
    #
    # @param index Where to insert the new subelement.

    def insert(self, index, element):
        # assert iselement(element)
        self._children.insert(index, element)

    ##
    # Removes a matching subelement.  Unlike the <b>find</b> methods,
    # this method compares elements based on identity, not on tag
    # value or contents.  To remove subelements by other means, the
    # easiest way is often to use a list comprehension to select what
    # elements to keep, and use slice assignment to update the parent
    # element.
    #
    # @param element What element to remove.
    # @exception ValueError If a matching element could not be found.

    def remove(self, element):
        # assert iselement(element)
        self._children.remove(element)

    ##
    # (Deprecated) Returns all subelements.  The elements are returned
    # in document order.
    #
    # @return A list of subelements.
    # @defreturn list of Element instances

    def getchildren(self):
        warnings.warn(
            "This method will be removed in future versions.  "
            "Use 'list(elem)' or iteration over elem instead.",
            DeprecationWarning, stacklevel=2
            )
        return self._children

    ##
    # Finds the first matching subelement, by tag name or path.
    #
    # @param path What element to look for.
    # @keyparam namespaces Optional namespace prefix map.
    # @return The first matching element, or None if no element was found.
    # @defreturn Element or None

    def find(self, path, namespaces=None):
        return ElementPath.find(self, path, namespaces)

    ##
    # Finds text for the first matching subelement, by tag name or path.
    #
    # @param path What element to look for.
    # @param default What to return if the element was not found.
    # @keyparam namespaces Optional namespace prefix map.
    # @return The text content of the first matching element, or the
    #     default value no element was found.  Note that if the element
    #     is found, but has no text content, this method returns an
    #     empty string.
    # @defreturn string

    def findtext(self, path, default=None, namespaces=None):
        return ElementPath.findtext(self, path, default, namespaces)

    ##
    # Finds all matching subelements, by tag name or path.
    #
    # @param path What element to look for.
    # @keyparam namespaces Optional namespace prefix map.
    # @return A list or other sequence containing all matching elements,
    #    in document order.
    # @defreturn list of Element instances

    def findall(self, path, namespaces=None):
        return ElementPath.findall(self, path, namespaces)

    ##
    # Finds all matching subelements, by tag name or path.
    #
    # @param path What element to look for.
    # @keyparam namespaces Optional namespace prefix map.
    # @return An iterator or sequence containing all matching elements,
    #    in document order.
    # @defreturn a generated sequence of Element instances

    def iterfind(self, path, namespaces=None):
        return ElementPath.iterfind(self, path, namespaces)

    ##
    # Resets an element.  This function removes all subelements, clears
    # all attributes, and sets the <b>text</b> and <b>tail</b> attributes
    # to None.

    def clear(self):
        self.attrib.clear()
        self._children = []
        self.text = self.tail = None

    ##
    # Gets an element attribute.  Equivalent to <b>attrib.get</b>, but
    # some implementations may handle this a bit more efficiently.
    #
    # @param key What attribute to look for.
    # @param default What to return if the attribute was not found.
    # @return The attribute value, or the default value, if the
    #     attribute was not found.
    # @defreturn string or None

    def get(self, key, default=None):
        return self.attrib.get(key, default)

    ##
    # Sets an element attribute.  Equivalent to <b>attrib[key] = value</b>,
    # but some implementations may handle this a bit more efficiently.
    #
    # @param key What attribute to set.
    # @param value The attribute value.

    def set(self, key, value):
        self.attrib[key] = value

    ##
    # Gets a list of attribute names.  The names are returned in an
    # arbitrary order (just like for an ordinary Python dictionary).
    # Equivalent to <b>attrib.keys()</b>.
    #
    # @return A list of element attribute names.
    # @defreturn list of strings

    def keys(self):
        return self.attrib.keys()

    ##
    # Gets element attributes, as a sequence.  The attributes are
    # returned in an arbitrary order.  Equivalent to <b>attrib.items()</b>.
    #
    # @return A list of (name, value) tuples for all attributes.
    # @defreturn list of (string, string) tuples

    def items(self):
        return self.attrib.items()

    ##
    # Creates a tree iterator.  The iterator loops over this element
    # and all subelements, in document order, and returns all elements
    # with a matching tag.
    # <p>
    # 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.
    #
    # @param tag What tags to look for (default is to return all elements).
    # @return An iterator containing all the matching elements.
    # @defreturn iterator

    def iter(self, tag=None):
        if tag == "*":
            tag = None
        if tag is None or self.tag == tag:
            yield self
        for e in self._children:
            for e in e.iter(tag):
                yield e

    # compatibility
    def getiterator(self, tag=None):
        # Change for a DeprecationWarning in 1.4
        warnings.warn(
            "This method will be removed in future versions.  "
            "Use 'elem.iter()' or 'list(elem.iter())' instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return list(self.iter(tag))

    ##
    # Creates a text iterator.  The iterator loops over this element
    # and all subelements, in document order, and returns all inner
    # text.
    #
    # @return An iterator containing all inner text.
    # @defreturn iterator

    def itertext(self):
        tag = self.tag
        if not isinstance(tag, basestring) and tag is not None:
            return
        if self.text:
            yield self.text
        for e in self:
            for s in e.itertext():
                yield s
            if e.tail:
                yield e.tail

# compatibility
_Element = _ElementInterface = Element

##
# Subelement factory.  This function creates an element instance, and
# appends it to an existing element.
# <p>
# The element name, attribute names, and attribute values can be
# either 8-bit ASCII strings or Unicode strings.
#
# @param parent The parent element.
# @param tag The subelement name.
# @param attrib An optional dictionary, containing element attributes.
# @param **extra Additional attributes, given as keyword arguments.
# @return An element instance.
# @defreturn Element

def SubElement(parent, tag, attrib={}, **extra):
    attrib = attrib.copy()
    attrib.update(extra)
    element = parent.makeelement(tag, attrib)
    parent.append(element)
    return element

##
# Comment element factory.  This factory function creates a special
# element that will be serialized as an XML comment by the standard
# serializer.
# <p>
# The comment string can be either an 8-bit ASCII string or a Unicode
# string.
#
# @param text A string containing the comment string.
# @return An element instance, representing a comment.
# @defreturn Element

def Comment(text=None):
    element = Element(Comment)
    element.text = text
    return element

##
# PI element factory.  This factory function creates a special element
# that will be serialized as an XML processing instruction by the standard
# serializer.
#
# @param target A string containing the PI target.
# @param text A string containing the PI contents, if any.
# @return An element instance, representing a PI.
# @defreturn Element

def ProcessingInstruction(target, text=None):
    element = Element(ProcessingInstruction)
    element.text = target
    if text:
        element.text = element.text + " " + text
    return element

PI = ProcessingInstruction

##
# QName wrapper.  This can be used to wrap a QName attribute value, in
# order to get proper namespace handling on output.
#
# @param text A string containing the QName value, in the form {uri}local,
#     or, if the tag argument is given, the URI part of a QName.
# @param tag Optional tag.  If given, the first argument is interpreted as
#     a URI, and this argument is interpreted as a local name.
# @return An opaque object, representing the QName.

class QName(object):
    def __init__(self, text_or_uri, tag=None):
        if tag:
            text_or_uri = "{%s}%s" % (text_or_uri, tag)
        self.text = text_or_uri
    def __str__(self):
        return self.text
    def __hash__(self):
        return hash(self.text)
    def __cmp__(self, other):
        if isinstance(other, QName):
            return cmp(self.text, other.text)
        return cmp(self.text, other)

# --------------------------------------------------------------------

##
# ElementTree wrapper class.  This class represents an entire element
# hierarchy, and adds some extra support for serialization to and from
# standard XML.
#
# @param element Optional root element.
# @keyparam file Optional file handle or file name.  If given, the
#     tree is initialized with the contents of this XML file.

class ElementTree(object):

    def __init__(self, element=None, file=None):
        # assert element is None or iselement(element)
        self._root = element # first node
        if file:
            self.parse(file)

    ##
    # Gets the root element for this tree.
    #
    # @return An element instance.
    # @defreturn Element

    def getroot(self):
        return self._root

    ##
    # Replaces the root element for this tree.  This discards the
    # current contents of the tree, and replaces it with the given
    # element.  Use with care.
    #
    # @param element An element instance.

    def _setroot(self, element):
        # assert iselement(element)
        self._root = element

    ##
    # Loads an external XML document into this element tree.
    #
    # @param source A file name or file object.  If a file object is
    #     given, it only has to implement a <b>read(n)</b> method.
    # @keyparam parser An optional parser instance.  If not given, the
    #     standard {@link XMLParser} parser is used.
    # @return The document root element.
    # @defreturn Element
    # @exception ParseError If the parser fails to parse the document.

    def parse(self, source, parser=None):
        close_source = False
        if not hasattr(source, "read"):
            source = open(source, "rb")
            close_source = True
        try:
            if not parser:
                parser = XMLParser(target=TreeBuilder())
            while 1:
                data = source.read(65536)
                if not data:
                    break
                parser.feed(data)
            self._root = parser.close()
            return self._root
        finally:
            if close_source:
                source.close()

    ##
    # Creates a tree iterator for the root element.  The iterator loops
    # over all elements in this tree, in document order.
    #
    # @param tag What tags to look for (default is to return all elements)
    # @return An iterator.
    # @defreturn iterator

    def iter(self, tag=None):
        # assert self._root is not None
        return self._root.iter(tag)

    # compatibility
    def getiterator(self, tag=None):
        # Change for a DeprecationWarning in 1.4
        warnings.warn(
            "This method will be removed in future versions.  "
            "Use 'tree.iter()' or 'list(tree.iter())' instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return list(self.iter(tag))

    ##
    # Same as getroot().find(path), starting at the root of the
    # tree.
    #
    # @param path What element to look for.
    # @keyparam namespaces Optional namespace prefix map.
    # @return The first matching element, or None if no element was found.
    # @defreturn Element or None

    def find(self, path, namespaces=None):
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "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 %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.find(path, namespaces)

    ##
    # Same as getroot().findtext(path), starting at the root of the tree.
    #
    # @param path What element to look for.
    # @param default What to return if the element was not found.
    # @keyparam namespaces Optional namespace prefix map.
    # @return The text content of the first matching element, or the
    #     default value no element was found.  Note that if the element
    #     is found, but has no text content, this method returns an
    #     empty string.
    # @defreturn string

    def findtext(self, path, default=None, namespaces=None):
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "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 %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.findtext(path, default, namespaces)

    ##
    # Same as getroot().findall(path), starting at the root of the tree.
    #
    # @param path What element to look for.
    # @keyparam namespaces Optional namespace prefix map.
    # @return A list or iterator containing all matching elements,
    #    in document order.
    # @defreturn list of Element instances

    def findall(self, path, namespaces=None):
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "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 %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.findall(path, namespaces)

    ##
    # Finds all matching subelements, by tag name or path.
    # Same as getroot().iterfind(path).
    #
    # @param path What element to look for.
    # @keyparam namespaces Optional namespace prefix map.
    # @return An iterator or sequence containing all matching elements,
    #    in document order.
    # @defreturn a generated sequence of Element instances

    def iterfind(self, path, namespaces=None):
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "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 %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.iterfind(path, namespaces)

    ##
    # Writes the element tree to a file, as XML.
    #
    # @def write(file, **options)
    # @param file A file name, or a file object opened for writing.
    # @param **options Options, given as keyword arguments.
    # @keyparam encoding Optional output encoding (default is US-ASCII).
    # @keyparam xml_declaration Controls if an XML declaration should
    #     be added to the file.  Use False for never, True for always,
    #     None for only if not US-ASCII or UTF-8.  None is default.
    # @keyparam default_namespace Sets the default XML namespace (for "xmlns").
    # @keyparam method Optional output method ("xml", "html", "text" or
    #     "c14n"; default is "xml").

    def write(self, file_or_filename,
              # keyword arguments
              encoding=None,
              xml_declaration=None,
              default_namespace=None,
              method=None):
        # assert self._root is not None
        if not method:
            method = "xml"
        elif method not in _serialize:
            # FIXME: raise an ImportError for c14n if ElementC14N is missing?
            raise ValueError("unknown method %r" % method)
        if hasattr(file_or_filename, "write"):
            file = file_or_filename
        else:
            file = open(file_or_filename, "wb")
        write = file.write
        if not encoding:
            if method == "c14n":
                encoding = "utf-8"
            else:
                encoding = "us-ascii"
        elif xml_declaration or (xml_declaration is None and
                                 encoding not in ("utf-8", "us-ascii")):
            if method == "xml":
                write("<?xml version='1.0' encoding='%s'?>\n" % encoding)
        if method == "text":
            _serialize_text(write, self._root, encoding)
        else:
            qnames, namespaces = _namespaces(
                self._root, encoding, default_namespace
                )
            serialize = _serialize[method]
            serialize(write, self._root, encoding, qnames, namespaces)
        if file_or_filename is not file:
            file.close()

    def write_c14n(self, file):
        # lxml.etree compatibility.  use output method instead
        return self.write(file, method="c14n")

# --------------------------------------------------------------------
# serialization support

def _namespaces(elem, encoding, default_namespace=None):
    # identify namespaces used in this tree

    # maps qnames to *encoded* prefix:local names
    qnames = {None: None}

    # maps uri:s to prefixes
    namespaces = {}
    if default_namespace:
        namespaces[default_namespace] = ""

    def encode(text):
        return text.encode(encoding)

    def add_qname(qname):
        # calculate serialized qname representation
        try:
            if qname[:1] == "{":
                uri, tag = qname[1:].rsplit("}", 1)
                prefix = namespaces.get(uri)
                if prefix is None:
                    prefix = _namespace_map.get(uri)
                    if prefix is None:
                        prefix = "ns%d" % len(namespaces)
                    if prefix != "xml":
                        namespaces[uri] = prefix
                if prefix:
                    qnames[qname] = encode("%s:%s" % (prefix, tag))
                else:
                    qnames[qname] = encode(tag) # default element
            else:
                if default_namespace:
                    # FIXME: can this be handled in XML 1.0?
                    raise ValueError(
                        "cannot use non-qualified names with "
                        "default_namespace option"
                        )
                qnames[qname] = encode(qname)
        except TypeError:
            _raise_serialization_error(qname)

    # populate qname and namespaces table
    try:
        iterate = elem.iter
    except AttributeError:
        iterate = elem.getiterator # cET compatibility
    for elem in iterate():
        tag = elem.tag
        if isinstance(tag, QName):
            if tag.text not in qnames:
                add_qname(tag.text)
        elif isinstance(tag, basestring):
            if tag not in qnames:
                add_qname(tag)
        elif tag is not None and tag is not Comment and tag is not PI:
            _raise_serialization_error(tag)
        for key, value in elem.items():
            if isinstance(key, QName):
                key = key.text
            if key not in qnames:
                add_qname(key)
            if isinstance(value, QName) and value.text not in qnames:
                add_qname(value.text)
        text = elem.text
        if isinstance(text, QName) and text.text not in qnames:
            add_qname(text.text)
    return qnames, namespaces

def _serialize_xml(write, elem, encoding, qnames, namespaces):
    tag = elem.tag
    text = elem.text
    if tag is Comment:
        write("<!--%s-->" % _encode(text, encoding))
    elif tag is ProcessingInstruction:
        write("<?%s?>" % _encode(text, encoding))
    else:
        tag = qnames[tag]
        if tag is None:
            if text:
                write(_escape_cdata(text, encoding))
            for e in elem:
                _serialize_xml(write, e, encoding, qnames, None)
        else:
            write("<" + tag)
            items = elem.items()
            if items or namespaces:
                if namespaces:
                    for v, k in sorted(namespaces.items(),
                                       key=lambda x: x[1]):  # sort on prefix
                        if k:
                            k = ":" + k
                        write(" xmlns%s=\"%s\"" % (
                            k.encode(encoding),
                            _escape_attrib(v, encoding)
                            ))
                for k, v in sorted(items):  # lexical order
                    if isinstance(k, QName):
                        k = k.text
                    if isinstance(v, QName):
                        v = qnames[v.text]
                    else:
                        v = _escape_attrib(v, encoding)
                    write(" %s=\"%s\"" % (qnames[k], v))
            if text or len(elem):
                write(">")
                if text:
                    write(_escape_cdata(text, encoding))
                for e in elem:
                    _serialize_xml(write, e, encoding, qnames, None)
                write("</" + tag + ">")
            else:
                write(" />")
    if elem.tail:
        write(_escape_cdata(elem.tail, encoding))

HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
              "img", "input", "isindex", "link", "meta", "param")

try:
    HTML_EMPTY = set(HTML_EMPTY)
except NameError:
    pass

def _serialize_html(write, elem, encoding, qnames, namespaces):
    tag = elem.tag
    text = elem.text
    if tag is Comment:
        write("<!--%s-->" % _escape_cdata(text, encoding))
    elif tag is ProcessingInstruction:
        write("<?%s?>" % _escape_cdata(text, encoding))
    else:
        tag = qnames[tag]
        if tag is None:
            if text:
                write(_escape_cdata(text, encoding))
            for e in elem:
                _serialize_html(write, e, encoding, qnames, None)
        else:
            write("<" + tag)
            items = elem.items()
            if items or namespaces:
                if namespaces:
                    for v, k in sorted(namespaces.items(),
                                       key=lambda x: x[1]):  # sort on prefix
                        if k:
                            k = ":" + k
                        write(" xmlns%s=\"%s\"" % (
                            k.encode(encoding),
                            _escape_attrib(v, encoding)
                            ))
                for k, v in sorted(items):  # lexical order
                    if isinstance(k, QName):
                        k = k.text
                    if isinstance(v, QName):
                        v = qnames[v.text]
                    else:
                        v = _escape_attrib_html(v, encoding)
                    # FIXME: handle boolean attributes
                    write(" %s=\"%s\"" % (qnames[k], v))
            write(">")
            ltag = tag.lower()
            if text:
                if ltag == "script" or ltag == "style":
                    write(_encode(text, encoding))
                else:
                    write(_escape_cdata(text, encoding))
            for e in elem:
                _serialize_html(write, e, encoding, qnames, None)
            if ltag not in HTML_EMPTY:
                write("</" + tag + ">")
    if elem.tail:
        write(_escape_cdata(elem.tail, encoding))

def _serialize_text(write, elem, encoding):
    for part in elem.itertext():
        write(part.encode(encoding))
    if elem.tail:
        write(elem.tail.encode(encoding))

_serialize = {
    "xml": _serialize_xml,
    "html": _serialize_html,
    "text": _serialize_text,
# this optional method is imported at the end of the module
#   "c14n": _serialize_c14n,
}

##
# Registers a namespace prefix.  The registry is global, and any
# existing mapping for either the given prefix or the namespace URI
# will be removed.
#
# @param prefix Namespace prefix.
# @param uri Namespace uri.  Tags and attributes in this namespace
#     will be serialized with the given prefix, if at all possible.
# @exception ValueError If the prefix is reserved, or is otherwise
#     invalid.

def register_namespace(prefix, uri):
    if re.match("ns\d+$", prefix):
        raise ValueError("Prefix format reserved for internal use")
    for k, v in _namespace_map.items():
        if k == uri or v == prefix:
            del _namespace_map[k]
    _namespace_map[uri] = prefix

_namespace_map = {
    # "well-known" namespace prefixes
    "http://www.w3.org/XML/1998/namespace": "xml",
    "http://www.w3.org/1999/xhtml": "html",
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
    "http://schemas.xmlsoap.org/wsdl/": "wsdl",
    # xml schema
    "http://www.w3.org/2001/XMLSchema": "xs",
    "http://www.w3.org/2001/XMLSchema-instance": "xsi",
    # dublin core
    "http://purl.org/dc/elements/1.1/": "dc",
}

def _raise_serialization_error(text):
    raise TypeError(
        "cannot serialize %r (type %s)" % (text, type(text).__name__)
        )

def _encode(text, encoding):
    try:
        return text.encode(encoding, "xmlcharrefreplace")
    except (TypeError, AttributeError):
        _raise_serialization_error(text)

def _escape_cdata(text, encoding):
    # escape character data
    try:
        # it's worth avoiding do-nothing calls for strings that are
        # shorter than 500 character, or so.  assume that's, by far,
        # the most common case in most applications.
        if "&" in text:
            text = text.replace("&", "&amp;")
        if "<" in text:
            text = text.replace("<", "&lt;")
        if ">" in text:
            text = text.replace(">", "&gt;")
        return text.encode(encoding, "xmlcharrefreplace")
    except (TypeError, AttributeError):
        _raise_serialization_error(text)

def _escape_attrib(text, encoding):
    # escape attribute value
    try:
        if "&" in text:
            text = text.replace("&", "&amp;")
        if "<" in text:
            text = text.replace("<", "&lt;")
        if ">" in text:
            text = text.replace(">", "&gt;")
        if "\"" in text:
            text = text.replace("\"", "&quot;")
        if "\n" in text:
            text = text.replace("\n", "&#10;")
        return text.encode(encoding, "xmlcharrefreplace")
    except (TypeError, AttributeError):
        _raise_serialization_error(text)

def _escape_attrib_html(text, encoding):
    # escape attribute value
    try:
        if "&" in text:
            text = text.replace("&", "&amp;")
        if ">" in text:
            text = text.replace(">", "&gt;")
        if "\"" in text:
            text = text.replace("\"", "&quot;")
        return text.encode(encoding, "xmlcharrefreplace")
    except (TypeError, AttributeError):
        _raise_serialization_error(text)

# --------------------------------------------------------------------

##
# Generates a string representation of an XML element, including all
# subelements.
#
# @param element An Element instance.
# @keyparam encoding Optional output encoding (default is US-ASCII).
# @keyparam method Optional output method ("xml", "html", "text" or
#     "c14n"; default is "xml").
# @return An encoded string containing the XML data.
# @defreturn string

def tostring(element, encoding=None, method=None):
    class dummy:
        pass
    data = []
    file = dummy()
    file.write = data.append
    ElementTree(element).write(file, encoding, method=method)
    return "".join(data)

##
# Generates a string representation of an XML element, including all
# subelements.  The string is returned as a sequence of string fragments.
#
# @param element An Element instance.
# @keyparam encoding Optional output encoding (default is US-ASCII).
# @keyparam method Optional output method ("xml", "html", "text" or
#     "c14n"; default is "xml").
# @return A sequence object containing the XML data.
# @defreturn sequence
# @since 1.3

def tostringlist(element, encoding=None, method=None):
    class dummy:
        pass
    data = []
    file = dummy()
    file.write = data.append
    ElementTree(element).write(file, encoding, method=method)
    # FIXME: merge small fragments into larger parts
    return data

##
# Writes an element tree or element structure to sys.stdout.  This
# function should be used for debugging only.
# <p>
# The exact output format is implementation dependent.  In this
# version, it's written as an ordinary XML file.
#
# @param elem An element tree or an individual element.

def dump(elem):
    # debugging
    if not isinstance(elem, ElementTree):
        elem = ElementTree(elem)
    elem.write(sys.stdout)
    tail = elem.getroot().tail
    if not tail or tail[-1] != "\n":
        sys.stdout.write("\n")

# --------------------------------------------------------------------
# parsing

##
# Parses an XML document into an element tree.
#
# @param source A filename or file object containing XML data.
# @param parser An optional parser instance.  If not given, the
#     standard {@link XMLParser} parser is used.
# @return An ElementTree instance

def parse(source, parser=None):
    tree = ElementTree()
    tree.parse(source, parser)
    return tree

##
# Parses an XML document into an element tree incrementally, and reports
# what's going on to the user.
#
# @param source A filename or file object containing XML data.
# @param events A list of events to report back.  If omitted, only "end"
#     events are reported.
# @param parser An optional parser instance.  If not given, the
#     standard {@link XMLParser} parser is used.
# @return A (event, elem) iterator.

def iterparse(source, events=None, parser=None):
    close_source = False
    if not hasattr(source, "read"):
        source = open(source, "rb")
        close_source = True
    try:
        if not parser:
            parser = XMLParser(target=TreeBuilder())
        return _IterParseIterator(source, events, parser, close_source)
    except:
        if close_source:
            source.close()
        raise

class _IterParseIterator(object):

    def __init__(self, source, events, parser, close_source=False):
        self._file = source
        self._close_file = close_source
        self._events = []
        self._index = 0
        self._error = None
        self.root = self._root = None
        self._parser = parser
        # wire up the parser for event reporting
        parser = self._parser._parser
        append = self._events.append
        if events is None:
            events = ["end"]
        for event in events:
            if event == "start":
                try:
                    parser.ordered_attributes = 1
                    parser.specified_attributes = 1
                    def handler(tag, attrib_in, event=event, append=append,
                                start=self._parser._start_list):
                        append((event, start(tag, attrib_in)))
                    parser.StartElementHandler = handler
                except AttributeError:
                    def handler(tag, attrib_in, event=event, append=append,
                                start=self._parser._start):
                        append((event, start(tag, attrib_in)))
                    parser.StartElementHandler = handler
            elif event == "end":
                def handler(tag, event=event, append=append,
                            end=self._parser._end):
                    append((event, end(tag)))
                parser.EndElementHandler = handler
            elif event == "start-ns":
                def handler(prefix, uri, event=event, append=append):
                    try:
                        uri = (uri or "").encode("ascii")
                    except UnicodeError:
                        pass
                    append((event, (prefix or "", uri or "")))
                parser.StartNamespaceDeclHandler = handler
            elif event == "end-ns":
                def handler(prefix, event=event, append=append):
                    append((event, None))
                parser.EndNamespaceDeclHandler = handler
            else:
                raise ValueError("unknown event %r" % event)

    def next(self):
        try:
            while 1:
                try:
                    item = self._events[self._index]
                    self._index += 1
                    return item
                except IndexError:
                    pass
                if self._error:
                    e = self._error
                    self._error = None
                    raise e
                if self._parser is None:
                    self.root = self._root
                    break
                # load event buffer
                del self._events[:]
                self._index = 0
                data = self._file.read(16384)
                if data:
                    try:
                        self._parser.feed(data)
                    except SyntaxError as exc:
                        self._error = exc
                else:
                    self._root = self._parser.close()
                    self._parser = None
        except:
            if self._close_file:
                self._file.close()
            raise
        if self._close_file:
            self._file.close()
        raise StopIteration

    def __iter__(self):
        return self

##
# Parses an XML document from a string constant.  This function can
# be used to embed "XML literals" in Python code.
#
# @param source A string containing XML data.
# @param parser An optional parser instance.  If not given, the
#     standard {@link XMLParser} parser is used.
# @return An Element instance.
# @defreturn Element

def XML(text, parser=None):
    if not parser:
        parser = XMLParser(target=TreeBuilder())
    parser.feed(text)
    return parser.close()

##
# Parses an XML document from a string constant, and also returns
# a dictionary which maps from element id:s to elements.
#
# @param source A string containing XML data.
# @param parser An optional parser instance.  If not given, the
#     standard {@link XMLParser} parser is used.
# @return A tuple containing an Element instance and a dictionary.
# @defreturn (Element, dictionary)

def XMLID(text, parser=None):
    if not parser:
        parser = XMLParser(target=TreeBuilder())
    parser.feed(text)
    tree = parser.close()
    ids = {}
    for elem in tree.iter():
        id = elem.get("id")
        if id:
            ids[id] = elem
    return tree, ids

##
# Parses an XML document from a string constant.  Same as {@link #XML}.
#
# @def fromstring(text)
# @param source A string containing XML data.
# @return An Element instance.
# @defreturn Element

fromstring = XML

##
# Parses an XML document from a sequence of string fragments.
#
# @param sequence A list or other sequence containing XML data fragments.
# @param parser An optional parser instance.  If not given, the
#     standard {@link XMLParser} parser is used.
# @return An Element instance.
# @defreturn Element
# @since 1.3

def fromstringlist(sequence, parser=None):
    if not parser:
        parser = XMLParser(target=TreeBuilder())
    for text in sequence:
        parser.feed(text)
    return parser.close()

# --------------------------------------------------------------------

##
# Generic element structure builder.  This builder converts a sequence
# of {@link #TreeBuilder.start}, {@link #TreeBuilder.data}, and {@link
# #TreeBuilder.end} method calls to a well-formed element structure.
# <p>
# You can use this class to build an element structure using a custom XML
# parser, or a parser for some other XML-like format.
#
# @param element_factory Optional element factory.  This factory
#    is called to create new Element instances, as necessary.

class TreeBuilder(object):

    def __init__(self, element_factory=None):
        self._data = [] # data collector
        self._elem = [] # element stack
        self._last = None # last element
        self._tail = None # true if we're after an end tag
        if element_factory is None:
            element_factory = Element
        self._factory = element_factory

    ##
    # Flushes the builder buffers, and returns the toplevel document
    # element.
    #
    # @return An Element instance.
    # @defreturn Element

    def close(self):
        assert len(self._elem) == 0, "missing end tags"
        assert self._last is not None, "missing toplevel element"
        return self._last

    def _flush(self):
        if self._data:
            if self._last is not None:
                text = "".join(self._data)
                if self._tail:
                    assert self._last.tail is None, "internal error (tail)"
                    self._last.tail = text
                else:
                    assert self._last.text is None, "internal error (text)"
                    self._last.text = text
            self._data = []

    ##
    # Adds text to the current element.
    #
    # @param data A string.  This should be either an 8-bit string
    #    containing ASCII text, or a Unicode string.

    def data(self, data):
        self._data.append(data)

    ##
    # Opens a new element.
    #
    # @param tag The element name.
    # @param attrib A dictionary containing element attributes.
    # @return The opened element.
    # @defreturn Element

    def start(self, tag, attrs):
        self._flush()
        self._last = elem = self._factory(tag, attrs)
        if self._elem:
            self._elem[-1].append(elem)
        self._elem.append(elem)
        self._tail = 0
        return elem

    ##
    # Closes the current element.
    #
    # @param tag The element name.
    # @return The closed element.
    # @defreturn Element

    def end(self, tag):
        self._flush()
        self._last = self._elem.pop()
        assert self._last.tag == tag,\
               "end tag mismatch (expected %s, got %s)" % (
                   self._last.tag, tag)
        self._tail = 1
        return self._last

_sentinel = ['sentinel']

##
# Element structure builder for XML source data, based on the
# <b>expat</b> parser.
#
# @keyparam target Target object.  If omitted, the builder uses an
#     instance of the standard {@link #TreeBuilder} class.
# @keyparam html Predefine HTML entities.  This flag is not supported
#     by the current implementation.
# @keyparam encoding Optional encoding.  If given, the value overrides
#     the encoding specified in the XML file.
# @see #ElementTree
# @see #TreeBuilder

class XMLParser(object):

    def __init__(self, html=_sentinel, target=None, encoding=None):
        if html is not _sentinel:
            warnings.warnpy3k(
                "The html argument of XMLParser() is deprecated",
                DeprecationWarning, stacklevel=2)
        try:
            from xml.parsers import expat
        except ImportError:
            try:
                import pyexpat as expat
            except ImportError:
                raise ImportError(
                    "No module named expat; use SimpleXMLTreeBuilder instead"
                    )
        parser = expat.ParserCreate(encoding, "}")
        if target is None:
            target = TreeBuilder()
        # underscored names are provided for compatibility only
        self.parser = self._parser = parser
        self.target = self._target = target
        self._error = expat.error
        self._names = {} # name memo cache
        # callbacks
        parser.DefaultHandlerExpand = self._default
        parser.StartElementHandler = self._start
        parser.EndElementHandler = self._end
        parser.CharacterDataHandler = self._data
        # optional callbacks
        parser.CommentHandler = self._comment
        parser.ProcessingInstructionHandler = self._pi
        # let expat do the buffering, if supported
        try:
            self._parser.buffer_text = 1
        except AttributeError:
            pass
        # use new-style attribute handling, if supported
        try:
            self._parser.ordered_attributes = 1
            self._parser.specified_attributes = 1
            parser.StartElementHandler = self._start_list
        except AttributeError:
            pass
        self._doctype = None
        self.entity = {}
        try:
            self.version = "Expat %d.%d.%d" % expat.version_info
        except AttributeError:
            pass # unknown

    def _raiseerror(self, value):
        err = ParseError(value)
        err.code = value.code
        err.position = value.lineno, value.offset
        raise err

    def _fixtext(self, text):
        # convert text string to ascii, if possible
        try:
            return text.encode("ascii")
        except UnicodeError:
            return text

    def _fixname(self, key):
        # expand qname, and convert name string to ascii, if possible
        try:
            name = self._names[key]
        except KeyError:
            name = key
            if "}" in name:
                name = "{" + name
            self._names[key] = name = self._fixtext(name)
        return name

    def _start(self, tag, attrib_in):
        fixname = self._fixname
        fixtext = self._fixtext
        tag = fixname(tag)
        attrib = {}
        for key, value in attrib_in.items():
            attrib[fixname(key)] = fixtext(value)
        return self.target.start(tag, attrib)

    def _start_list(self, tag, attrib_in):
        fixname = self._fixname
        fixtext = self._fixtext
        tag = fixname(tag)
        attrib = {}
        if attrib_in:
            for i in range(0, len(attrib_in), 2):
                attrib[fixname(attrib_in[i])] = fixtext(attrib_in[i+1])
        return self.target.start(tag, attrib)

    def _data(self, text):
        return self.target.data(self._fixtext(text))

    def _end(self, tag):
        return self.target.end(self._fixname(tag))

    def _comment(self, data):
        try:
            comment = self.target.comment
        except AttributeError:
            pass
        else:
            return comment(self._fixtext(data))

    def _pi(self, target, data):
        try:
            pi = self.target.pi
        except AttributeError:
            pass
        else:
            return pi(self._fixtext(target), self._fixtext(data))

    def _default(self, text):
        prefix = text[:1]
        if prefix == "&":
            # deal with undefined entities
            try:
                self.target.data(self.entity[text[1:-1]])
            except KeyError:
                from xml.parsers import expat
                err = expat.error(
                    "undefined entity %s: line %d, column %d" %
                    (text, self._parser.ErrorLineNumber,
                    self._parser.ErrorColumnNumber)
                    )
                err.code = 11 # XML_ERROR_UNDEFINED_ENTITY
                err.lineno = self._parser.ErrorLineNumber
                err.offset = self._parser.ErrorColumnNumber
                raise err
        elif prefix == "<" and text[:9] == "<!DOCTYPE":
            self._doctype = [] # inside a doctype declaration
        elif self._doctype is not None:
            # parse doctype contents
            if prefix == ">":
                self._doctype = None
                return
            text = text.strip()
            if not text:
                return
            self._doctype.append(text)
            n = len(self._doctype)
            if n > 2:
                type = self._doctype[1]
                if type == "PUBLIC" and n == 4:
                    name, type, pubid, system = self._doctype
                elif type == "SYSTEM" and n == 3:
                    name, type, system = self._doctype
                    pubid = None
                else:
                    return
                if pubid:
                    pubid = pubid[1:-1]
                if hasattr(self.target, "doctype"):
                    self.target.doctype(name, pubid, system[1:-1])
                elif self.doctype != self._XMLParser__doctype:
                    # warn about deprecated call
                    self._XMLParser__doctype(name, pubid, system[1:-1])
                    self.doctype(name, pubid, system[1:-1])
                self._doctype = None

    ##
    # (Deprecated) Handles a doctype declaration.
    #
    # @param name Doctype name.
    # @param pubid Public identifier.
    # @param system System identifier.

    def doctype(self, name, pubid, system):
        """This method of XMLParser is deprecated."""
        warnings.warn(
            "This method of XMLParser is deprecated.  Define doctype() "
            "method on the TreeBuilder target.",
            DeprecationWarning,
            )

    # sentinel, if doctype is redefined in a subclass
    __doctype = doctype

    ##
    # Feeds data to the parser.
    #
    # @param data Encoded data.

    def feed(self, data):
        try:
            self._parser.Parse(data, 0)
        except self._error, v:
            self._raiseerror(v)

    ##
    # Finishes feeding data to the parser.
    #
    # @return An element structure.
    # @defreturn Element

    def close(self):
        try:
            self._parser.Parse("", 1) # end of data
        except self._error, v:
            self._raiseerror(v)
        tree = self.target.close()
        del self.target, self._parser # get rid of circular references
        return tree

# compatibility
XMLTreeBuilder = XMLParser

# workaround circular import.
try:
    from ElementC14N import _serialize_c14n
    _serialize["c14n"] = _serialize_c14n
except ImportError:
    pass
PKF�\����ElementInclude.pynu�[���#
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl   created
# 2003-11-14 fl   fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.

##
# Limited XInclude support for the ElementTree package.
##

import copy
from . import ElementTree

XINCLUDE = "{http://www.w3.org/2001/XInclude}"

XINCLUDE_INCLUDE = XINCLUDE + "include"
XINCLUDE_FALLBACK = XINCLUDE + "fallback"

##
# Fatal include error.

class FatalIncludeError(SyntaxError):
    pass

##
# Default loader.  This loader reads an included resource from disk.
#
# @param href Resource reference.
# @param parse Parse mode.  Either "xml" or "text".
# @param encoding Optional text encoding.
# @return The expanded resource.  If the parse mode is "xml", this
#    is an ElementTree instance.  If the parse mode is "text", this
#    is a Unicode string.  If the loader fails, it can return None
#    or raise an IOError exception.
# @throws IOError If the loader fails to load the resource.

def default_loader(href, parse, encoding=None):
    with open(href) as file:
        if parse == "xml":
            data = ElementTree.parse(file).getroot()
        else:
            data = file.read()
            if encoding:
                data = data.decode(encoding)
    return data

##
# Expand XInclude directives.
#
# @param elem Root element.
# @param loader Optional resource loader.  If omitted, it defaults
#     to {@link default_loader}.  If given, it should be a callable
#     that implements the same interface as <b>default_loader</b>.
# @throws FatalIncludeError If the function fails to include a given
#     resource, or if the tree contains malformed XInclude elements.
# @throws IOError If the function fails to load a given resource.

def include(elem, loader=None):
    if loader is None:
        loader = default_loader
    # look for xinclude elements
    i = 0
    while i < len(elem):
        e = elem[i]
        if e.tag == XINCLUDE_INCLUDE:
            # process xinclude directive
            href = e.get("href")
            parse = e.get("parse", "xml")
            if parse == "xml":
                node = loader(href, parse)
                if node is None:
                    raise FatalIncludeError(
                        "cannot load %r as %r" % (href, parse)
                        )
                node = copy.copy(node)
                if e.tail:
                    node.tail = (node.tail or "") + e.tail
                elem[i] = node
            elif parse == "text":
                text = loader(href, parse, e.get("encoding"))
                if text is None:
                    raise FatalIncludeError(
                        "cannot load %r as %r" % (href, parse)
                        )
                if i:
                    node = elem[i-1]
                    node.tail = (node.tail or "") + text + (e.tail or "")
                else:
                    elem.text = (elem.text or "") + text + (e.tail or "")
                del elem[i]
                continue
            else:
                raise FatalIncludeError(
                    "unknown parse type in xi:include tag (%r)" % parse
                )
        elif e.tag == XINCLUDE_FALLBACK:
            raise FatalIncludeError(
                "xi:fallback tag must be child of xi:include (%r)" % e.tag
                )
        else:
            include(e, loader)
        i = i + 1
PKA�\���G|�|�ElementTree.pycnu�[����
{fc@s>dddddddddd	d
ddd
dddddddgZdZddlZddlZddlZdefd��YZyddlmZWne	k
r�e�ZnXd	e
fd��YZd�Zdefd��YZ
e
ZZid�Zed �Zed!�ZeZdefd"��YZdefd#��YZed$�Zd%�Zd&d'd(d)d*d+d,d-d.d/d0d1d2f
Zyee�ZWnek
r�nXd3�Zd4�Zied56ed66ed76Zd8�Zid5d96d6d:6d;d<6d=d>6d?d@6dAdB6dCdD6Z dE�Z!dF�Z"dG�Z#dH�Z$dI�Z%eedJ�Z&eedK�Z'dL�Z(edM�Z)eedN�Z*dOefdP��YZ+edQ�Z,edR�Z-e,Z.edS�Z/defdT��YZ0dUgZ1defdV��YZ2e2Z3yddWl4m5Z5e5edX<Wne	k
r9nXdS(YtCommenttdumptElementtElementTreet
fromstringtfromstringlistt	iselementt	iterparsetparset
ParseErrortPItProcessingInstructiontQNamet
SubElementttostringttostringlisttTreeBuildertVERSIONtXMLt	XMLParsertXMLTreeBuilders1.3.0i����Nt_SimpleElementPathcBs;eZdd�Zddd�Zdd�Zdd�ZRS(cCs(x!|D]}|j|kr|SqWdS(N(ttagtNone(tselftelementRt
namespacestelem((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytfindjs
cCs/|j||�}|dkr"|S|jp.dS(Nt(RRttext(RRRtdefaultRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytfindtextosccsb|d dkr6x#|j|d�D]}|Vq$Wnx%|D]}|j|kr=|Vq=q=WdS(Nis.//(titerR(RRRRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytiterfindts
cCst|j|||��S(N(tlistR"(RRRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytfindall{sN(t__name__t
__module__RRR R"R$(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRhsi(tElementPathcBseZRS((R%R&(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR	�scCst|t�pt|d�S(NR(t
isinstanceRthasattr(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scBs%eZdZdZdZdZid�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zdd�Zddd�Zdd�Zdd�Zd�Zdd�Zd�Zd�Zd�Zdd�Zdd�Zd�Z RS(cKs8|j�}|j|�||_||_g|_dS(N(tcopytupdateRtattribt	_children(RRR,textra((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__init__�s

		cCsdt|j�t|�fS(Ns<Element %s at 0x%x>(treprRtid(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__repr__�scCs|j||�S(N(t	__class__(RRR,((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytmakeelement�scCs;|j|j|j�}|j|_|j|_||(|S(N(R4RR,Rttail(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR*�s
cCs
t|j�S(N(tlenR-(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__len__�scCs)tjdtdd�t|j�dkS(NsyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.t
stacklevelii(twarningstwarnt
FutureWarningR6R-(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__nonzero__�s
cCs|j|S(N(R-(Rtindex((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__getitem__	scCs||j|<dS(N(R-(RR=R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__setitem__scCs|j|=dS(N(R-(RR=((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__delitem__!scCs|jj|�dS(N(R-tappend(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRA,scCs|jj|�dS(N(R-textend(Rtelements((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRB6scCs|jj||�dS(N(R-tinsert(RR=R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRD@scCs|jj|�dS(N(R-tremove(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyREOscCstjdtdd�|jS(NsaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.R8i(R9R:tDeprecationWarningR-(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytgetchildrenZs
cCstj|||�S(N(R'R(RtpathR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRjscCstj||||�S(N(R'R (RRHRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR yscCstj|||�S(N(R'R$(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR$�scCstj|||�S(N(R'R"(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR"�scCs*|jj�g|_d|_|_dS(N(R,tclearR-RRR5(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRI�s
	cCs|jj||�S(N(R,tget(RtkeyR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRJ�scCs||j|<dS(N(R,(RRKtvalue((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytset�scCs
|jj�S(N(R,tkeys(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRN�scCs
|jj�S(N(R,titems(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRO�sccso|dkrd}n|dks0|j|kr8|Vnx0|jD]%}x|j|�D]}|VqXWqBWdS(Nt*(RRR-R!(RRte((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR!�s	cCs)tjdtdd�t|j|��S(NsbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.R8i(R9R:tPendingDeprecationWarningR#R!(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytgetiterator�s
ccs�|j}t|t�r)|dk	r)dS|jr=|jVnx>|D]6}x|j�D]}|VqWW|jrD|jVqDqDWdS(N(RR(t
basestringRRtitertextR5(RRRQts((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRU�s		
		N(!R%R&RRR,RR5R/R2R4R*R7R<R>R?R@RARBRDRERGRR R$R"RIRJRMRNROR!RSRU(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s<
	
						
			
	
				
		
	
cKs<|j�}|j|�|j||�}|j|�|S(N(R*R+R4RA(tparentRR,R.R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR
s


cCstt�}||_|S(N(RRR(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR"s	cCs6tt�}||_|r2|jd||_n|S(Nt (RRR(ttargetRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR1s
	cBs/eZdd�Zd�Zd�Zd�ZRS(cCs&|rd||f}n||_dS(Ns{%s}%s(R(Rttext_or_uriR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/EscCs|jS(N(R(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__str__IscCs
t|j�S(N(thashR(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__hash__KscCs2t|t�r"t|j|j�St|j|�S(N(R(RtcmpR(Rtother((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__cmp__MsN(R%R&RR/R[R]R`(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRDs		cBs�eZddd�Zd�Zd�Zdd�Zdd�Zdd�Zdd�Z	ddd�Z
dd�Zdd	�Zddddd
�Z
d�ZRS(
cCs#||_|r|j|�ndS(N(t_rootR(RRtfile((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/_s	cCs|jS(N(Ra(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytgetrootkscCs
||_dS(N(Ra(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_setrootuscCs�t}t|d�s-t|d�}t}nzb|sKtdt��}nx*|jd�}|sgPn|j|�qNW|j�|_	|j	SWd|r�|j�nXdS(NtreadtrbRYi(
tFalseR)topentTrueRRRetfeedtcloseRa(Rtsourcetparsertclose_sourcetdata((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s 	cCs|jj|�S(N(RaR!(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR!�scCs)tjdtdd�t|j|��S(NsbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.R8i(R9R:RRR#R!(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRS�s
cCsJ|d dkr7d|}tjd|tdd�n|jj||�S(Nit/t.s�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 %rR8i(R9R:R;RaR(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s
cCsM|d dkr7d|}tjd|tdd�n|jj|||�S(NiRpRqs�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 %rR8i(R9R:R;RaR (RRHRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR �s
cCsJ|d dkr7d|}tjd|tdd�n|jj||�S(NiRpRqs�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 %rR8i(R9R:R;RaR$(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR$�s
cCsJ|d dkr7d|}tjd|tdd�n|jj||�S(NiRpRqs�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 %rR8i(R9R:R;RaR"(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR"�s
cCs=|sd}n|tkr.td|��nt|d�rF|}nt|d�}|j}|s�|dkryd}q�d}n>|s�|dkr�|d
kr�|dkr�|d|�q�n|d	kr�t||j|�n>t|j||�\}}	t|}
|
||j|||	�||k	r9|j	�ndS(Ntxmlsunknown method %rtwritetwbtc14nsutf-8sus-asciis$<?xml version='1.0' encoding='%s'?>
R(sutf-8sus-ascii(
t
_serializet
ValueErrorR)RhRsRt_serialize_textRat_namespacesRk(Rtfile_or_filenametencodingtxml_declarationtdefault_namespacetmethodRbRstqnamesRt	serialize((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRss0					
cCs|j|dd�S(NR~Ru(Rs(RRb((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt
write_c14n8sN(R%R&RR/RcRdRR!RSRR R$R"RsR�(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR]s	
	 c	s�idd6�i��r&d��<n�fd������fd�}y
|j}Wntk
rv|j}nXx]|�D]R}|j}t|t�r�|j�kr||j�qn\t|t�r�|�kr||�qn1|dk	r|t	k	r|t
k	rt|�nx||j�D]n\}}t|t�rQ|j}n|�krj||�nt|t�r*|j�kr*||j�q*q*W|j}t|t�r�|j�kr�||j�q�q�W��fS(NRcs
|j��S(N(tencode(R(R{(s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�Jscsy�|d dkr�|djdd�\}}�j|�}|dkr�tj|�}|dkrxdt��}n|dkr�|�|<q�n|r��d||f��|<q��|��|<n%�r�td��n�|��|<Wntk
r
t|�nXdS(Nit{t}sns%dRrs%s:%ss<cannot use non-qualified names with default_namespace option(trsplitRJRt_namespace_mapR6Rwt	TypeErrort_raise_serialization_error(tqnameturiRtprefix(R}R�RR(s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt	add_qnameMs&
(
RR!tAttributeErrorRSRR(RRRTRR
R�RO(	RR{R}R�titerateRRKRLR((R}R�R{RRs-/usr/lib64/python2.7/xml/etree/ElementTree.pyRy?s>




	$

	cCss|j}|j}|tkr8|dt||��n|tkr^|dt||��n�||}|dkr�|r�|t||��nx�|D]}t||||d�q�Wn�|d|�|j�}|s�|r�|rNxet	|j�dd��D]E\}	}
|
r!d|
}
n|d|
j
|�t|	|�f�qWnx~t	|�D]m\}
}	t|
t
�r�|
j}
nt|	t
�r�||	j}	nt|	|�}	|d||
|	f�q[Wn|s�t|�rC|d	�|r|t||��nx$|D]}t||||d�qW|d
|d	�n
|d�|jro|t|j|��ndS(Ns	<!--%s-->s<?%s?>t<RKcSs|dS(Ni((tx((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt<lambda>�Rt:s
 xmlns%s="%s"s %s="%s"t>s</s />(RRRt_encodeRRt
_escape_cdatat_serialize_xmlROtsortedR�t_escape_attribR(RR6R5(RsRR{RRRRRQROtvtk((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��sP		





	tareatbasetbasefonttbrtcoltframethrtimgtinputtisindextlinktmetatparamcCs�|j}|j}|tkr8|dt||��n?|tkr^|dt||��n||}|dkr�|r�|t||��nx�|D]}t||||d�q�Wn�|d|�|j�}|s�|r�|rNxet|j�dd��D]E\}	}
|
r!d|
}
n|d|
j	|�t
|	|�f�qWnx~t|�D]m\}
}	t|
t�r�|
j}
nt|	t�r�||	j}	nt
|	|�}	|d||
|	f�q[Wn|d	�|j�}|r/|d
ks|dkr|t||��q/|t||��nx$|D]}t||||d�q6W|tkrw|d|d	�n|jr�|t|j|��ndS(
Ns	<!--%s-->s<?%s?>R�RKcSs|dS(Ni((R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��RR�s
 xmlns%s="%s"s %s="%s"R�tscripttstyles</(RRRR�RRt_serialize_htmlROR�R�R�R(Rt_escape_attrib_htmltlowerR�t
HTML_EMPTYR5(RsRR{RRRRRQROR�R�tltag((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��sT		




	cCsPx'|j�D]}||j|��q
W|jrL||jj|��ndS(N(RUR�R5(RsRR{tpart((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRx�s	RrthtmlRcCsntjd|�r!td��nx<tj�D].\}}||ksR||kr.t|=q.q.W|t|<dS(Nsns\d+$s'Prefix format reserved for internal use(tretmatchRwR�RO(R�R�R�R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytregister_namespacess$http://www.w3.org/XML/1998/namespaceshttp://www.w3.org/1999/xhtmltrdfs+http://www.w3.org/1999/02/22-rdf-syntax-ns#twsdls http://schemas.xmlsoap.org/wsdl/txss http://www.w3.org/2001/XMLSchematxsis)http://www.w3.org/2001/XMLSchema-instancetdcs http://purl.org/dc/elements/1.1/cCs#td|t|�jf��dS(Nscannot serialize %r (type %s)(R�ttypeR%(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs<y|j|d�SWn!ttfk
r7t|�nXdS(Ntxmlcharrefreplace(R�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs�ywd|kr$|jdd�}nd|krE|jdd�}nd|krf|jdd�}n|j|d�SWn!ttfk
r�t|�nXdS(Nt&s&amp;R�s&lt;R�s&gt;R�(treplaceR�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�%scCs�y�d|kr$|jdd�}nd|krE|jdd�}nd|krf|jdd�}nd|kr�|jdd�}nd	|kr�|jd	d
�}n|j|d�SWn!ttfk
r�t|�nXdS(NR�s&amp;R�s&lt;R�s&gt;s"s&quot;s
s&#10;R�(R�R�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�5scCs�ywd|kr$|jdd�}nd|krE|jdd�}nd|krf|jdd�}n|j|d�SWn!ttfk
r�t|�nXdS(NR�s&amp;R�s&gt;s"s&quot;R�(R�R�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�FscCsWddd��Y}g}|�}|j|_t|�j||d|�dj|�S(NtdummycBseZRS((R%R&(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�asR~R((RARsRtjoin(RR{R~R�RoRb((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR`s	cCsNddd��Y}g}|�}|j|_t|�j||d|�|S(NR�cBseZRS((R%R&(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�vsR~((RARsR(RR{R~R�RoRb((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRus	cCskt|t�st|�}n|jtj�|j�j}|sT|ddkrgtjjd�ndS(Ni����s
(R(RRstsyststdoutRcR5(RR5((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCst�}|j||�|S(N(RR(RlRmttree((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s	cCs�t}t|d�s-t|d�}t}ny2|sKtdt��}nt||||�SWn|rx|j�n�nXdS(NReRfRY(RgR)RhRiRRt_IterParseIteratorRk(RlteventsRmRn((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s	
R�cBs&eZed�Zd�Zd�ZRS(cCs�||_||_g|_d|_d|_d|_|_||_|jj}|jj	}|dkrvdg}nx|D]}|dkr�y7d|_
d|_|||jjd�}||_
Wq�tk
r�|||jjd�}||_
q�Xq}|dkr.|||jjd�}||_q}|dkrU||d	�}||_q}|d
kr|||d�}||_q}td|��q}WdS(
NitendtstarticSs|||||�f�dS(N((Rt	attrib_inteventRAR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pythandler�scSs|||||�f�dS(N((RR�R�RAR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��scSs||||�f�dS(N((RR�RAR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��ssstart-nscSsSy|pdjd�}Wntk
r,nX|||p<d|pEdff�dS(NRtascii(R�tUnicodeError(R�R�R�RA((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s

send-nscSs||df�dS(N(R(R�R�RA((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��ssunknown event %r(t_filet_close_filet_eventst_indexRt_errortrootRat_parserRAtordered_attributestspecified_attributest_start_listtStartElementHandlerR�t_startt_endtEndElementHandlertStartNamespaceDeclHandlertEndNamespaceDeclHandlerRw(RRlR�RmRnRAR�R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/�sD						
		

cCsKyx�y'|j|j}|jd7_|SWntk
r@nX|jre|j}d|_|�n|jdkr�|j|_Pn|j2d|_|jj	d�}|r�y|jj
|�Wq�tk
r�}||_q�Xq|jj�|_d|_qWWn#|j
r!|jj�n�nX|j
rA|jj�nt�dS(Niii@(R�R�t
IndexErrorR�RR�RaR�R�ReRjtSyntaxErrorRkR�t
StopIteration(RtitemRQRotexc((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytnext�s@
							cCs|S(N((R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__iter__s(R%R&RgR/R�R�(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s/	$cCs2|stdt��}n|j|�|j�S(NRY(RRRjRk(RRm((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRs
cCs}|stdt��}n|j|�|j�}i}x6|j�D](}|jd�}|rG|||<qGqGW||fS(NRYR1(RRRjRkR!RJ(RRmR�tidsRR1((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytXMLID,s
cCsC|stdt��}nx|D]}|j|�q"W|j�S(NRY(RRRjRk(tsequenceRmR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRLs

cBsAeZdd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsFg|_g|_d|_d|_|dkr9t}n||_dS(N(t_datat_elemRt_lastt_tailRt_factory(Rtelement_factory((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/bs					cCsCt|j�dks!td��|jdk	s<td��|jS(Nismissing end tagssmissing toplevel element(R6R�tAssertionErrorR�R(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRkrs!cCs�|jr�|jdk	r�dj|j�}|jr`|jjdksQtd��||j_q�|jjdks~td��||j_ng|_ndS(NRsinternal error (tail)sinternal error (text)(R�R�RR�R�R5R�R(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_flushws		cCs|jj|�dS(N(R�RA(RRo((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRo�scCs`|j�|j||�|_}|jrC|jdj|�n|jj|�d|_|S(Ni����i(R�R�R�R�RAR�(RRtattrsR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s
		cCsZ|j�|jj�|_|jj|ksJtd|jj|f��d|_|jS(Ns&end tag mismatch (expected %s, got %s)i(R�R�tpopR�RR�R�(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s
	N(	R%R&RR/RkR�RoR�R�(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR`s				tsentinelcBs�eZeddd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�ZeZd�Zd
�ZRS(cCs�|tk	r%tjdtdd�nyddlm}WnAtk
r|yddl}Wq}tk
rxtd��q}XnX|j|d�}|dkr�t
�}n||_|_||_
|_|j|_i|_|j|_|j|_|j|_|j|_|j|_|j|_yd|j_Wntk
rGnXy(d|j_ d|j_!|j"|_Wntk
r�nXd|_#i|_$yd	|j%|_&Wntk
r�nXdS(
Ns.The html argument of XMLParser() is deprecatedR8ii����(texpats7No module named expat; use SimpleXMLTreeBuilder insteadR�isExpat %d.%d.%d('t	_sentinelR9twarnpy3kRFtxml.parsersR�tImportErrortpyexpattParserCreateRRRmR�RYt_targetterrorR�t_namest_defaulttDefaultHandlerExpandR�R�R�R�R�tCharacterDataHandlert_commenttCommentHandlert_pitProcessingInstructionHandlertbuffer_textR�R�R�R�t_doctypetentitytversion_infotversion(RR�RYR{R�Rm((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/�sR

	

		
cCs7t|�}|j|_|j|jf|_|�dS(N(R	tcodetlinenotoffsettposition(RRLterr((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_raiseerror�scCs*y|jd�SWntk
r%|SXdS(NR�(R�R�(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_fixtext�s
cCsby|j|}WnJtk
r]|}d|kr@d|}n|j|�|j|<}nX|S(NR�R�(R�tKeyErrorR(RRKtname((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_fixname�s

cCsj|j}|j}||�}i}x0|j�D]"\}}||�|||�<q1W|jj||�S(N(RRRORYR�(RRR�tfixnametfixtextR,RKRL((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s		cCs�|j}|j}||�}i}|rrxEtdt|�d�D](}|||d�||||�<qCWn|jj||�S(Niii(RRtrangeR6RYR�(RRR�RRR,ti((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s		)cCs|jj|j|��S(N(RYRoR(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs|jj|j|��S(N(RYR�R(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs;y|jj}Wntk
r#nX||j|��SdS(N(RYtcommentR�R(RRoR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR� s

cCsGy|jj}Wntk
r#n X||j|�|j|��SdS(N(RYtpiR�R(RRYRoR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�(s

c
Cs]|d }|dkr�y"|jj|j|dd!�WqYtk
r�ddlm}|jd||jj|jj	f�}d|_
|jj|_|jj	|_|�qYXn�|dkr�|d d	kr�g|_
n}|j
dk	rY|d
krd|_
dS|j�}|sdS|j
j|�t|j
�}|dkrY|j
d}|dkr�|d
kr�|j
\}}}}	n7|dkr�|dkr�|j
\}}}	d}ndS|r�|dd!}nt|jd�r|jj|||	dd!�nI|j|jkrJ|j|||	dd!�|j|||	dd!�nd|_
qYndS(NiR�i����(R�s'undefined entity %s: line %d, column %diR�i	s	<!DOCTYPER�itPUBLICitSYSTEMitdoctype(RYRoRR
R�R�R�R�tErrorLineNumbertErrorColumnNumberRRRRRtstripRAR6R)Rt_XMLParser__doctype(
RRR�R�R
tnR�Rtpubidtsystem((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�0sR
"
	
	
	 cCstjdt�dS(s'This method of XMLParser is deprecated.s[This method of XMLParser is deprecated.  Define doctype() method on the TreeBuilder target.N(R9R:RF(RRRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRgscCsAy|jj|d�Wn#|jk
r<}|j|�nXdS(Ni(R�tParseR�R(RRoR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRjwscCs\y|jjdd�Wn#|jk
r<}|j|�nX|jj�}|`|`|S(NRi(R�R R�RRYRk(RR�R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRk�sN(R%R&R�RR/RRRR�R�R�R�R�R�R�RRRjRk(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s1						
					7			(t_serialize_c14nRu(6t__all__RR�R�R9tobjectRRR'R�R�R	RRt_Elementt_ElementInterfaceR
RRRR
RRRyR�R�RMt	NameErrorR�RxRvR�R�R�R�R�R�R�RRRRRR�RR�RRRR�RRtElementC14NR!(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt<module>;s�

		�U
�D	/
	2	
	
						bM	�
PKA�\�Y檯�ElementInclude.pyonu�[����
{fc@shddlZddlmZdZedZedZdefd��YZdd	�Z	dd
�Z
dS(i����Ni(tElementTrees!{http://www.w3.org/2001/XInclude}tincludetfallbacktFatalIncludeErrorcBseZRS((t__name__t
__module__(((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pyR>scCsat|��O}|dkr3tj|�j�}n$|j�}|rW|j|�}nWdQX|S(Ntxml(topenRtparsetgetroottreadtdecode(threfRtencodingtfiletdata((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pytdefault_loaderMscCs�|dkrt}nd}x�|t|�kr�||}|jtkr�|jd�}|jdd�}|dkr�|||�}|dkr�td||f��ntj|�}|jr�|jp�d|j|_n|||<q�|dkr�||||jd��}|dkr7td||f��n|rq||d	}|jpWd||jpgd|_n#|j	p}d||jp�d|_	||=qq�td
|��n2|jt
kr�td|j��n
t||�|d	}qWdS(NiRRRscannot load %r as %rtttextR
is)unknown parse type in xi:include tag (%r)s0xi:fallback tag must be child of xi:include (%r)(tNoneRtlenttagtXINCLUDE_INCLUDEtgetRtcopyttailRtXINCLUDE_FALLBACKR(telemtloadertiteRRtnodeR((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pyRbsF	
	
&#
(RRRtXINCLUDERRtSyntaxErrorRRRR(((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pyt<module>3s

PKA�\�Y檯�ElementInclude.pycnu�[����
{fc@shddlZddlmZdZedZedZdefd��YZdd	�Z	dd
�Z
dS(i����Ni(tElementTrees!{http://www.w3.org/2001/XInclude}tincludetfallbacktFatalIncludeErrorcBseZRS((t__name__t
__module__(((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pyR>scCsat|��O}|dkr3tj|�j�}n$|j�}|rW|j|�}nWdQX|S(Ntxml(topenRtparsetgetroottreadtdecode(threfRtencodingtfiletdata((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pytdefault_loaderMscCs�|dkrt}nd}x�|t|�kr�||}|jtkr�|jd�}|jdd�}|dkr�|||�}|dkr�td||f��ntj|�}|jr�|jp�d|j|_n|||<q�|dkr�||||jd��}|dkr7td||f��n|rq||d	}|jpWd||jpgd|_n#|j	p}d||jp�d|_	||=qq�td
|��n2|jt
kr�td|j��n
t||�|d	}qWdS(NiRRRscannot load %r as %rtttextR
is)unknown parse type in xi:include tag (%r)s0xi:fallback tag must be child of xi:include (%r)(tNoneRtlenttagtXINCLUDE_INCLUDEtgetRtcopyttailRtXINCLUDE_FALLBACKR(telemtloadertiteRRtnodeR((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pyRbsF	
	
&#
(RRRtXINCLUDERRtSyntaxErrorRRRR(((s0/usr/lib64/python2.7/xml/etree/ElementInclude.pyt<module>3s

PKA�\P��^��cElementTree.pyonu�[����
{fc@sddlTdS(i����(t*N(t_elementtree(((s./usr/lib64/python2.7/xml/etree/cElementTree.pyt<module>tPKA�\[��	��ElementTree.pyonu�[����
{fc@s>dddddddddd	d
ddd
dddddddgZdZddlZddlZddlZdefd��YZyddlmZWne	k
r�e�ZnXd	e
fd��YZd�Zdefd��YZ
e
ZZid�Zed �Zed!�ZeZdefd"��YZdefd#��YZed$�Zd%�Zd&d'd(d)d*d+d,d-d.d/d0d1d2f
Zyee�ZWnek
r�nXd3�Zd4�Zied56ed66ed76Zd8�Zid5d96d6d:6d;d<6d=d>6d?d@6dAdB6dCdD6Z dE�Z!dF�Z"dG�Z#dH�Z$dI�Z%eedJ�Z&eedK�Z'dL�Z(edM�Z)eedN�Z*dOefdP��YZ+edQ�Z,edR�Z-e,Z.edS�Z/defdT��YZ0dUgZ1defdV��YZ2e2Z3yddWl4m5Z5e5edX<Wne	k
r9nXdS(YtCommenttdumptElementtElementTreet
fromstringtfromstringlistt	iselementt	iterparsetparset
ParseErrortPItProcessingInstructiontQNamet
SubElementttostringttostringlisttTreeBuildertVERSIONtXMLt	XMLParsertXMLTreeBuilders1.3.0i����Nt_SimpleElementPathcBs;eZdd�Zddd�Zdd�Zdd�ZRS(cCs(x!|D]}|j|kr|SqWdS(N(ttagtNone(tselftelementRt
namespacestelem((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytfindjs
cCs/|j||�}|dkr"|S|jp.dS(Nt(RRttext(RRRtdefaultRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytfindtextosccsb|d dkr6x#|j|d�D]}|Vq$Wnx%|D]}|j|kr=|Vq=q=WdS(Nis.//(titerR(RRRRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytiterfindts
cCst|j|||��S(N(tlistR"(RRRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytfindall{sN(t__name__t
__module__RRR R"R$(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRhsi(tElementPathcBseZRS((R%R&(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR	�scCst|t�pt|d�S(NR(t
isinstanceRthasattr(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scBs%eZdZdZdZdZid�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zdd�Zddd�Zdd�Zdd�Zd�Zdd�Zd�Zd�Zd�Zdd�Zdd�Zd�Z RS(cKs8|j�}|j|�||_||_g|_dS(N(tcopytupdateRtattribt	_children(RRR,textra((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__init__�s

		cCsdt|j�t|�fS(Ns<Element %s at 0x%x>(treprRtid(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__repr__�scCs|j||�S(N(t	__class__(RRR,((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytmakeelement�scCs;|j|j|j�}|j|_|j|_||(|S(N(R4RR,Rttail(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR*�s
cCs
t|j�S(N(tlenR-(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__len__�scCs)tjdtdd�t|j�dkS(NsyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.t
stacklevelii(twarningstwarnt
FutureWarningR6R-(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__nonzero__�s
cCs|j|S(N(R-(Rtindex((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__getitem__	scCs||j|<dS(N(R-(RR=R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__setitem__scCs|j|=dS(N(R-(RR=((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__delitem__!scCs|jj|�dS(N(R-tappend(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRA,scCs|jj|�dS(N(R-textend(Rtelements((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRB6scCs|jj||�dS(N(R-tinsert(RR=R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRD@scCs|jj|�dS(N(R-tremove(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyREOscCstjdtdd�|jS(NsaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.R8i(R9R:tDeprecationWarningR-(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytgetchildrenZs
cCstj|||�S(N(R'R(RtpathR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRjscCstj||||�S(N(R'R (RRHRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR yscCstj|||�S(N(R'R$(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR$�scCstj|||�S(N(R'R"(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR"�scCs*|jj�g|_d|_|_dS(N(R,tclearR-RRR5(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRI�s
	cCs|jj||�S(N(R,tget(RtkeyR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRJ�scCs||j|<dS(N(R,(RRKtvalue((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytset�scCs
|jj�S(N(R,tkeys(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRN�scCs
|jj�S(N(R,titems(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRO�sccso|dkrd}n|dks0|j|kr8|Vnx0|jD]%}x|j|�D]}|VqXWqBWdS(Nt*(RRR-R!(RRte((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR!�s	cCs)tjdtdd�t|j|��S(NsbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.R8i(R9R:tPendingDeprecationWarningR#R!(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytgetiterator�s
ccs�|j}t|t�r)|dk	r)dS|jr=|jVnx>|D]6}x|j�D]}|VqWW|jrD|jVqDqDWdS(N(RR(t
basestringRRtitertextR5(RRRQts((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRU�s		
		N(!R%R&RRR,RR5R/R2R4R*R7R<R>R?R@RARBRDRERGRR R$R"RIRJRMRNROR!RSRU(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s<
	
						
			
	
				
		
	
cKs<|j�}|j|�|j||�}|j|�|S(N(R*R+R4RA(tparentRR,R.R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR
s


cCstt�}||_|S(N(RRR(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR"s	cCs6tt�}||_|r2|jd||_n|S(Nt (RRR(ttargetRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR1s
	cBs/eZdd�Zd�Zd�Zd�ZRS(cCs&|rd||f}n||_dS(Ns{%s}%s(R(Rttext_or_uriR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/EscCs|jS(N(R(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__str__IscCs
t|j�S(N(thashR(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__hash__KscCs2t|t�r"t|j|j�St|j|�S(N(R(RtcmpR(Rtother((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__cmp__MsN(R%R&RR/R[R]R`(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRDs		cBs�eZddd�Zd�Zd�Zdd�Zdd�Zdd�Zdd�Z	ddd�Z
dd�Zdd	�Zddddd
�Z
d�ZRS(
cCs#||_|r|j|�ndS(N(t_rootR(RRtfile((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/_s	cCs|jS(N(Ra(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytgetrootkscCs
||_dS(N(Ra(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_setrootuscCs�t}t|d�s-t|d�}t}nzb|sKtdt��}nx*|jd�}|sgPn|j|�qNW|j�|_	|j	SWd|r�|j�nXdS(NtreadtrbRYi(
tFalseR)topentTrueRRRetfeedtcloseRa(Rtsourcetparsertclose_sourcetdata((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s 	cCs|jj|�S(N(RaR!(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR!�scCs)tjdtdd�t|j|��S(NsbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.R8i(R9R:RRR#R!(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRS�s
cCsJ|d dkr7d|}tjd|tdd�n|jj||�S(Nit/t.s�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 %rR8i(R9R:R;RaR(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s
cCsM|d dkr7d|}tjd|tdd�n|jj|||�S(NiRpRqs�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 %rR8i(R9R:R;RaR (RRHRR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR �s
cCsJ|d dkr7d|}tjd|tdd�n|jj||�S(NiRpRqs�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 %rR8i(R9R:R;RaR$(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR$�s
cCsJ|d dkr7d|}tjd|tdd�n|jj||�S(NiRpRqs�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 %rR8i(R9R:R;RaR"(RRHR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR"�s
cCs=|sd}n|tkr.td|��nt|d�rF|}nt|d�}|j}|s�|dkryd}q�d}n>|s�|dkr�|d
kr�|dkr�|d|�q�n|d	kr�t||j|�n>t|j||�\}}	t|}
|
||j|||	�||k	r9|j	�ndS(Ntxmlsunknown method %rtwritetwbtc14nsutf-8sus-asciis$<?xml version='1.0' encoding='%s'?>
R(sutf-8sus-ascii(
t
_serializet
ValueErrorR)RhRsRt_serialize_textRat_namespacesRk(Rtfile_or_filenametencodingtxml_declarationtdefault_namespacetmethodRbRstqnamesRt	serialize((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRss0					
cCs|j|dd�S(NR~Ru(Rs(RRb((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt
write_c14n8sN(R%R&RR/RcRdRR!RSRR R$R"RsR�(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR]s	
	 c	s�idd6�i��r&d��<n�fd������fd�}y
|j}Wntk
rv|j}nXx]|�D]R}|j}t|t�r�|j�kr||j�qn\t|t�r�|�kr||�qn1|dk	r|t	k	r|t
k	rt|�nx||j�D]n\}}t|t�rQ|j}n|�krj||�nt|t�r*|j�kr*||j�q*q*W|j}t|t�r�|j�kr�||j�q�q�W��fS(NRcs
|j��S(N(tencode(R(R{(s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�Jscsy�|d dkr�|djdd�\}}�j|�}|dkr�tj|�}|dkrxdt��}n|dkr�|�|<q�n|r��d||f��|<q��|��|<n%�r�td��n�|��|<Wntk
r
t|�nXdS(Nit{t}sns%dRrs%s:%ss<cannot use non-qualified names with default_namespace option(trsplitRJRt_namespace_mapR6Rwt	TypeErrort_raise_serialization_error(tqnameturiRtprefix(R}R�RR(s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt	add_qnameMs&
(
RR!tAttributeErrorRSRR(RRRTRR
R�RO(	RR{R}R�titerateRRKRLR((R}R�R{RRs-/usr/lib64/python2.7/xml/etree/ElementTree.pyRy?s>




	$

	cCss|j}|j}|tkr8|dt||��n|tkr^|dt||��n�||}|dkr�|r�|t||��nx�|D]}t||||d�q�Wn�|d|�|j�}|s�|r�|rNxet	|j�dd��D]E\}	}
|
r!d|
}
n|d|
j
|�t|	|�f�qWnx~t	|�D]m\}
}	t|
t
�r�|
j}
nt|	t
�r�||	j}	nt|	|�}	|d||
|	f�q[Wn|s�t|�rC|d	�|r|t||��nx$|D]}t||||d�qW|d
|d	�n
|d�|jro|t|j|��ndS(Ns	<!--%s-->s<?%s?>t<RKcSs|dS(Ni((tx((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt<lambda>�Rt:s
 xmlns%s="%s"s %s="%s"t>s</s />(RRRt_encodeRRt
_escape_cdatat_serialize_xmlROtsortedR�t_escape_attribR(RR6R5(RsRR{RRRRRQROtvtk((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��sP		





	tareatbasetbasefonttbrtcoltframethrtimgtinputtisindextlinktmetatparamcCs�|j}|j}|tkr8|dt||��n?|tkr^|dt||��n||}|dkr�|r�|t||��nx�|D]}t||||d�q�Wn�|d|�|j�}|s�|r�|rNxet|j�dd��D]E\}	}
|
r!d|
}
n|d|
j	|�t
|	|�f�qWnx~t|�D]m\}
}	t|
t�r�|
j}
nt|	t�r�||	j}	nt
|	|�}	|d||
|	f�q[Wn|d	�|j�}|r/|d
ks|dkr|t||��q/|t||��nx$|D]}t||||d�q6W|tkrw|d|d	�n|jr�|t|j|��ndS(
Ns	<!--%s-->s<?%s?>R�RKcSs|dS(Ni((R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��RR�s
 xmlns%s="%s"s %s="%s"R�tscripttstyles</(RRRR�RRt_serialize_htmlROR�R�R�R(Rt_escape_attrib_htmltlowerR�t
HTML_EMPTYR5(RsRR{RRRRRQROR�R�tltag((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��sT		




	cCsPx'|j�D]}||j|��q
W|jrL||jj|��ndS(N(RUR�R5(RsRR{tpart((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRx�s	RrthtmlRcCsntjd|�r!td��nx<tj�D].\}}||ksR||kr.t|=q.q.W|t|<dS(Nsns\d+$s'Prefix format reserved for internal use(tretmatchRwR�RO(R�R�R�R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytregister_namespacess$http://www.w3.org/XML/1998/namespaceshttp://www.w3.org/1999/xhtmltrdfs+http://www.w3.org/1999/02/22-rdf-syntax-ns#twsdls http://schemas.xmlsoap.org/wsdl/txss http://www.w3.org/2001/XMLSchematxsis)http://www.w3.org/2001/XMLSchema-instancetdcs http://purl.org/dc/elements/1.1/cCs#td|t|�jf��dS(Nscannot serialize %r (type %s)(R�ttypeR%(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs<y|j|d�SWn!ttfk
r7t|�nXdS(Ntxmlcharrefreplace(R�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs�ywd|kr$|jdd�}nd|krE|jdd�}nd|krf|jdd�}n|j|d�SWn!ttfk
r�t|�nXdS(Nt&s&amp;R�s&lt;R�s&gt;R�(treplaceR�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�%scCs�y�d|kr$|jdd�}nd|krE|jdd�}nd|krf|jdd�}nd|kr�|jdd�}nd	|kr�|jd	d
�}n|j|d�SWn!ttfk
r�t|�nXdS(NR�s&amp;R�s&lt;R�s&gt;s"s&quot;s
s&#10;R�(R�R�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�5scCs�ywd|kr$|jdd�}nd|krE|jdd�}nd|krf|jdd�}n|j|d�SWn!ttfk
r�t|�nXdS(NR�s&amp;R�s&gt;s"s&quot;R�(R�R�R�R�R�(RR{((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�FscCsWddd��Y}g}|�}|j|_t|�j||d|�dj|�S(NtdummycBseZRS((R%R&(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�asR~R((RARsRtjoin(RR{R~R�RoRb((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR`s	cCsNddd��Y}g}|�}|j|_t|�j||d|�|S(NR�cBseZRS((R%R&(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�vsR~((RARsR(RR{R~R�RoRb((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRus	cCskt|t�st|�}n|jtj�|j�j}|sT|ddkrgtjjd�ndS(Ni����s
(R(RRstsyststdoutRcR5(RR5((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCst�}|j||�|S(N(RR(RlRmttree((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s	cCs�t}t|d�s-t|d�}t}ny2|sKtdt��}nt||||�SWn|rx|j�n�nXdS(NReRfRY(RgR)RhRiRRt_IterParseIteratorRk(RlteventsRmRn((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s	
R�cBs&eZed�Zd�Zd�ZRS(cCs�||_||_g|_d|_d|_d|_|_||_|jj}|jj	}|dkrvdg}nx|D]}|dkr�y7d|_
d|_|||jjd�}||_
Wq�tk
r�|||jjd�}||_
q�Xq}|dkr.|||jjd�}||_q}|dkrU||d	�}||_q}|d
kr|||d�}||_q}td|��q}WdS(
NitendtstarticSs|||||�f�dS(N((Rt	attrib_inteventRAR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pythandler�scSs|||||�f�dS(N((RR�R�RAR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��scSs||||�f�dS(N((RR�RAR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��ssstart-nscSsSy|pdjd�}Wntk
r,nX|||p<d|pEdff�dS(NRtascii(R�tUnicodeError(R�R�R�RA((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s

send-nscSs||df�dS(N(R(R�R�RA((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��ssunknown event %r(t_filet_close_filet_eventst_indexRt_errortrootRat_parserRAtordered_attributestspecified_attributest_start_listtStartElementHandlerR�t_startt_endtEndElementHandlertStartNamespaceDeclHandlertEndNamespaceDeclHandlerRw(RRlR�RmRnRAR�R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/�sD						
		

cCsKyx�y'|j|j}|jd7_|SWntk
r@nX|jre|j}d|_|�n|jdkr�|j|_Pn|j2d|_|jj	d�}|r�y|jj
|�Wq�tk
r�}||_q�Xq|jj�|_d|_qWWn#|j
r!|jj�n�nX|j
rA|jj�nt�dS(Niii@(R�R�t
IndexErrorR�RR�RaR�R�ReRjtSyntaxErrorRkR�t
StopIteration(RtitemRQRotexc((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytnext�s@
							cCs|S(N((R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt__iter__s(R%R&RgR/R�R�(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s/	$cCs2|stdt��}n|j|�|j�S(NRY(RRRjRk(RRm((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRs
cCs}|stdt��}n|j|�|j�}i}x6|j�D](}|jd�}|rG|||<qGqGW||fS(NRYR1(RRRjRkR!RJ(RRmR�tidsRR1((s-/usr/lib64/python2.7/xml/etree/ElementTree.pytXMLID,s
cCsC|stdt��}nx|D]}|j|�q"W|j�S(NRY(RRRjRk(tsequenceRmR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRLs

cBsAeZdd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsFg|_g|_d|_d|_|dkr9t}n||_dS(N(t_datat_elemRt_lastt_tailRt_factory(Rtelement_factory((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/bs					cCs|jS(N(R�(R((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRkrscCsa|jr]|jdk	rQdj|j�}|jrB||j_qQ||j_ng|_ndS(NR(R�R�RR�R�R5R(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_flushws		cCs|jj|�dS(N(R�RA(RRo((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRo�scCs`|j�|j||�|_}|jrC|jdj|�n|jj|�d|_|S(Ni����i(R�R�R�R�RAR�(RRtattrsR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s
		cCs,|j�|jj�|_d|_|jS(Ni(R�R�tpopR�R�(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR��s
	N(	R%R&RR/RkR�RoR�R�(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR`s				tsentinelcBs�eZeddd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�ZeZd�Zd
�ZRS(cCs�|tk	r%tjdtdd�nyddlm}WnAtk
r|yddl}Wq}tk
rxtd��q}XnX|j|d�}|dkr�t
�}n||_|_||_
|_|j|_i|_|j|_|j|_|j|_|j|_|j|_|j|_yd|j_Wntk
rGnXy(d|j_ d|j_!|j"|_Wntk
r�nXd|_#i|_$yd	|j%|_&Wntk
r�nXdS(
Ns.The html argument of XMLParser() is deprecatedR8ii����(texpats7No module named expat; use SimpleXMLTreeBuilder insteadR�isExpat %d.%d.%d('t	_sentinelR9twarnpy3kRFtxml.parsersR�tImportErrortpyexpattParserCreateRRRmR�RYt_targetterrorR�t_namest_defaulttDefaultHandlerExpandR�R�R�R�R�tCharacterDataHandlert_commenttCommentHandlert_pitProcessingInstructionHandlertbuffer_textR�R�R�R�t_doctypetentitytversion_infotversion(RR�RYR{R�Rm((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR/�sR

	

		
cCs7t|�}|j|_|j|jf|_|�dS(N(R	tcodetlinenotoffsettposition(RRLterr((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_raiseerror�scCs*y|jd�SWntk
r%|SXdS(NR�(R�R�(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_fixtext�s
cCsby|j|}WnJtk
r]|}d|kr@d|}n|j|�|j|<}nX|S(NR�R�(R�tKeyErrorR(RRKtname((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt_fixname�s

cCsj|j}|j}||�}i}x0|j�D]"\}}||�|||�<q1W|jj||�S(N(RRRORYR�(RRR�tfixnametfixtextR,RKRL((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s		cCs�|j}|j}||�}i}|rrxEtdt|�d�D](}|||d�||||�<qCWn|jj||�S(Niii(RRtrangeR6RYR�(RRR�RRR,ti((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s		)cCs|jj|j|��S(N(RYRoR(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs|jj|j|��S(N(RYR�R(RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�scCs;y|jj}Wntk
r#nX||j|��SdS(N(RYtcommentR�R(RRoR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR� s

cCsGy|jj}Wntk
r#n X||j|�|j|��SdS(N(RYtpiR�R(RRYRoR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�(s

c
Cs]|d }|dkr�y"|jj|j|dd!�WqYtk
r�ddlm}|jd||jj|jj	f�}d|_
|jj|_|jj	|_|�qYXn�|dkr�|d d	kr�g|_
n}|j
dk	rY|d
krd|_
dS|j�}|sdS|j
j|�t|j
�}|dkrY|j
d}|dkr�|d
kr�|j
\}}}}	n7|dkr�|dkr�|j
\}}}	d}ndS|r�|dd!}nt|jd�r|jj|||	dd!�nI|j|jkrJ|j|||	dd!�|j|||	dd!�nd|_
qYndS(NiR�i����(R�s'undefined entity %s: line %d, column %diR�i	s	<!DOCTYPER�itPUBLICitSYSTEMitdoctype(RYRoRRR�R�R�R�tErrorLineNumbertErrorColumnNumberRRRRRtstripRAR6R)Rt_XMLParser__doctype(
RRR�R�R	tnR�R
tpubidtsystem((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�0sR
"
	
	
	 cCstjdt�dS(s'This method of XMLParser is deprecated.s[This method of XMLParser is deprecated.  Define doctype() method on the TreeBuilder target.N(R9R:RF(RR
RR((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRgscCsAy|jj|d�Wn#|jk
r<}|j|�nXdS(Ni(R�tParseR�R
(RRoR�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRjwscCs\y|jjdd�Wn#|jk
r<}|j|�nX|jj�}|`|`|S(NRi(R�RR�R
RYRk(RR�R�((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyRk�sN(R%R&R�RR/R
RRR�R�R�R�R�R�R�RRRjRk(((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyR�s1						
					7			(t_serialize_c14nRu(6t__all__RR�R�R9tobjectRRR'R�R�R	RRt_Elementt_ElementInterfaceR
RRRR
RRRyR�R�RMt	NameErrorR�RxRvR�R�R�R�R�R�R�RRRRRR�RR�RRRR�RRtElementC14NR (((s-/usr/lib64/python2.7/xml/etree/ElementTree.pyt<module>;s�

		�U
�D	/
	2	
	
						bM	�
PKA�\P��^��cElementTree.pycnu�[����
{fc@sddlTdS(i����(t*N(t_elementtree(((s./usr/lib64/python2.7/xml/etree/cElementTree.pyt<module>tPKA�\�B�u��ElementPath.pycnu�[����
{fc@s�ddlZejd�Zdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zied6ed6ed
6e
d6e	d6ed6ZiZ
ddd��YZdd�Zdd�Zdd�Zddd�ZdS(i����NsY('[^']*'|"[^"]*"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+ccs�x�tj|�D]�}|d}|r�|ddkr�d|kr�yH|jdd�\}}|slt�n|dd|||ffVWq�tk
r�td|��q�Xq|VqWdS(Niit{t:s{%s}%ss!prefix %r not found in prefix map(txpath_tokenizer_retfindalltsplittKeyErrortSyntaxError(tpatternt
namespacesttokenttagtprefixturi((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytxpath_tokenizerIs
"	!
cCs^|j}|dkrZi|_}x5|jj�D]!}x|D]}|||<q?Wq2Wn|S(N(t
parent_maptNonetroottiter(tcontextRtpte((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytget_parent_mapWs	

cs|d��fd�}|S(Nic3s=x6|D].}x%|D]}|j�kr|VqqWqWdS(N(R
(RtresulttelemR(R
(s-/usr/lib64/python2.7/xml/etree/ElementPath.pytselectbs

((tnextR	R((R
s-/usr/lib64/python2.7/xml/etree/ElementPath.pyt
prepare_child`s
cCs
d�}|S(Ncss+x$|D]}x|D]}|VqWqWdS(N((RRRR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyRjs

((RR	R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_staris	cCs
d�}|S(Ncssx|D]}|VqWdS(N((RRR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyRqs
((RR	R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_selfps	csX|�}|ddkr"d�n#|ds9|d�ntd���fd�}|S(Nit*isinvalid descendantc3sCx<|D]4}x+|j��D]}||k	r|VqqWqWdS(N(R(RRRR(R
(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR~s
(R(RR	R((R
s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_descendantvs		

cCs
d�}|S(Ncss^t|�}i}xE|D]=}||kr||}||krVd||<|VqVqqWdS(N(RR(RRRt
result_mapRtparent((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s


((RR	R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_parent�s	
csag}g}x�|�}|ddkr,Pn|drd|dd dkrdd|ddd!f}n|j|dpwd�|j|d�qWdj|�}|d	kr�|d��fd
�}|S|dkr�|d�|d���fd�}|S|dkr>tjd
|d�r>|d��fd�}|S|dkr�tjd
|d�r�|d�|d���fd�}|S|dks�|dks�|dkrQ|dkr�t|d�d�nl|ddkr�td��n|dkr8yt|d�d�Wq>tk
r4td��q>Xnd��fd�}|Std��dS(Nit]is'"t'i����t-ts@-c3s2x+|D]#}|j��dk	r|VqqWdS(N(tgetR(RRR(tkey(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s
s@-='c3s2x+|D]#}|j���kr|VqqWdS(N(R&(RRR(R'tvalue(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s
s\d+$c3s2x+|D]#}|j��dk	r|VqqWdS(N(tfindR(RRR(R
(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s
s-='c3sSxL|D]D}x;|j��D]*}dj|j���kr|VPqqWqWdS(NR%(Rtjointitertext(RRRR(R
R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s

s-()s-()-tlastsunsupported functionisunsupported expressionc3syt|�}xf|D]^}y>||}t|j|j��}|�|krV|VnWqttfk
rpqXqWdS(N(RtlistRR
t
IndexErrorR(RRRRR telems(tindex(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s

sinvalid predicate(tappendR*tretmatchtintRt
ValueError(RR	t	signaturet	predicateR((R0R'R
R(s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_predicate�sV	


#
#

$
R%Rt.s..s//t[t_SelectorContextcBseZdZd�ZRS(cCs
||_dS(N(R(tselfR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyt__init__�sN(t__name__t
__module__RRR=(((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR;�sc	Csn|ddkr|d}nyt|}Wntk
r4tt�dkrZtj�n|d dkrytd��ntt||��j}|�}g}x�y"|jt	|d||��Wnt
k
r�td��nXy)|�}|ddkr
|�}nWq�t
k
r"Pq�Xq�W|t|<nX|g}t|�}x|D]}|||�}qQW|S(	Ni����t/Ridis#cannot use absolute path on elementisinvalid path(t_cacheRtlentclearRRR
RR1topst
StopIterationR;(	RtpathRtselectorRR	RRR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytiterfind�s:


	"
	
		
cCs3yt|||�j�SWntk
r.dSXdS(N(RHRRER(RRFR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR)s
cCstt|||��S(N(R-RH(RRFR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR$scCsBy)t|||�j�}|jp'dSWntk
r=|SXdS(NR%(RHRttextRE(RRFtdefaultR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytfindtext*s

((R2tcompileRRR
RRRRRR!R8RDRAR;RHR)RRK(((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyt<module>;s.									
	P

$	PKA�\hNwW��__init__.pyonu�[����
{fc@sdS(N((((s*/usr/lib64/python2.7/xml/etree/__init__.pyt<module>tPKA�\hNwW��__init__.pycnu�[����
{fc@sdS(N((((s*/usr/lib64/python2.7/xml/etree/__init__.pyt<module>tPKA�\�B�u��ElementPath.pyonu�[����
{fc@s�ddlZejd�Zdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zied6ed6ed
6e
d6e	d6ed6ZiZ
ddd��YZdd�Zdd�Zdd�Zddd�ZdS(i����NsY('[^']*'|"[^"]*"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+ccs�x�tj|�D]�}|d}|r�|ddkr�d|kr�yH|jdd�\}}|slt�n|dd|||ffVWq�tk
r�td|��q�Xq|VqWdS(Niit{t:s{%s}%ss!prefix %r not found in prefix map(txpath_tokenizer_retfindalltsplittKeyErrortSyntaxError(tpatternt
namespacesttokenttagtprefixturi((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytxpath_tokenizerIs
"	!
cCs^|j}|dkrZi|_}x5|jj�D]!}x|D]}|||<q?Wq2Wn|S(N(t
parent_maptNonetroottiter(tcontextRtpte((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytget_parent_mapWs	

cs|d��fd�}|S(Nic3s=x6|D].}x%|D]}|j�kr|VqqWqWdS(N(R
(RtresulttelemR(R
(s-/usr/lib64/python2.7/xml/etree/ElementPath.pytselectbs

((tnextR	R((R
s-/usr/lib64/python2.7/xml/etree/ElementPath.pyt
prepare_child`s
cCs
d�}|S(Ncss+x$|D]}x|D]}|VqWqWdS(N((RRRR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyRjs

((RR	R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_staris	cCs
d�}|S(Ncssx|D]}|VqWdS(N((RRR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyRqs
((RR	R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_selfps	csX|�}|ddkr"d�n#|ds9|d�ntd���fd�}|S(Nit*isinvalid descendantc3sCx<|D]4}x+|j��D]}||k	r|VqqWqWdS(N(R(RRRR(R
(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR~s
(R(RR	R((R
s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_descendantvs		

cCs
d�}|S(Ncss^t|�}i}xE|D]=}||kr||}||krVd||<|VqVqqWdS(N(RR(RRRt
result_mapRtparent((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s


((RR	R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_parent�s	
csag}g}x�|�}|ddkr,Pn|drd|dd dkrdd|ddd!f}n|j|dpwd�|j|d�qWdj|�}|d	kr�|d��fd
�}|S|dkr�|d�|d���fd�}|S|dkr>tjd
|d�r>|d��fd�}|S|dkr�tjd
|d�r�|d�|d���fd�}|S|dks�|dks�|dkrQ|dkr�t|d�d�nl|ddkr�td��n|dkr8yt|d�d�Wq>tk
r4td��q>Xnd��fd�}|Std��dS(Nit]is'"t'i����t-ts@-c3s2x+|D]#}|j��dk	r|VqqWdS(N(tgetR(RRR(tkey(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s
s@-='c3s2x+|D]#}|j���kr|VqqWdS(N(R&(RRR(R'tvalue(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s
s\d+$c3s2x+|D]#}|j��dk	r|VqqWdS(N(tfindR(RRR(R
(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s
s-='c3sSxL|D]D}x;|j��D]*}dj|j���kr|VPqqWqWdS(NR%(Rtjointitertext(RRRR(R
R((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s

s-()s-()-tlastsunsupported functionisunsupported expressionc3syt|�}xf|D]^}y>||}t|j|j��}|�|krV|VnWqttfk
rpqXqWdS(N(RtlistRR
t
IndexErrorR(RRRRR telems(tindex(s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR�s

sinvalid predicate(tappendR*tretmatchtintRt
ValueError(RR	t	signaturet	predicateR((R0R'R
R(s-/usr/lib64/python2.7/xml/etree/ElementPath.pytprepare_predicate�sV	


#
#

$
R%Rt.s..s//t[t_SelectorContextcBseZdZd�ZRS(cCs
||_dS(N(R(tselfR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyt__init__�sN(t__name__t
__module__RRR=(((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR;�sc	Csn|ddkr|d}nyt|}Wntk
r4tt�dkrZtj�n|d dkrytd��ntt||��j}|�}g}x�y"|jt	|d||��Wnt
k
r�td��nXy)|�}|ddkr
|�}nWq�t
k
r"Pq�Xq�W|t|<nX|g}t|�}x|D]}|||�}qQW|S(	Ni����t/Ridis#cannot use absolute path on elementisinvalid path(t_cacheRtlentclearRRR
RR1topst
StopIterationR;(	RtpathRtselectorRR	RRR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytiterfind�s:


	"
	
		
cCs3yt|||�j�SWntk
r.dSXdS(N(RHRRER(RRFR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR)s
cCstt|||��S(N(R-RH(RRFR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyR$scCsBy)t|||�j�}|jp'dSWntk
r=|SXdS(NR%(RHRttextRE(RRFtdefaultR((s-/usr/lib64/python2.7/xml/etree/ElementPath.pytfindtext*s

((R2tcompileRRR
RRRRRR!R8RDRAR;RHR)RRK(((s-/usr/lib64/python2.7/xml/etree/ElementPath.pyt<module>;s.									
	P

$	PKE�\E��g%%ElementPath.pynu�[���PKE�\�b�2��'A%__pycache__/cElementTree.cpython-38.pycnu�[���PKE�\��J--/G&__pycache__/ElementInclude.cpython-38.opt-1.pycnu�[���PKE�\�b�2��-�,__pycache__/cElementTree.cpython-38.opt-1.pycnu�[���PKE�\�%�'��)�-__pycache__/__init__.cpython-38.opt-2.pycnu�[���PKE�\��J--/�.__pycache__/ElementInclude.cpython-38.opt-2.pycnu�[���PKE�\�r�� � &I5__pycache__/ElementPath.cpython-38.pycnu�[���PKE�\��J--)�V__pycache__/ElementInclude.cpython-38.pycnu�[���PKE�\�r�� � ,]__pycache__/ElementPath.cpython-38.opt-2.pycnu�[���PKE�\�%�'��#i~__pycache__/__init__.cpython-38.pycnu�[���PKE�\�b�2��-A__pycache__/cElementTree.cpython-38.opt-2.pycnu�[���PKE�\�r�� � ,M�__pycache__/ElementPath.cpython-38.opt-1.pycnu�[���PKE�\�%�'��)��__pycache__/__init__.cpython-38.opt-1.pycnu�[���PKE�\n=mE��,{�__pycache__/ElementTree.cpython-38.opt-1.pycnu�[���PKE�\��H�H�&�z__pycache__/ElementTree.cpython-38.pycnu�[���PKF�\4��1�1�,�T__pycache__/ElementTree.cpython-38.opt-2.pycnu�[���PKF�\�>)>>�cElementTree.pynu�[���PKF�\W�Z�DD��__init__.pynu�[���PKF�\�"/������ElementTree.pynu�[���PKF�\�����ElementInclude.pynu�[���PKA�\���G|�|�'�ElementTree.pycnu�[���PKA�\�Y檯��hElementInclude.pyonu�[���PKA�\�Y檯��pElementInclude.pycnu�[���PKA�\P��^���xcElementTree.pyonu�[���PKA�\[��	���yElementTree.pyonu�[���PKA�\P��^���cElementTree.pycnu�[���PKA�\�B�u���ElementPath.pycnu�[���PKA�\hNwW��� __init__.pyonu�[���PKA�\hNwW���!__init__.pycnu�[���PKA�\�B�u��_"ElementPath.pyonu�[���PK�
`@