Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_symtable.cpython-310.pyc
o

�9js%�@sJdZddlZddlZdZdd�ZGdd�dej�Zedkr#e��dSdS)	z&
Test the API of the symtable module.
�Na:
import sys

glob = 42
some_var = 12
some_non_assigned_global_var = 11
some_assigned_global_var = 11

class Mine:
    instance_var = 24
    def a_method(p1, p2):
        pass

def spam(a, b, *var, **kw):
    global bar
    global some_assigned_global_var
    some_assigned_global_var = 12
    bar = 47
    some_var = 10
    x = 23
    glob
    def internal():
        return x
    def other_internal():
        nonlocal some_var
        some_var = 3
        return some_var
    return internal

def foo():
    pass

def namespace_test(): pass
def namespace_test(): pass
cCs&|��D]}|��|kr|SqdS�N)�get_children�get_name)�block�name�ch�r�)/usr/lib/python3.10/test/test_symtable.py�
find_block.s
��r
c@s&eZdZe�edd�Zeed�Zeed�Zeed�Z	ee	d�Z
ee	d�Zeed�Zd	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#d7d8�Z$d9d:�Z%d;d<�Z&d=S)>�SymtableTest�?�exec�Mine�a_method�spam�internal�other_internal�foocCs^|�|j��d�|�|j��d�|�|j��d�|�|j��d�|�|j��d�dS)N�module�class�function)�assertEqual�top�get_typerrrr��selfrrr	�	test_type?�
zSymtableTest.test_typecCs^|�|j��d�|�|j��d�|�|j��d�|�|j��d�|�|j��d�dS)Nr)�
assertGreaterr�get_idrrrrrrrr	�test_idFrzSymtableTest.test_idcCs$|�|j���|�|j���dSr)�assertFalser�is_optimized�
assertTruerrrrr	�test_optimizedMszSymtableTest.test_optimizedcCsD|�|j���|�|j���|�|j���|�|j���dSr)r!r�	is_nestedrrr#rrrrr	�test_nestedRszSymtableTest.test_nestedcCs4|�|j���|�|j���|�|j���dSr)r#r�has_childrenrr!rrrrr	�
test_childrenXszSymtableTest.test_childrencCs(|�|j��d�|�|j��d�dS)Nr�)rr�
get_linenorrrrr	�test_lineno]�zSymtableTest.test_linenocCsh|j}|�t|���gd��gd�}|�t|���|�|�t|���gd��|�|j��d�dS)N)�a�b�kw�var)r-r.rr/r�some_varr0�x)�bar�glob�some_assigned_global_var)r2)rr�sorted�get_parameters�
get_locals�get_globalsr�	get_frees)r�func�expectedrrr	�test_function_infoaszSymtableTest.test_function_infocCs�|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����dS)Nr4r3r2�instance_var�some_non_assigned_global_varr5)	r#r�lookup�	is_globalr!�is_declared_globalrrrrrrr	�test_globalsiszSymtableTest.test_globalscCsF|�|j�d����|�|j�d����d}|�|j��|�dS)Nr1)r1)r!rr@�is_nonlocalr#rr�
get_nonlocals)rr<rrr	�
test_nonlocaluszSymtableTest.test_nonlocalcCs\|�|j�d����|�|j�d����|�|j�d����|�|j�d����dS)Nr2r3r?r5)r#rr@�is_localr!rrrrr	�
test_local{szSymtableTest.test_localcC�|�|j�d����dS)Nr2)r#rr@�is_freerrrr	�	test_free��zSymtableTest.test_freecCsF|�|j�d����|�|j�d����|�|j�d����dS)Nr2r)r#rr@�
is_referencedrr!rrrr	�test_referenced�szSymtableTest.test_referencedcCs:dD]
}|�|j�|����q|�|j�d����dS)N)r-r0r/r2)r#rr@�is_parameterr!)r�symrrr	�test_parameters�szSymtableTest.test_parameterscCs6|�t|j���t|j����|�t|jjd�dS)N�not_here)r�lenr�get_identifiers�get_symbols�assertRaises�KeyErrorr@rrrr	�test_symbol_lookup�s�zSymtableTest.test_symbol_lookupcCs�|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d���|ju�|j�d�}|�t	|�
��d�|�t|j�dS)Nrrrr�namespace_testr2�)
r#rr@�is_namespacerrr!�
get_namespacerrS�get_namespacesrV�
ValueError)r�ns_testrrr	�test_namespaces�szSymtableTest.test_namespacescCsr|�|j�d����|�|j�d����|�|j�d����|�|j�d����|�|j�d����dS)Nr2r3rr)r#rr@�is_assignedrrr!rrrrr	�
test_assigned�s
zSymtableTest.test_assignedcCs�t�ddd�}|��d}|�|�d����|�|�d����|�|�d����t�ddd�}|��d}|�|�d����|�|�d����t�ddd�}|�|�d����t�ddd�}dS)	Nzdef f():
    x: int
