python (3.11.7)

(root)/
lib/
python3.11/
__pycache__/
pyclbr.cpython-311.opt-1.pyc

e,dZddlZddlZddlZgdZiZGddZGddeZGdd	eZ	ddZ
ddZdd
ZddZ
ddZGddejZdZdZedkredSdS)aParse a Python module and describe its classes and functions.

Parse enough of a Python file to recognize imports and class and
function definitions, and to find out the superclasses of a class.

The interface consists of a single function:
    readmodule_ex(module, path=None)
where module is the name of a Python module, and path is an optional
list of directories where the module is to be searched.  If present,
path is prepended to the system search path sys.path.  The return value
is a dictionary.  The keys of the dictionary are the names of the
classes and functions defined in the module (including classes that are
defined via the from XXX import YYY construct).  The values are
instances of classes Class and Function.  One special key/value pair is
present for packages: the key '__path__' has a list as its value which
contains the package search path.

Classes and Functions have a common superclass: _Object.  Every instance
has the following attributes:
    module  -- name of the module;
    name    -- name of the object;
    file    -- file in which the object is defined;
    lineno  -- line in the file where the object's definition starts;
    end_lineno -- line in the file where the object's definition ends;
    parent  -- parent of this object, if any;
    children -- nested objects contained in this object.
The 'children' attribute is a dictionary mapping names to objects.

Instances of Function describe functions with the attributes from _Object,
plus the following:
    is_async -- if a function is defined with an 'async' prefix

Instances of Class describe classes with the attributes from _Object,
plus the following:
    super   -- list of super classes (Class instances if possible);
    methods -- mapping of method names to beginning line numbers.
If the name of a super class is not recognized, the corresponding
entry in the list of super classes is not a class instance but a
string giving the name of the super class.  Since import statements
are recognized and imported modules are scanned as well, this
shouldn't happen often.
N)
readmodule
readmodule_exClassFunctionceZdZdZdZdS)_Objectz+Information about Python class or function.c||_||_||_||_||_||_i|_|||j|<dSdSN)modulenamefilelineno
end_linenoparentchildren)selfrrr
rrrs       :/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/pyclbr.py__init__z_Object.__init__7sS		$
$(FOD!!!N)__name__
__module____qualname____doc__rrrrr5s)11	)	)	)	)	)rrc,eZdZdZ	dddfdZxZS)rz7Information about a Python function, including methods.NFrct||||||||_t|tr||j|<dSdSr
)superris_async
isinstancermethods)	rrrr
rrrr	__class__s	        rrzFunction.__init__FsZ
tVZHHH 
fe$$	*#)FN4   	*	*r)NFrrrrr
__classcell__r"s@rrrDsS==',*<@***********rrc,eZdZdZ	dddfdZxZS)rz!Information about a Python class.Nrctt|||||||pg|_i|_dSr
)rrr!)	rrrsuper_r
rrrr"s	        rrzClass.__init__Ps;
tVZHHH\r
rr
r#r%s@rrrNsS'',0rrFc	Bt|j||j||||S)z*Return a Function after nesting within ob.)rrr)rrr
)ob	func_namerrrs     r_nest_functionr,Ys0BIy"'6ZIIIIrc	Bt|j|||j|||S)z'Return a Class after nesting within ob.rr)rrr
)r*
class_namerrrs     r_nest_classr0^s,Jrwz3333rci}t||pgD]\}}t|tr|||< |S)zReturn Class objects for the top-level classes in module.

    This is the original interface, before Functions were added.
    )_readmoduleitemsr r)rpathreskeyvalues     rrrdsW
C!&$*"55;;==
UeU##	CHJrc&t||pgS)zReturn a dictionary with all functions and classes in module.

    Search for module in PATH + sys.path.
    If possible, include imported superclasses.
    Do this by reading source, without importing (and executing) it.
    )r2)rr4s  rrrpsvtzr***rc0||d|}n|}|tvr
t|Si}|tjvr||t|<|S|d}|dkrn|d|}||dzd}t	|||}||d|}d|vr"td|t	||d|Sd}	||}
n|tjz}
tj	
||
}|td|||t|<|j
|j|d<	|j
|}||Sn#tt
f$r|cYSwxYw|j
|}
t#|||
|||S)	a.Do the hard work for readmodule[_ex].

    If inpackage is given, it must be the dotted name of the package in
    which we are searching for a submodule, and then PATH must be the
    package search path; otherwise, we are searching for a top-level
    module, and path is combined with sys.path.
    N.r__path__zNo package named {}zno module named )r)_modulessysbuiltin_module_namesrfindr2ImportErrorformatr4	importlibutil_find_spec_from_pathModuleNotFoundErrorsubmodule_search_locationsloader
