403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.216.11
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.9/site-packages/elementpath/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/elementpath/__pycache__/xpath_nodes.cpython-39.opt-1.pyc
a

���c	C�
@s�dZddlmZddlmZddlmZmZmZm	Z	m
Z
mZddlm
Z
ddlmZmZddlmZdd	lmZmZmZeZeZGd
d�d�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Zeed�dd�Z eed�dd�Z!dMeeeefeeeeeeeefd�dd�Z"eeeefee#d �d!d"�Z$eeed#�d$d%�Z%dNee#ee
ee#fd'�d(d)�Z&dOee	e#ed+�d,d-�Z'dPee	e#ed.�d/d0�Z(eed�d1d2�Z)eed�d3d4�Z*eed�d5d6�Z+eed�d7d8�Z,eed�d9d:�Z-eed�d;d<�Z.eed�d=d>�Z/ee	ee#efd�d?d@�Z0eed�dAdB�Z1eed�dCdD�Z2ee	eed�dEdF�Z3ee	ed�dGdH�Z4ee	e#d�dIdJ�Z5eed�dKdL�Z6d*S)Qz8
Helper functions for XPath nodes and basic data types.
�)�Counter)�urlparse)�Any�Dict�Iterator�Optional�Tuple�Union)�Element�)�XML_BASE�XSI_NIL)�ElementPathValueError)�ElementProtocol�DocumentProtocol�XsdAttributeProtocolc@s8eZdZUdZeed<dZeed<eed�dd��Z	dS)�	XPathNodeN�name�value��returncCst�dS�N)�NotImplementedError��self�r�;/usr/lib/python3.9/site-packages/elementpath/xpath_nodes.py�kind*szXPathNode.kind)
�__name__�
__module__�__qualname__rr�__annotations__r�property�strrrrrrr%s
rc@s�eZdZUdZeed<deeeefee	dd�dd�Z
eed�dd	��Ze
eeeeffd�d
d�Zed�dd
�Zeed�dd�Zed�dd�ZdS)�
AttributeNodez�
    A class for processing XPath attribute nodes.

    :param name: the attribute name.
    :param value: a string value or an XSD attribute when XPath is applied on a schema.
    :param parent: the parent element.
    rN)rr�parentrcCs||_||_||_dSr)rrr%)rrrr%rrr�__init__9szAttributeNode.__init__rcCsdS�N�	attributerrrrrr?szAttributeNode.kindcCs|j|jfSr)rrrrrr�as_itemCszAttributeNode.as_itemcCs:|jdur$d|jj|j|j|jfSd|jj|j|jfS)Nz %s(name=%r, value=%r, parent=%r)z%s(name=%r, value=%r))r%�	__class__rrrrrrr�__repr__Fs

�zAttributeNode.__repr__��otherrcCs0t||j�o.|j|jko.|j|jko.|j|juSr)�
isinstancer*rrr%�rr-rrr�__eq__Ms
�
�
�zAttributeNode.__eq__cCst|j|j|jf�Sr)�hashrrr%rrrr�__hash__SszAttributeNode.__hash__)N)rrr �__doc__r#r!r	rr�ElementNoder&r"rrr)r+r�boolr0�intr2rrrrr$/s
��r$c@s�eZdZUdZded<dZdeeee	dd�dd�Z
eed�d	d
��Ze	d�dd�Z
ed�d
d�Zee	d�dd�Zed�dd�ZdS)�TextNodea&
    A class for processing XPath text nodes. An Element's property
    (elem.text or elem.tail) with a `None` value is not a text node.

    :param value: a string value.
    :param parent: the parent element.
    :param tail: provide `True` if the text node is the parent Element's tail.
    N�textF)rr%�tailrcCs"||_||_|r|durd|_dS�NT)rr%�_tail)rrr%r9rrrr&cszTextNode.__init__rcCsdS)Nr8rrrrrrjsz
