KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/inspect.pyo
m
=5Dc	@sdZdZdZdkZdkZdkZdkZdkZdkZdk	Z	dk
Z
dkZdZdZ
dZdZdZd	Zd
ZdZdZd
ZdZddZdZdZdZdZdZdZdZdZ dZ!dZ"hZ#dZ$dZ%dZ&dfdYZ'de(fd YZ)d!fd"YZ*d#Z+d$Z,d%Z-d&Z.d'd(Z/d@\Z0Z1Z2Z3d-Z4d.Z5d/Z6d0Z7e7d1Z8ddde9d2d3d4e7d5Z:e9d6d7d8e7d9Z;d)d:Z<d;Z=d)d<Z>d)d=Z?ei@ZAd)d>ZBd)d?ZCdS(AsuGet useful information from live Python objects.

This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.

Here are some of the useful functions provided by this module:

    ismodule(), isclass(), ismethod(), isfunction(), istraceback(),
        isframe(), iscode(), isbuiltin(), isroutine() - check object types
    getmembers() - get members of an object that satisfy a given condition

    getfile(), getsourcefile(), getsource() - find an object's source code
    getdoc(), getcomments() - get documentation on an object
    getmodule() - determine the module that an object came from
    getclasstree() - arrange classes so as to represent their hierarchy

    getargspec(), getargvalues() - get info about function arguments
    formatargspec(), formatargvalues() - format an argument spec
    getouterframes(), getinnerframes() - get info about frames
    currentframe() - get the current stack frame
    stack(), trace() - get info about frames on the stack or in a traceback
