403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.141.193.189
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib64/python3.7/site-packages/guppy/gsl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib64/python3.7/site-packages/guppy/gsl/__pycache__/DottedTree.cpython-37.pyc
B

�]W"�@s>dZGdd�de�ZGdd�d�Zdd�Zdd�Zd	d
�ZdS)a�
Handling of tree structures given in a special 'dotted' syntax.
This represents trees of nodes with strings as tags,
in a readable and writable and easy to parse syntax.

There are two main functions, unparse_sexpr and parse_string.
When parsing, the result is by default given in 'sexpr' format:
each node is a tuple of the form

    (tag, ) or (tag, node) or (tag, node, node) ...

The following invariant is intended to hold for every node x,

    parse_string(unparse_sexpr(x)) == x

Currently the following invariant has been tested for some strings:

    unparse_sexpr(parse_string(s)).strip() == s.strip()

[It only holds on stripped results but may be fixed sometime.]

c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Node)�tag�children�indexcCs||_||_||_dS)N)rrr)�selfrrr�r�G/opt/alt/python37/lib64/python3.7/site-packages/guppy/gsl/DottedTree.py�__init__sz
Node.__init__cCs|jftdd�|jD��S)NcSsg|]}|���qSr)�as_sexpr)�.0�crrr�
<listcomp>"sz!Node.as_sexpr.<locals>.<listcomp>)r�tupler)rrrrr	!sz
Node.as_sexprcCsd|jj|j|j|jfS)Nz%s(%r, %r, %r))�	__class__�__name__rrr)rrrr�__repr__$s
z
Node.__repr__N)r�
__module__�__qualname__�	__slots__rr	rrrrrrsrc@speZdZdZdZdZdZdd�Zdd�ZeZ	dd
d�Z
ddd
�Zddd�Zddd�Z
dd�Zdd�Zdd�Zd	S)�_GLUECLAMP_)z_parent.FileIO:IO)�node�dotchar�.�\cCs|ft|�S)N)r
)rrr�	lineindexrrr�
node_sexprGsz_GLUECLAMP_.node_sexprcCst|t|�|�S)N)rr
)rrrrrrr�	node_nodeRsz_GLUECLAMP_.node_nodeNcCs|�|j�|�|�S)N)�parse_string�IO�	read_file)r�file�srcrrr�
parse_fileWsz_GLUECLAMP_.parse_filecCs�|j}|j}g}|}	xHyt|�\}}
Wntk
r@d}
PYnX|
�|�sX|�|
�qPqWxHt|�D]<\}}|�||�s�|�|||�rh|t|�d�||<qhW|dgkr�d}n
d�|�}x�|
dks�t|
�|ks�|
||ks�|
�||d��s||
|�	|||	�fSt|
�|dk�rP|
|d|k�rP|dk�rDt
d��n|�d|�|�|d|
|dd�g|||�\}}
}
|�|
�q�WdS)N��
�zLevel must increase with 1 max)
r�	quotechar�next�
StopIteration�
startswith�append�	enumerate�len�joinr�SyntaxError�error�
parse_iter)r�posrr�itr rr%r�	firstline�nextvar�i�t�childrrrr/es@


$

z_GLUECLAMP_.parse_itercCs0t|�}|�dgd||�\}}}|dks,t�|S)N�)r*r/�AssertionError)r�linesr r1rr3rrrr�parse_lines�sz_GLUECLAMP_.parse_linescCs |r|�d�}ng}|�||�S)Nr#)�splitr:)r�stringr r9rrrr�sz_GLUECLAMP_.parse_stringcCs|�|���S)N)�
unparse_sexprr	)rrrrr�unparse_node�sz_GLUECLAMP_.unparse_nodecs(g����fdd���d|�d���S)Ncs>����||d��x"|dd�D]}�|d|�q$WdS)Nr7r$)r)�unparse_tag)�depth�sexpr�x)�lir�unparserrrD�sz*_GLUECLAMP_.unparse_sexpr.<locals>.unparser7r#)r,)rrAr)rCrrDrr=�s
z_GLUECLAMP_.unparse_sexprcCsl|j|j}}|�d�}x8t|�D],\}}|�|�sB|�||�r"||||<q"Wd�|�}|||}|S)Nr#)rr%r;r*r(r,)rr@rrr%r4r5rrrr?�s


z_GLUECLAMP_.unparse_tag)N)N)N)N)rrrZ	_imports_Z	_chgable_rr%rrrr!r/r:rr>r=r?rrrrr,s


&


rcsBddlm}|�jjj��j�_�j}�j}x�ddgddgddgd	d
gddgd
dgddgddgddgddgddgddgddgddgdd gd!d"gd#d$ggD]<\}}||�}|dk	r�||ks�t�||��	�|�	�ks�t�q�W�j
�jdddg�ddl�����fd%d&��x8t
d'�D],}�d(�}||�}||�}||k�st��qWdS))Nr7)�Rootr")r"�a)rFz.a)r")rFza
.b)rF)�bza
b
.c)za
b)rz
.a
..a)r#)rF)rFzhello
.a
.b
..ba
x
..bb)Zhello)rF)rG)zba
x)Zbbz\.)rz.\.)r")rr)rz.
\)r")z
\z\\.)z\.z. tag)r")z tag� )rHr#)r#z
a)z
az�
initial
text
.aspect for guppy.hsp
..returns
...type A
...latex
~\
\..~|begincolorbox|~raw::~LaTeX~\
~\
~~~{	extbackslash}{	extbackslash}begin{\{}center{\}}~\
.aspect for guppy.gsl
..contains DottedTree
)z
initial
text)zaspect for guppy.hsp)Zreturns)ztype A)zclatex
~\
..~|begincolorbox|~raw::~LaTeX~\
~\
~~~{	extbackslash}{	extbackslash}begin{\{}center{\}}~\)zaspect for guppy.gsl)zcontains DottedTree
csF��d��}����d���}��fdd�t|�D�}��||d�S)Nr7r"csg|]}��d��qS)r$r)r
r4)�maxchild�randnoderrr
sz,test_1.<locals>.randnode.<locals>.<listcomp>)�randint�shuffler,�ranger)rIZnumchildrr)�chars�dtrJ�random)rIrrJs


ztest_1.<locals>.randnode�
�)�guppyrE�gsl�
DottedTreerrrr=r8�stripr%rrPrM)rE�parserDrB�y�zr4r)rNrOrJrPr�test_1�sJ	rZcCsnddlm}|�jjj}|j}|j}|d�}tdtdtddd�fd	�td
dd�fd�}t|�t|�ksjt�dS)Nr7)rEz'line 0
.line 1
..line 2
line 3
.line 4
zline 0zline 1z
line 2
line 3r�r$zline 4
�)	rSrErTrUrr>r�reprr8)rErOrWrDr�exprrr�test_2sr_cCst�t�dS)N)rZr_rrrr�	test_main/sr`N)�__doc__�objectrrrZr_r`rrrr�<module>s
\

Youez - 2016 - github.com/yon3zu
LinuXploit