TextNode.kindcCs|jS)zEReturns `True` if the node has a parent and represents the tail text.)r;rrrr�is_tailnszTextNode.is_tailcCs6|jdur$d|jj|j|j|jfSd|jj|jfS)Nz%s(%r, parent=%r, tail=%r)z%s(%r))r%r*rrr;rrrrr+rs

�zTextNode.__repr__r,cCs0t||j�o.|j|jko.|j|juo.|j|juSr)r.r*rr%r;r/rrrr0ys
�
�
�zTextNode.__eq__cCst|j|j|jf�Sr)r1rr%r;rrrrr2szTextNode.__hash__)NF)rrr r3r!r;r#rr4r5r&r"rr<r+rr0r6r2rrrrr7Ws
�
�r7c@s�eZdZdZdeeeedd�dd�Zeed�dd��Z	eed�d	d
��Z
eed�dd��Zeeefd�d
d�Z
ed�dd�Zeed�dd�Zed�dd�ZdS)�
NamespaceNodez�
    A class for processing XPath namespace nodes.

    :param prefix: the namespace prefix.
    :param uri: the namespace URI.
    :param parent: the parent element.
    N)�prefix�urir%rcCs||_||_||_dSr)r>r?r%)rr>r?r%rrrr&�szNamespaceNode.__init__rcCsdS)N�	namespacerrrrrr�szNamespaceNode.kindcCs|jSr)r>rrrrr�szNamespaceNode.namecCs|jSr)r?rrrrr�szNamespaceNode.valuecCs|j|jfSr)r>r?rrrrr)�szNamespaceNode.as_itemcCs:|jdur$d|jj|j|j|jfSd|jj|j|jfS)Nz %s(prefix=%r, uri=%r, parent=%r)z%s(prefix=%r, uri=%r))r%r*rr>r?rrrrr+�s

�zNamespaceNode.__repr__r,cCs0t||j�o.|j|jko.|j|jko.|j|juSr)r.r*r>r?r%r/rrrr0�s
�
�
�zNamespaceNode.__eq__cCst|j|j|jf�Sr)r1r>r?r%rrrrr2�szNamespaceNode.__hash__)N)rrr r3r#rr4r&r"rrrrr)r+rr5r0r6r2rrrrr=�sr=c@steZdZdZeeedd�dd�Zeed�dd��Z	eed�d	d
��Z
ed�dd�Zeed
�dd�Z
ed�dd�ZdS)�TypedElementa,
    A class for processing typed element nodes.

    :param elem: the linked element. Can be an Element, or an XSD element     when XPath is applied on a schema.
    :param xsd_type: the reference XSD type.
    :param value: the decoded value. Can be `None` for empty or element-only elements."
    N)�elem�xsd_typerrcCs||_||_||_dSr)rBrCr)rrBrCrrrrr&�szTypedElement.__init__rcCsdS)N�elementrrrrrr�szTypedElement.kindcCs|jjSr)rB�tagrrrrr�szTypedElement.namecCsd|jj|jjfS)Nz
%s(tag=%r))r*rrBrErrrrr+�szTypedElement.__repr__r,cCs$t||j�o"|j|juo"|j|jkSr)r.r*rBrr/rrrr0�s