sKa-Ping Yee <ping@lfw.org>s
1 Jan 2001NcCst|tiS(sReturn true if the object is a module.

    Module objects provide these attributes:
        __doc__         documentation string
        __file__        filename (missing for built-in modules)N(t
isinstancetobjectttypest
ModuleType(R((t/usr/lib64/python2.4/inspect.pytismodule"scCs t|tip
t|dS(sReturn true if the object is a class.

    Class objects provide these attributes:
        __doc__         documentation string
        __module__      name of module in which this class was definedt	__bases__N(RRRt	ClassTypethasattr(R((Rtisclass*scCst|tiS(sReturn true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        im_class        class object in which this method belongs
        im_func         function object containing implementation of method
        im_self         instance to which this method is bound, or NoneN(RRRt
MethodType(R((Rtismethod2scCsHt|do8t|do't|ot|ot|S(sReturn true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    im_func attribute (etc) when an object passes ismethod().t__get__t__set__N(RRRt
isfunctionR	(R((Rtismethoddescriptor=s
cCst|do
t|dS(sReturn true if the object is a data descriptor.

    Data descriptors have both a __get__ and a __set__ attribute.  Examples are
    properties (defined in Python) and getsets and members (defined in C).
    Typically, data descriptors will also have __name__ and __doc__ attributes
    (properties, getsets, and members have both of these attributes), but this
    is not guaranteed.R
RN(RR(R((RtisdatadescriptorQscCst|tiS(sReturn true if the object is a user-defined function.

    Function objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this function was defined
        func_code       code object containing compiled function bytecode
        func_defaults   tuple of any default values for arguments
        func_doc        (same as __doc__)
        func_globals    global namespace in which this function was defined
        func_name       (same as __name__)N(RRRtFunctionType(R((RR[s
cCst|tiS(sbReturn true if the object is a traceback.

    Traceback objects provide these attributes:
        tb_frame        frame object at this level
        tb_lasti        index of last attempted instruction in bytecode
        tb_lineno       current line number in Python source code
        tb_next         next inner traceback object (called by this level)N(RRRt
TracebackType(R((RtistracebackhscCst|tiS(s|Return true if the object is a frame object.

    Frame objects provide these attributes:
        f_back          next outer frame object (this frame's caller)
        f_builtins      built-in namespace seen by this frame
        f_code          code object being executed in this frame
        f_exc_traceback traceback if raised in this frame, or None
        f_exc_type      exception type if raised in this frame, or None
        f_exc_value     exception value if raised in this frame, or None
        f_globals       global namespace seen by this frame
        f_lasti         index of last attempted instruction in bytecode
        f_lineno        current line number in Python source code
        f_locals        local namespace seen by this frame
        f_restricted    0 or 1 if frame is in restricted execution mode
        f_trace         tracing function for this frame, or NoneN(RRRt	FrameType(R((RtisframerscCst|tiS(suReturn true if the object is a code object.

    Code objects provide these attributes:
        co_argcount     number of arguments (not including * or ** args)
        co_code         string of raw compiled bytecode
        co_consts       tuple of constants used in the bytecode
        co_filename     name of file in which this code object was created
        co_firstlineno  number of first line in Python source code
        co_flags        bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
        co_lnotab       encoded mapping of line numbers to bytecode indices
        co_name         name with which this code object was defined
        co_names        tuple of names of local variables
        co_nlocals      number of local variables
        co_stacksize    virtual machine stack space required
        co_varnames     tuple of names of arguments and local variablesN(RRRtCodeType(R((RtiscodescCst|tiS(s,Return true if the object is a built-in function or method.

    Built-in functions and methods provide these attributes:
        __doc__         documentation string
        __name__        original name of this function or method
        __self__        instance to which a method is bound, or NoneN(RRRtBuiltinFunctionType(R((Rt	isbuiltinscCs1t|p$t|pt|p
t|S(s<Return true if the object is any kind of function or method.N(RRRRR(R((Rt	isroutinescCsfg}xOt|D]A}t||}|p
||o|i||fqqW|i|S(sReturn all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate.N(	tresultstdirRtkeytgetattrtvaluet	predicatetappendtsort(RR RRR((Rt
getmemberss

c
Cst|}t|}	g}x[|	D]S}||ijo|i|}nt	||}t	|dd}|djo0x-|D]!}||ijo|}PqqWn|dj	o!||ijo|i|}nt	||}t|to
d}n_t|to
d}nEt|to
d}n+t|p
t|o
d}nd}|i||||fq%W|S(sReturn list of attribute-descriptor tuples.

    For each name in dir(cls), the return list contains a 4-tuple
    with these elements:

        0. The name (a string).

        1. The kind of attribute this is, one of these strings:
               'class method'    created via classmethod()
               'static method'   created via staticmethod()
               'property'        created via property()
               'method'          any other flavor of method
               'data'            not a method

        2. The class which defined this attribute (a class).

        3. The object as obtained directly from the defining class's
           __dict__, not via getattr.  This is especially important for
           data attributes:  C.data is just a data object, but
           C.__dict__['data'] may be a data descriptor with additional
           info, like a __doc__ string.
    t__objclass__s
static methodsclass methodtpropertytmethodtdataN(tgetmrotclstmroRtnamestresulttnamet__dict__tobjRtNonethomeclstbasetobj_via_getattrRtstaticmethodtkindtclassmethodR%RRR!(
R)R/R-R5R*R,R2R3R1R+((Rtclassify_class_attrss<





cCsG||jodSn|i|x|iD]}t||q,WdS(N(R)taccumR!RR2t_searchbases(R)R8R2((RR9s


cCs<t|do|iSng}t||t|SdS(sHReturn tuple of base classes (including cls) in method resolution order.t__mro__N(RR)R:R,R9ttuple(R)R,((RR(s
cCs,ti|}t|tti|S(sBReturn the indent size, in spaces, at the start of a line of text.N(tstringt
expandtabstlinetexplinetlentlstrip(R>R?((Rt
indentsize
scCsy
|i}Wntj
odSnXt|tipdSnyti	ti
|d}Wntj
odSn!Xt
i}xQ|dD]E}tti|}|o#t||}t||}qqW|o|di|d<n|t
ijo6x3tdt|D]}|||||<qWnx"|o|do|iq@Wx%|o|do|idqeWti|dSdS(sGet the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed.s
iiiN(Rt__doc__tdoctAttributeErrorR0RRtStringTypesR<tsplitR=tlinestUnicodeErrortsystmaxinttmarginR>R@RAtcontenttindenttmintrangetitpoptjoin(RRMRNRQRDRHRLR>((Rtgetdocs>
			cCst|o+t|do|iSntdnt|o@tii|i	}t|do|iSntdnt
|o
|i}nt|o
|i
}nt|o
|i}nt|o
|i}nt|o|iSntddS(s@Work out which source or compiled file an object was defined in.t__file__sarg is a built-in modulesarg is a built-in classsNarg is not a module, class, method, function, traceback, frame, or code objectN(RRRRUt	TypeErrorR	RJtmodulestgett
__module__Rtim_funcRt	func_codeRttb_frameRtf_codeRtco_filename(R((Rtgetfile3s*










cCs~tii|}tdti}|ixC|D];\}}}}|||jo|| |||fSq;q;WdS(sDGet the module name, suffix, mode, and module type for a given file.cCs&|\}}}t||||fS(N(tsuffixtmodetmtypeR@(t.0R`RaRb((Rt<lambda>NsN(
tostpathtbasenametfilenametmaptimptget_suffixestsuffixesR"tneglenR`RaRb(RfR`RmRhRbRaRl((Rt
getmoduleinfoKs	
cCs#t|}|o|dSndS(s1Return the module name for a given file, or None.iN(RnRftinfo(RfRo((Rt
getmodulenameUscCst|}ti|dddgjo|d d}nxStiD]E\}}}d|jo)ti|t
||jodSqKqKWti
i|o|SndS(sEReturn the Python source file an object was defined in, if it exists.is.pycs.pyos.pytbN(R_RRhR<tlowerRjRkR`RaR5R@R0ReRftexists(RR5R`RhRa((Rt
getsourcefileZs 
.cCs/tiitiit|p
t|S(sReturn an absolute path to the source or compiled file for an object.

    The idea is for each object to have a unique origin, so this routine
    normalizes the result as much as possible.N(ReRftnormcasetabspathRtRR_(R((Rt
getabsfilefscCst|o|Snt|dotii|iSnyt|}Wnt	j
odSnX|tjotiit|SnxJtiiD]9}t|do#|ittiit|<qqW|tjotiit|Sntid}t|dpdSnt||io+t||i}||jo|Sq`ntid}t||io+t||i}||jo|SqndS(sAReturn the module an object was defined in, or None if not found.RYRUt__main__t__name__t__builtin__N(RRRRJRWRXRYRwtfileRVR0t
modulesbyfiletvaluestmoduleRyReRftrealpathtmainRt
mainobjecttbuiltint
builtinobject(RRR~R{RRR((Rt	getmoduleps:
	
'




cCst|p
t|}ti|}|ptdnt|o|dfSnt	|oo|i
}ti
d|d}xLtt|D](}|i||o||fSqqWtdnt|o
|i}nt|o
|i}nt|o
|i}nt|o
|i}nt|ot|dptdn|id}ti
d	}x5|djo'|i||oPn|d}qW||fSntd
dS(sbReturn the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
    in the file and the line number indexes a line in that list.  An IOError
    is raised if the source code cannot be retrieved.scould not get source codeis^\s*class\s*s\bscould not find class definitiontco_firstlinenos"could not find function definitionis+^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)scould not find code objectN(RtRR_R{t	linecachetgetlinesRHtIOErrorRR	RyR-tretcompiletpatRPR@RQtmatchRRZRR[RR\RR]RRRtlnum(RRR{RR-RHRQ((Rt
findsourcesF

	










cCs
yt|\}}Wnttfj
odSnXt|od}|o|dd djo
d}nxB|t	|jo.t
i||ddgjo|d}qrW|t	|jo||d djotg}|}xQ|t	|jo=||d djo(|it
i|||d}qWt
i|dSqn|djot||}|d}|djozt
i||d djo\t|||joEt
it
i||g}|djo|d}t
it
i||}xv|d djo`t|||joI|g|d*|d}|djoPnt
it
i||}qWnx0|o(t
i|ddjog|d*qWx0|o(t
i|ddjog|d)qWt
i|dSqndS(	swGet lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    iis#!itt#iN(RRRHRRRVR0RtstartR@R<tstriptcommentstendR!R=RSRBRNRAtcomment(RRNRRRRRHR((RtgetcommentssT	

3((

B

(


%!!t
ListReadercBs tZdZdZdZRS(sCProvide a readline() method to return lines from a list of strings.cCs||_d|_dS(Ni(RHtselftindex(RRH((Rt__init__s	cCsC|i}|t|ijo|d|_|i|SndSdS(NiR(RRRQR@RH(RRQ((Rtreadlines
	
(RyRYRCRR(((RRs	t
EndOfBlockcBstZRS(N(RyRY(((RRstBlockFindercBs tZdZdZdZRS(s@Provide a tokeneater() method to detect the end of a code block.cCs1d|_t|_t|_t|_d|_dS(Ni(RRNtFalsetislambdatstartedtpasslinetlast(R((RRs
				c
CsS|\}}|\}}	|ipA|djo'|djo
t|_nt|_nt|_	n|tijot
|_	||_n|i	on|iot|in|tijo|id|_t|_	nr|tijo4|id|_|idjot|iqOn.|tijo|djot|indS(Ntdeftclasstlambdaii(RRR(tsrowtscolterowtecolRRttokentTrueRRttypettokenizetNEWLINERRRtINDENTRNtDEDENTtNAME(
RRRt.6t.8R>RRRR((Rt
tokeneaters,





	



(RyRYRCRR(((RRs	cCsRy#tit|itiWn$tj
o}||id SnX|d S(s@Extract the block of code at the top of the given list of lines.iiN(	RRRHRRRRteobtargs(RHR((Rtgetblocks#cCsIt|\}}t|o|dfSnt|||dfSdS(sReturn a list of source lines and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of the lines
    corresponding to the object and the line number indicates where in the
    original source file the first line of code was found.  An IOError is
    raised if the source code cannot be retrieved.iiN(RRRHRRR(RRRH((Rtgetsourcelines s

cCs"t|\}}ti|dS(sReturn the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    IOError is raised if the source code cannot be retrieved.RN(RRRHRR<RS(RRRH((Rt	getsource-scCsrg}|iddxR|D]J}|i||if||jo!|it||||q q W|S(s-Recursive helper function for getclasstree().RcCs|i|ifS(N(tcRYRy(R((RRd:sN(RtclassesR"RR!Rtchildrentwalktree(RRtparentRR((RR7s
%icCsh}g}x|D]}|io]xx|iD]K}||jog||<n||i||o||joPq-q-Wq||jo|i|qqWx,|D]$}||jo|i|qqWt||dS(sArrange the given list of classes into a hierarchy of nested lists.

    Where a nested list appears, it contains classes derived from the class
    whose entry immediately precedes the list.  Each entry is a 2-tuple
    containing a class and a tuple of its base classes.  If the 'unique'
    argument is true, exactly one entry appears in the returned structure
    for each class in the given list.  Otherwise, classes using multiple
    inheritance and their descendants will appear multiple times.N(
RtrootsRRRRR!tuniqueRR0(RRRRRR((RtgetclasstreeAs(





iiiicCs{t|ptdn|i}|i}|i}t	|| }d}	xt|D]}
||
d ddgjoggg}}}xq|	t|jo]t||	}|	d}	|tijo/ti|}t||	t||	dd}|	d}	|dd	gjo|i||i|q|d
jo|i|||p|dg|d<Pq|dd|d<x]|ddjoK|i|i}||g||)|pPn|dd|d<qW|pPqqqqW|d||
<q[q[Wd}
|it@o|i|}
|d}nd}|it @o|i|}n||
|fS(
sGet information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where 'args' is
    a list of argument names (possibly containing nested lists), and
    'varargs' and 'varkw' are the names of the * and ** arguments or None.sarg is not a code objectiiRt.iitUNPACK_TUPLEtUNPACK_SEQUENCEt
STORE_FASTiN(!RtcoRVtco_codetcodetco_argcounttnargstco_varnamesR+tlistRtstepRPRQtstacktremaintcountR@tordtoptdist
HAVE_ARGUMENTtopnameRR!RRtsizeR0tvarargstco_flagst
CO_VARARGStvarkwtCO_VARKEYWORDS(RRR+RRRRRRRRRRRQRR((Rtgetargs^s`
			


&




cCsbt|o
|i}nt|ptdnt|i\}}}||||i
fS(slGet the names and default values of a function's arguments.

    A tuple of four things is returned: (args, varargs, varkw, defaults).
    'args' is a list of the argument names (it may contain nested lists).
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'defaults' is an n-tuple of the default values of the last n arguments.
    sarg is not a Python functionN(RtfuncRZRRVRR[RRRt
func_defaults(RRRR((Rt
getargspecs


cCs+t|i\}}}||||ifS(sWGet information about arguments passed into a particular frame.

    A tuple of four things is returned: (args, varargs, varkw, locals).
    'args' is a list of the argument names (it may contain nested lists).
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'locals' is the locals dictionary of the given frame.N(RtframeR]RRRtf_locals(RRRR((RtgetargvaluesscCsCt|djod|ddSndti|ddSdS(Nit(is,)s, t)(R@tseqR<RS(R((RtjoinseqscCsMt|titigjo |t||d|Sn||SdS(s7Recursively walk a sequence, stringifying each element.cCst|||S(N(tstrseqtoRtj(RRR((RRdsN(RRRtListTypet	TupleTypeRSRitconvert(RRRS((RRs cCsd|S(Nt*(R-(R-((RRdscCsd|S(Ns**(R-(R-((RRdscCsdt|S(Nt=(treprR(R((RRdsc	
Csg}|ot|t|}
nxmtt|D]Y}	t||	||}|o)|	|
jo||||	|
}n|i|q:W|dj	o|i||n|dj	o|i||ndti	|ddS(sgFormat an argument spec from the 4 values returned by getargspec.

    The first four arguments are (args, varargs, varkw, defaults).  The
    other four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.Rs, RN(tspecstdefaultsR@RtfirstdefaultRPRQRt	formatargRStspectformatvalueR!RR0t
formatvarargsRtformatvarkwR<(
RRRRRRRRRSRQRRR((Rt
formatargspecs

cCsd|S(NR(R-(R-((RRdscCsd|S(Ns**(R-(R-((RRdscCsdt|S(NR(RR(R((RRdsc	Cs|||d}	g}x7tt|D]#}
|i	t
||
|	|q+W|o%|i	|||||n|o%|i	|||||ndti|ddS(sfFormat an argument spec from the 4 values returned by getargvalues.

    The first four arguments are (args, varargs, varkw, locals).  The
    next four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.cCs|||||S(N(RR-Rtlocals(R-RRR((RRsRs, RN(RRRRRRPR@RRQR!RRSRRRRR<(RRRRRRRRRSRRQR((Rtformatargvaluess!%%cCs.t|o|i}|i}n
|i}t|ptdnt|p
t	|}|djo|d|d}yt
|\}}Wntj
od}}qXt|d}tdt|t||}||||!}|d|}nd}}|||ii||fS(sGet information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line.s&arg is not a frame or traceback objectiiiN(RRt	tb_linenotlinenoR\tf_linenoRRVRtR_RhtcontextRRRHRRR0RtmaxROR@R]tco_name(RRRRRHRhRR((Rtgetframeinfos(
	
	

"
cCs|iS(sCGet the line number from a frame object, allowing for optimization.N(RR(R((Rt	getlinenoscCs?g}x2|o*|i|ft|||i}q	W|S(sGet a list of records for a frame and all higher (calling) frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.N(t	framelistRR!RRtf_back(RRR((RtgetouterframesscCsBg}x5|o-|i|ift|||i}q	W|S(sGet a list of records for a traceback's frame and all lower frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.N(RttbR!R\RRttb_next(RRR((Rtgetinnerframes$s cCsttid|S(s@Return a list of records for the stack above the caller's frame.iN(RRJt	_getframeR(R((RR1scCsttid|S(sCReturn a list of records for the stack below the current exception.iN(RRJtexc_infoR(R((Rttrace5s(iiii(DRCt
__author__t__date__RJReRR<RRRjRRRR	RRRRRRRRRR0R#R7R9R(RBRTR_RnRpRtRwR|RRRRt	ExceptionRRRRRRRtCO_OPTIMIZEDtCO_NEWLOCALSRRRRRRRtstrRRRRRRR	tcurrentframeRR(?RRRRRRBRpRR_RRRRwRRnRRRRRRRRjRRRRRRRRRRR<RR	R#RRRJRR9RR(RRRRTRRR7RRRR|R
RRRRtRReR((Rt?shQ					
	
	
						G		
		$		
				 	*	-
!			
	
	
	;		
	*!!		

Anon7 - 2021