�testr
rr2zdef f():
    x = 1
zglobal x
x: intz=def g():
    x = 2
    def f():
        nonlocal x
    x: int)�symtablerr#r@rG�is_annotatedr!rA)r�st1�st2�st3�st4�st5�st6rrr	�test_annotated�s�zSymtableTest.test_annotatedcCrI)N�sys)r#rr@�is_importedrrrr	�
test_imported�rLzSymtableTest.test_importedcCsR|�|j��d�|�|j��d�|�|j�d���d�|�|j��d�dS)Nrrr2r)rrrrr@rrrrr	�	test_name�szSymtableTest.test_namecCs|�|j��d�dS)N)r)rr�get_methodsrrrr	�test_class_info�szSymtableTest.test_class_infoc	s�fdd�}|dd�|dd�t�ddd	���t��&��t��t�dtd�d	�Wd�n1s6wYWd�n1sEwY��t��t�dtd�d	�Wd�n1scwY��t��t�dtd�d	�Wd�dS1s�wYdS)
Nc
sxz	t�|dd�Wn(ty1}z��|jd���|jd���|j|�WYd}~dSd}~ww��d|f�dS)Nrr
�zno SyntaxError for %r)rd�SyntaxErrorr�filename�lineno�offset�fail)�
brokencoderw�errr	�
checkfilename�s��z9SymtableTest.test_filename_correct.<locals>.checkfilenamezdef f(x): foo)(r)zdef f(x): global x��passsspamr
)rd�assertWarns�DeprecationWarningrV�	TypeError�	bytearray�
memoryview�list)rr{rrr	�test_filename_correct�s"
	
����"�z"SymtableTest.test_filename_correctcC�t�ddd�}dS)N�42r�eval�rd�r�symbolsrrr	�	test_eval��zSymtableTest.test_evalcCr�)Nr�r�singler�r�rrr	�test_single�r�zSymtableTest.test_singlecCr�)Nzdef f(x): return xrr
r�r�rrr	�	test_exec�r�zSymtableTest.test_execcCsJt�t�d�dd�}|�t|d��d}t�|dd�}|�t|d��dS)N�utf8rr
rs+# -*- coding: iso8859-15 -*-
class �: pass
uŽ)rd�	TEST_CODE�encode�assertIsNotNoner
)rr�coderrr	�
test_bytes�s
zSymtableTest.test_bytescCs(|�t|j�d�|�t|j�d�dS)Nz<SymbolTable for module ?>z$<Function SymbolTable for spam in ?>)r�strrrrrrr	�test_symtable_repr�r,zSymtableTest.test_symtable_reprN)'�__name__�
__module__�__qualname__rdr�rr
rrrrrrrr r$r&r(r+r=rCrFrHrKrNrQrXr`rbrlrorprrr�r�r�r�r�r�rrrr	r4sD






	r�__main__)	�__doc__rd�unittestr�r
�TestCaserr��mainrrrr	�<module>s%I�

Youez - 2016 - github.com/yon3zu
LinuXploit