�
�zTypedElement.__eq__cCst|j|jf�Sr)r1rBrrrrrr2�szTypedElement.__hash__)rrr r3r
rr&r"r#rrr+r5r0r6r2rrrrrA�srAc@s�eZdZdZeeedd�dd�Zeed�dd��Z	eed�d	d
��Z
eeefd�dd�Zed�d
d�Z
eed�dd�Zed�dd�ZdS)�TypedAttributez�
    A class for processing typed attribute nodes.

    :param attribute: the origin AttributeNode instance.
    :param xsd_type: the reference XSD type.
    :param value: the types value.
    N)r(rCrrcCs||_||_||_dSr)r(rCr)rr(rCrrrrr&�szTypedAttribute.__init__rcCsdSr'rrrrrr�szTypedAttribute.kindcCs|jjSr)r(rrrrrr�szTypedAttribute.namecCs|jj|jfSr)r(rrrrrrr)�szTypedAttribute.as_itemcCsd|jj|jjfS)Nz%s(name=%r))r*rr(rrrrrr+�szTypedAttribute.__repr__r,cCs$t||j�o"|j|jko"|j|jkSr)r.r*r(rr/rrrr0�s

�
�zTypedAttribute.__eq__cCst|j|jf�Sr)r1r(rrrrrr2�szTypedAttribute.__hash__)rrr r3r$rr&r"r#rrrr)r+r5r0r6r2rrrrrF�srF)�objrcCst|d�ot|d�ot|d�S�NrE�attribr8��hasattr�rGrrr�is_etree_element�srMcCst|�ot|d�ot|d�S)NZ	getparentZnsmap)rMrKrLrrr�is_lxml_etree_element�srNTF)�root�	with_root�with_attributesrccs�t|t�r|j}nt|�r$|r$|V|��D]�}t|j�r<q,|sH||urN|V|jdurft|j|�V|j	r�|r�|j	�
�D]\}}t|||�Vqz|jdur,||ur,t|j|d�Vq,dSr:)
r.rArB�is_document_node�iter�callablerEr8r7rI�itemsr$r9)rOrPrQ�errrrr�etree_iter_nodess 



rW)rBrccs�t|t�r�|j��r�|j}|��D]`}t|j�r2q"|jdurV||urN|j�	�n|jV|j
dur"||ur"||vrz|j
�	�n|j
Vq"dS|j}|��D]<}t|j�r�q�|jdur�|jV|j
dur�||ur�|j
Vq�dSr)r.rArCZis_element_onlyrBrSrTrEr8�stripr9)rBrVrrr�etree_iter_stringss&





rY)�e1�e2rcCs�|j|jkrdS|jpd��|jp$d��kr0dS|jp8d��|jpDd��krPdS|j|jkr`dSt|�t|�krtdStdd�t||�D��S)NF�css|]\}}t||�VqdSr)�etree_deep_equal)�.0Zc1Zc2rrr�	<genexpr><�z#etree_deep_equal.<locals>.<genexpr>)rEr8rXr9rI�len�all�zip)rZr[rrrr]1sr]�.)rB�pathrc#s�||fVtdd�|D���t�fdd��D��}|D]�}t|j�rHq6n0|dkr\d|j}n|rrd�||jf�}n|j}|j|vr�|d||j7}||jd7<t||�EdHq6dS)NcSsg|]
}|j�qSr)rE)r^rVrrr�
<listcomp>Ar`z$etree_iter_paths.<locals>.<listcomp>csg|]}�|dkr|�qS)rr)r^�t�Z
children_tagsrrrfBr`�/z/%sz[%d]r)rrTrE�join�etree_iter_paths)rBreZ	positions�childZ
child_pathrrhrrk?s


rkN)rGrErc	CsNt|t�r|j}nt|�r$t|j�r(dS|s0dS|js@|j|kS|dksP|dkrZ|jdkS|ddkr�z|�d�\}}Wn"ttfy�t	d|��Yn.0|jdd	kr�|j�d
�d|kS|j|kSn�|ddk�r@|dd	ks�d
|v�r�t	d|��nB|jdd	k�r:|j�d
�ddd
�|�d
�ddd
�kSdSn
|j|kSd
S)a~
    Returns `True` if the first argument is an element node matching the tag, `False` otherwise.
    Raises a ValueError if the argument tag has to be used but it's in a wrong format.

    :param obj: the node to be tested.
    :param tag: a fully qualified name, a local name or a wildcard. The accepted
    wildcard formats are '*', '*:*', '*:local-name' and '{namespace}*'.
    FT�*�*:*r\r�:z'unexpected format %r for argument 'tag'�{�}r���N)