get_sourceAttributeErrorget_filename_create_tree)rr4	inpackage
fullmoduletreeipackage	submodulerfsearch_pathspecsourcefnames              rr2r2zs )		662


X
##D)))i.?	SAAvv!*1Q344L	WdI66 !*GG4GV##3::7CCDDD9fZ&8'BBB	
ASXo>..z;GGD|!"CZ"C"C*UUUUHZ&2:Z''
33
>K	
K(
K$$Z00E
D%yIIIs2EE'&E'c8eZdZdZdZdddZdZdZdZd	S)
_ModuleBrowsercZ||_||_||_||_||_g|_dSr
)r4rOr
rrMstack)rrr4r
rOrMs      rrz_ModuleBrowser.__init__s0			"


rc	g}|jD]}tj|}||jvr!||j|@t|dx}dkrD|^}}}|tvr4|t||||||j	r
|j	dnd}	t|j|j||j
|j|	|j}|	||j|j<|j	||||j	dS)Nr:r;r.)basesastunparserOappendlensplitr=getr[rrrr
rr
generic_visitpop)
rnoder^basernames_rclass_rs
          rvisit_ClassDefz_ModuleBrowser.visit_ClassDefsbJ	#	#D;t$$Dty  TYt_----djjoo-U..22&+"FFX%%LL&!1!5!5fd!C!CDDDT""""#':7B4t{DIudi$BBB>#)DIdi 
&!!!4   
rFrc	B|jr
|jdnd}t|j|j|j|j|||j}|||j|j<|j||	||j
dS)Nr]r)r[rrrr
rrrOrarerf)rrgrrfunctions     rvisit_FunctionDefz _ModuleBrowser.visit_FunctionDefs#':7B4DKDIt{"HJJJ>#+DIdi 
(###4   
rc4||ddS)NTrm)rp)rrgs  rvisit_AsyncFunctionDefz%_ModuleBrowser.visit_AsyncFunctionDefs!td33333rc|jdkrdS|jD]a}		t|j|j|jn%#t$rt|jgYnwxYwK#ttf$rY^wxYwdS)Nr)
col_offsetrir2rr4rMrASyntaxError)rrgrs   rvisit_Importz_ModuleBrowser.visit_Imports?aFj				F
1TYGGGG"111R000001-




				s, :A AA AA  A43A4c|jdkrdS	d|jz}|jr
||jz
}t||j|j}n#ttf$rYdSwxYw|jD]r}|j	|vr"||j	|j
|jp|j	<-|j	dkr:|D]%\}}|
dr||j
|<&sdS)Nrr:*rj)rtlevelrr2r4rMrArurirrOasnamer3
startswith)rrgrrimport_nameimport_values      rvisit_ImportFromz_ModuleBrowser.visit_ImportFroms?aF	4:%F{
&$+% DNCCFF[)			FF	J	:	:DyF""6<TY6G	$+233c!!17::-K"--c22! -9DIk**	:	:s6AAAN)	rrrrrlrprrrvr~rrrrYrYs}238444


:::::rrYct|||||}|tj||jSr
)rYvisitr_parserO)rNr4rWrVrOrMmbrowsers       rrLrL
s;j$tYGGHNN39V$$%%%=rcdddl}	tjd}n#t}YnxYw|j|rg|j|g}|j|}|	dr
|dd}ng}t||}d}t||d}d	}|rJ|
}t|tr-t!|d
sd|_t|t$rRt|j|d}|D]}	|j|z|	_||t|t*r=t-dd|jz|j|j|jnKt|t6r6t-d
d|jz|j|j|HdSdS)z?Print module output (default this file) for quick visual check.rNr;z.pyc$t|ddS)Nrr)getattr)as r<lambda>z_main.<locals>.<lambda>"s71h22rT)r6reverseindentz{}class {} {} {} z{}def {} {})osr>argv__file__r4existsdirnamebasenamelowerendswithrsortedvaluesrfr listhasattrrrrextendrprintrBrrrr)
rmodr4rO
lineno_keyobjsindent_levelobjnew_objsr*s
          r_mainrs;
IIIhqk	w~~c$$%gs##99;;&&	crc(Cd##D22J$++--Z>>>DL
Phhjjc4  	sH%%	CJc7##	"cl1133",d<<<H
6
6J5		KK!!!c5!!	P$6#
*CHciLL
N
N
N
N
X
&
&	P-&&sSZ'73:NNOOO%PPPPPs	$__main__)Fr
)rr_r>importlib.utilrC__all__r=rrrr,r0rrr2NodeVisitorrYrLrrrrr<module>rs))V







>
>
>
))))))))*****w***GIIII
3333



++++=J=J=J=J@P:P:P:P:P:S_P:P:P:f$P$P$PLz	EGGGGGr