r.rArBrMrTrE�split�
ValueError�
IndexErrorr)rGrE�_rrrr�match_element_node`s2	


.rw)rGrrc	CsB|dus|dks|dkr&t|ttf�St|ttf�s8dSt|t�rH|j}|sT|jS|ddkr�z|�d�\}}Wn"ttfy�td|��Yn,0|j�	d�r�|j�d	�d
|kS|j|kSn||ddk�r4|ddks�d	|vr�td|��n@|j�	d��r.|j�d	�dd
d�|�d	�dd
d�kSdSn
|j|kSdS)a�
    Returns `True` if the first argument is an attribute node matching the name, `False` otherwise.
    Raises a ValueError if the argument name has to be used but it's in a wrong format.

    :param obj: the node to be tested.
    :param name: a fully qualified name, a local name or a wildcard. The accepted wildcard formats     are '*', '*:*', '*:local-name' and '{namespace}*'.
    NrmrnFrroz(unexpected format %r for argument 'name'rprqrrr)
r.r$rFr(rrsrtrur�
startswith)rGrrv�_namerrr�match_attribute_node�s.	
.rzcCs4t|t�p2t|d�o2t|j�o2t|d�o2t|d�SrH)r.rArKrTrErLrrr�is_element_node�s
��r{cCst|d�ot|d�ot|d�S)N�
local_name�typerrJrLrrr�is_schema_node�sr~cCs t|d�ot|j�o|jjdkS)NrE�Comment�rKrTrErrLrrr�is_comment_node�sr�cCs t|d�ot|j�o|jjdkS)NrEZProcessingInstructionr�rLrrr�is_processing_instruction_node�sr�cCst|d�ot|d�ot|d�S)N�getroot�parserSrJrLrrrrR�srRcCst|�ot|d�ot|d�S)NZxpathZxslt)rRrKrLrrr�is_lxml_document_node�sr�cCsdt|t�pbt|d�r(t|d�r(t|d�pbt|d�rFt|d�rFt|d�pbt|d�obt|d�obt|d	�S)
NrErIr8r|r}rr�r�rS)r.rrKrLrrr�
is_xpath_node�s
���r�cCst|�r|jSdSr)r{rIrLrrr�node_attributes�sr�cCsLz2t|�r|jtWSt|�r.|��jtWSWdStyFYdS0dSr)r{rIrrRr��KeyErrorrLrrr�
node_base_uri�sr�c	CsZt|�rVz|��jt}t|�}Wnttfy8Yn0|jrF|jsR|j	�
d�rV|SdS)Nri)rRr�rIrrr�rt�scheme�netlocrerx)rGr?�partsrrr�node_document_uri�sr�cCs:t|�rdd�|D�St|�r2dd�|��fD�SdSdS)Ncss|]
}|VqdSrr�r^rlrrrr_�r`z node_children.<locals>.<genexpr>css|]
}|VqdSrrr�rrrr_�r`)r{rRr�rLrrr�
node_children�s
r�cCst|�r|�t�dvSdS)N)�true�1)r{�getr
rLrrr�node_nilled�sr�cCsHt|t�r|jSt|�rdSt|�r(dSt|�r4dSt|�r@dSdSdS)NrDz
document-nodeZcommentzprocessing-instruction)r.rrr{rRr�r�rLrrr�	node_kinds
r�cCsFt|t�r|jSt|d�r>t|j�s>t|d�r>t|d�r>|jSdSdSrH)r.rrrKrTrErLrrr�	node_names
��r�)TF)rd)N)N)7r3�collectionsr�urllib.parser�typingrrrrrr	Zxml.etree.ElementTreer
Z
namespacesrr
�
exceptionsrZ	protocolsrrrr4ZDocumentNoderr$r7r=rArFr5rMrNrWr#rYr]rkrwrzr{r~r�r�rRr�r�r�r�r�r�r�r�r�rrrr�<module>
sR 	
(,-"&�� !*(

	

Youez - 2016 - github.com/yon3zu
LinuXploit