/opt/alt/python33/lib64/python3.3/__pycache__
NameSizeModeActions
abc.cpython-33.pyc96150644editdlrm
abc.cpython-33.pyo95490644editdlrm
aifc.cpython-33.pyc361160644editdlrm
aifc.cpython-33.pyo361160644editdlrm
antigravity.cpython-33.pyc10690644editdlrm
antigravity.cpython-33.pyo10690644editdlrm
argparse.cpython-33.pyc940130644editdlrm
argparse.cpython-33.pyo938200644editdlrm
ast.cpython-33.pyc153870644editdlrm
ast.cpython-33.pyo153870644editdlrm
asynchat.cpython-33.pyc113410644editdlrm
asynchat.cpython-33.pyo113410644editdlrm
asyncore.cpython-33.pyc254730644editdlrm
asyncore.cpython-33.pyo254730644editdlrm
base64.cpython-33.pyc154590644editdlrm
base64.cpython-33.pyo151980644editdlrm
bdb.cpython-33.pyc260120644editdlrm
bdb.cpython-33.pyo260120644editdlrm
binhex.cpython-33.pyc191020644editdlrm
binhex.cpython-33.pyo191020644editdlrm
bisect.cpython-33.pyc33680644editdlrm
bisect.cpython-33.pyo33680644editdlrm
bz2.cpython-33.pyc192120644editdlrm
bz2.cpython-33.pyo192120644editdlrm
calendar.cpython-33.pyc387950644editdlrm
calendar.cpython-33.pyo387950644editdlrm
cgi.cpython-33.pyc369260644editdlrm
cgi.cpython-33.pyo369260644editdlrm
cgitb.cpython-33.pyc137890644editdlrm
cgitb.cpython-33.pyo137890644editdlrm
chunk.cpython-33.pyc64220644editdlrm
chunk.cpython-33.pyo64220644editdlrm
cmd.cpython-33.pyc160740644editdlrm
cmd.cpython-33.pyo160740644editdlrm
code.cpython-33.pyc117330644editdlrm
code.cpython-33.pyo117330644editdlrm
codecs.cpython-33.pyc464380644editdlrm
codecs.cpython-33.pyo464380644editdlrm
codeop.cpython-33.pyc76810644editdlrm
codeop.cpython-33.pyo76810644editdlrm
colorsys.cpython-33.pyc43710644editdlrm
colorsys.cpython-33.pyo43710644editdlrm
compileall.cpython-33.pyc87870644editdlrm
compileall.cpython-33.pyo87870644editdlrm
configparser.cpython-33.pyc608840644editdlrm
configparser.cpython-33.pyo608840644editdlrm
contextlib.cpython-33.pyc115140644editdlrm
contextlib.cpython-33.pyo115140644editdlrm
copy.cpython-33.pyc100400644editdlrm
copy.cpython-33.pyo99480644editdlrm
copyreg.cpython-33.pyc57480644editdlrm
copyreg.cpython-33.pyo57040644editdlrm
cProfile.cpython-33.pyc70830644editdlrm
cProfile.cpython-33.pyo70830644editdlrm
crypt.cpython-33.pyc30780644editdlrm
crypt.cpython-33.pyo30780644editdlrm
csv.cpython-33.pyc178400644editdlrm
csv.cpython-33.pyo178400644editdlrm
datetime.cpython-33.pyc780030644editdlrm
datetime.cpython-33.pyo756790644editdlrm
decimal.cpython-33.pyc2127810644editdlrm
decimal.cpython-33.pyo2127810644editdlrm
difflib.cpython-33.pyc698400644editdlrm
difflib.cpython-33.pyo697890644editdlrm
dis.cpython-33.pyc112330644editdlrm
dis.cpython-33.pyo112330644editdlrm
doctest.cpython-33.pyc985250644editdlrm
doctest.cpython-33.pyo981630644editdlrm
dummy_threading.cpython-33.pyc13630644editdlrm
dummy_threading.cpython-33.pyo13630644editdlrm
filecmp.cpython-33.pyc113310644editdlrm
filecmp.cpython-33.pyo113310644editdlrm
fileinput.cpython-33.pyc177440644editdlrm
fileinput.cpython-33.pyo177440644editdlrm
fnmatch.cpython-33.pyc38210644editdlrm
fnmatch.cpython-33.pyo38210644editdlrm
formatter.cpython-33.pyc274240644editdlrm
formatter.cpython-33.pyo274240644editdlrm
fractions.cpython-33.pyc242130644editdlrm
fractions.cpython-33.pyo242130644editdlrm
ftplib.cpython-33.pyc450290644editdlrm
ftplib.cpython-33.pyo450290644editdlrm
functools.cpython-33.pyc158210644editdlrm
functools.cpython-33.pyo158210644editdlrm
genericpath.cpython-33.pyc37650644editdlrm
genericpath.cpython-33.pyo37650644editdlrm
getopt.cpython-33.pyc81130644editdlrm
getopt.cpython-33.pyo80680644editdlrm
getpass.cpython-33.pyc55560644editdlrm
getpass.cpython-33.pyo55560644editdlrm
gettext.cpython-33.pyc209130644editdlrm
gettext.cpython-33.pyo209130644editdlrm
glob.cpython-33.pyc32930644editdlrm
glob.cpython-33.pyo32930644editdlrm
gzip.cpython-33.pyc248760644editdlrm
gzip.cpython-33.pyo248160644editdlrm
hashlib.cpython-33.pyc62060644editdlrm
hashlib.cpython-33.pyo62060644editdlrm
heapq.cpython-33.pyc162350644editdlrm
heapq.cpython-33.pyo162350644editdlrm
hmac.cpython-33.pyc58170644editdlrm
hmac.cpython-33.pyo58170644editdlrm
imaplib.cpython-33.pyc569950644editdlrm
imaplib.cpython-33.pyo537260644editdlrm
imghdr.cpython-33.pyc55300644editdlrm
imghdr.cpython-33.pyo55300644editdlrm
imp.cpython-33.pyc125770644editdlrm
imp.cpython-33.pyo125770644editdlrm
inspect.cpython-33.pyc817110644editdlrm
inspect.cpython-33.pyo817110644editdlrm
io.cpython-33.pyc42830644editdlrm
io.cpython-33.pyo42830644editdlrm
ipaddress.cpython-33.pyc817980644editdlrm
ipaddress.cpython-33.pyo817980644editdlrm
keyword.cpython-33.pyc22100644editdlrm
keyword.cpython-33.pyo22100644editdlrm
linecache.cpython-33.pyc38700644editdlrm
linecache.cpython-33.pyo38700644editdlrm
locale.cpython-33.pyc538620644editdlrm
locale.cpython-33.pyo538620644editdlrm
lzma.cpython-33.pyc186630644editdlrm
lzma.cpython-33.pyo186630644editdlrm
macpath.cpython-33.pyc80210644editdlrm
macpath.cpython-33.pyo80210644editdlrm
macurl2path.cpython-33.pyc25610644editdlrm
macurl2path.cpython-33.pyo25610644editdlrm
mailbox.cpython-33.pyc992890644editdlrm
mailbox.cpython-33.pyo991500644editdlrm
mailcap.cpython-33.pyc81150644editdlrm
mailcap.cpython-33.pyo81150644editdlrm
mimetypes.cpython-33.pyc202480644editdlrm
mimetypes.cpython-33.pyo202480644editdlrm
modulefinder.cpython-33.pyc228520644editdlrm
modulefinder.cpython-33.pyo227700644editdlrm
netrc.cpython-33.pyc55220644editdlrm
netrc.cpython-33.pyo55220644editdlrm
nntplib.cpython-33.pyc469840644editdlrm
nntplib.cpython-33.pyo469840644editdlrm
ntpath.cpython-33.pyc176360644editdlrm
ntpath.cpython-33.pyo176360644editdlrm
nturl2path.cpython-33.pyc20830644editdlrm
nturl2path.cpython-33.pyo20830644editdlrm
numbers.cpython-33.pyc188590644editdlrm
numbers.cpython-33.pyo188590644editdlrm
opcode.cpython-33.pyc59710644editdlrm
opcode.cpython-33.pyo59710644editdlrm
optparse.cpython-33.pyc707610644editdlrm
optparse.cpython-33.pyo706780644editdlrm
os.cpython-33.pyc384310644editdlrm
os.cpython-33.pyo384310644editdlrm
os2emxpath.cpython-33.pyc52380644editdlrm
os2emxpath.cpython-33.pyo52380644editdlrm
pdb.cpython-33.pyc629640644editdlrm
pdb.cpython-33.pyo628920644editdlrm
pickle.cpython-33.pyc531300644editdlrm
pickle.cpython-33.pyo528970644editdlrm
pickletools.cpython-33.pyc675040644editdlrm
pickletools.cpython-33.pyo663350644editdlrm
pipes.cpython-33.pyc101470644editdlrm
pipes.cpython-33.pyo101470644editdlrm
pkgutil.cpython-33.pyc233760644editdlrm
pkgutil.cpython-33.pyo233760644editdlrm
platform.cpython-33.pyc404530644editdlrm
platform.cpython-33.pyo404530644editdlrm
plistlib.cpython-33.pyc235430644editdlrm
plistlib.cpython-33.pyo234490644editdlrm
poplib.cpython-33.pyc146030644editdlrm
poplib.cpython-33.pyo146030644editdlrm
posixpath.cpython-33.pyc136890644editdlrm
posixpath.cpython-33.pyo136890644editdlrm
pprint.cpython-33.pyc133000644editdlrm
pprint.cpython-33.pyo131230644editdlrm
profile.cpython-33.pyc187800644editdlrm
profile.cpython-33.pyo184890644editdlrm
pstats.cpython-33.pyc323010644editdlrm
pstats.cpython-33.pyo323010644editdlrm
pty.cpython-33.pyc57950644editdlrm
pty.cpython-33.pyo57950644editdlrm
pyclbr.cpython-33.pyc110450644editdlrm
pyclbr.cpython-33.pyo110450644editdlrm
pydoc.cpython-33.pyc1225580644editdlrm
pydoc.cpython-33.pyo1224800644editdlrm
py_compile.cpython-33.pyc76990644editdlrm
py_compile.cpython-33.pyo76990644editdlrm
queue.cpython-33.pyc120380644editdlrm
queue.cpython-33.pyo120380644editdlrm
quopri.cpython-33.pyc79970644editdlrm
quopri.cpython-33.pyo76870644editdlrm
random.cpython-33.pyc237740644editdlrm
random.cpython-33.pyo237740644editdlrm
re.cpython-33.pyc164520644editdlrm
re.cpython-33.pyo164520644editdlrm
reprlib.cpython-33.pyc83140644editdlrm
reprlib.cpython-33.pyo83140644editdlrm
rlcompleter.cpython-33.pyc64760644editdlrm
rlcompleter.cpython-33.pyo64760644editdlrm
runpy.cpython-33.pyc104850644editdlrm
runpy.cpython-33.pyo104850644editdlrm
sched.cpython-33.pyc82470644editdlrm
sched.cpython-33.pyo82470644editdlrm
shelve.cpython-33.pyc127620644editdlrm
shelve.cpython-33.pyo127620644editdlrm
shlex.cpython-33.pyc93940644editdlrm
shlex.cpython-33.pyo93940644editdlrm
shutil.cpython-33.pyc413740644editdlrm
shutil.cpython-33.pyo413740644editdlrm
site.cpython-33.pyc255970644editdlrm
site.cpython-33.pyo255970644editdlrm
smtpd.cpython-33.pyc343270644editdlrm
smtpd.cpython-33.pyo343270644editdlrm
smtplib.cpython-33.pyc411750644editdlrm
smtplib.cpython-33.pyo410810644editdlrm
sndhdr.cpython-33.pyc85480644editdlrm
sndhdr.cpython-33.pyo85480644editdlrm
socket.cpython-33.pyc184350644editdlrm
socket.cpython-33.pyo183820644editdlrm
socketserver.cpython-33.pyc313750644editdlrm
socketserver.cpython-33.pyo313750644editdlrm
sre_compile.cpython-33.pyc123190644editdlrm
sre_compile.cpython-33.pyo121380644editdlrm
sre_constants.cpython-33.pyc64920644editdlrm
sre_constants.cpython-33.pyo64920644editdlrm
sre_parse.cpython-33.pyc255610644editdlrm
sre_parse.cpython-33.pyo255610644editdlrm
ssl.cpython-33.pyc282640644editdlrm
ssl.cpython-33.pyo282640644editdlrm
stat.cpython-33.pyc45830644editdlrm
stat.cpython-33.pyo45830644editdlrm
string.cpython-33.pyc103350644editdlrm
string.cpython-33.pyo103350644editdlrm
stringprep.cpython-33.pyc161030644editdlrm
stringprep.cpython-33.pyo160310644editdlrm
struct.cpython-33.pyc4070644editdlrm
struct.cpython-33.pyo4070644editdlrm
subprocess.cpython-33.pyc559780644editdlrm
subprocess.cpython-33.pyo558450644editdlrm
sunau.cpython-33.pyc236770644editdlrm
sunau.cpython-33.pyo236770644editdlrm
symbol.cpython-33.pyc30490644editdlrm
symbol.cpython-33.pyo30490644editdlrm
symtable.cpython-33.pyc173490644editdlrm
symtable.cpython-33.pyo172120644editdlrm
sysconfig.cpython-33.pyc223060644editdlrm
sysconfig.cpython-33.pyo223060644editdlrm
tabnanny.cpython-33.pyc101820644editdlrm
tabnanny.cpython-33.pyo101820644editdlrm
tarfile.cpython-33.pyc881300644editdlrm
tarfile.cpython-33.pyo881300644editdlrm
telnetlib.cpython-33.pyc271230644editdlrm
telnetlib.cpython-33.pyo271230644editdlrm
tempfile.cpython-33.pyc308500644editdlrm
tempfile.cpython-33.pyo308500644editdlrm
textwrap.cpython-33.pyc141750644editdlrm
textwrap.cpython-33.pyo140830644editdlrm
this.cpython-33.pyc14290644editdlrm
this.cpython-33.pyo14290644editdlrm
threading.cpython-33.pyc496310644editdlrm
threading.cpython-33.pyo487700644editdlrm
timeit.cpython-33.pyc136170644editdlrm
timeit.cpython-33.pyo136170644editdlrm
token.cpython-33.pyc43970644editdlrm
token.cpython-33.pyo43970644editdlrm
tokenize.cpython-33.pyc246200644editdlrm
tokenize.cpython-33.pyo245640644editdlrm
trace.cpython-33.pyc316190644editdlrm
trace.cpython-33.pyo315560644editdlrm
traceback.cpython-33.pyc145130644editdlrm
traceback.cpython-33.pyo145130644editdlrm
tty.cpython-33.pyc14790644editdlrm
tty.cpython-33.pyo14790644editdlrm
types.cpython-33.pyc37690644editdlrm
types.cpython-33.pyo37690644editdlrm
uu.cpython-33.pyc48760644editdlrm
uu.cpython-33.pyo48760644editdlrm
uuid.cpython-33.pyc259170644editdlrm
uuid.cpython-33.pyo258390644editdlrm
warnings.cpython-33.pyc158380644editdlrm
warnings.cpython-33.pyo148810644editdlrm
wave.cpython-33.pyc250250644editdlrm
wave.cpython-33.pyo248170644editdlrm
weakref.cpython-33.pyc184420644editdlrm
weakref.cpython-33.pyo184420644editdlrm
webbrowser.cpython-33.pyc261110644editdlrm
webbrowser.cpython-33.pyo260660644editdlrm
xdrlib.cpython-33.pyc125230644editdlrm
xdrlib.cpython-33.pyo125230644editdlrm
zipfile.cpython-33.pyc590100644editdlrm
zipfile.cpython-33.pyo589450644editdlrm
_compat_pickle.cpython-33.pyc55060644editdlrm
_compat_pickle.cpython-33.pyo55060644editdlrm
_dummy_thread.cpython-33.pyc60490644editdlrm
_dummy_thread.cpython-33.pyo60490644editdlrm
_markupbase.cpython-33.pyc114560644editdlrm
_markupbase.cpython-33.pyo112400644editdlrm
_osx_support.cpython-33.pyc138340644editdlrm
_osx_support.cpython-33.pyo138340644editdlrm
_pyio.cpython-33.pyc853190644editdlrm
_pyio.cpython-33.pyo852930644editdlrm
_strptime.cpython-33.pyc196490644editdlrm
_strptime.cpython-33.pyo196490644editdlrm
_sysconfigdata.cpython-33.pyc236720644editdlrm
_sysconfigdata.cpython-33.pyo236720644editdlrm
_threading_local.cpython-33.pyc87250644editdlrm
_threading_local.cpython-33.pyo87250644editdlrm
_weakrefset.cpython-33.pyc133080644editdlrm
_weakrefset.cpython-33.pyo133080644editdlrm
__future__.cpython-33.pyc50110644editdlrm
__future__.cpython-33.pyo50110644editdlrm
__phello__.cpython-33.pyc1460644editdlrm
__phello__.cpython-33.pyo1460644editdlrm
Edit: /opt/alt/python33/lib64/python3.3/__pycache__/ast.cpython-33.pyo (15387B)
ž Νϊfn/c@sΚdZddlTdddd„Zdd„Zdd d d „Zd d „Zd d„Zddd„Z dd„Z dd„Z ddd„Z dd„Z Gdd„deƒZGdd„deƒZdS(!uH ast ~~~ The `ast` module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like and allows modifications of it. An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as a flag to the `compile()` builtin function or by using the `parse()` function from this module. The result will be a tree of objects whose classes all inherit from `ast.AST`. A modified abstract syntax tree can be compiled into a Python code object using the built-in `compile()` function. Additionally various helper functions are provided that make working with the trees simpler. The main intention of the helper functions and this module in general is to provide an easy to use interface for libraries that work tightly with the python syntax (template engines for example). :copyright: Copyright 2008 by Armin Ronacher. :license: Python License. i(u*u uexeccCst|||tƒS(un Parse the source into an AST node. Equivalent to compile(source, filename, mode, PyCF_ONLY_AST). (ucompileu PyCF_ONLY_AST(usourceufilenameumode((u(/opt/alt/python33/lib64/python3.3/ast.pyuparsesuparsecsyidd6d d6d d6‰t|tƒr?t|ddƒ}nt|tƒrZ|j}n‡‡fdd†‰ˆ|ƒS( u Safely evaluate an expression node or a string containing a Python expression. The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and None. uNoneuTrueuFalseumodeuevalc s2t|ttfƒr|jSt|tƒr2|jSt|tƒrWttˆ|j ƒƒSt|t ƒr|t tˆ|j ƒƒSt|t ƒr‘t tˆ|j ƒƒSt|tƒrάt‡fdd†t|j|jƒDƒƒSt|tƒr|jˆkrˆ|jSnt|tƒrxt|jttfƒrxt|jtttfƒrxˆ|jƒ}t|jtƒrp| S| Sn t|tƒrt|jttfƒrt|jtttfƒrt|jtttfƒrˆ|jƒ}ˆ|jƒ}t|jtƒr ||S||Sntdt |ƒƒ‚dS(Nc3s-|]#\}}ˆ|ƒˆ|ƒfVqdS(N((u.0ukuv(u_convert(u(/opt/alt/python33/lib64/python3.3/ast.pyu >su1literal_eval.._convert..umalformed node or string: (!u isinstanceuStruBytesusuNumunuTupleutupleumapueltsuListulistuSetusetuDictudictuzipukeysuvaluesuNameuiduUnaryOpuopuUAdduUSubuoperanduBinOpuAdduSuburightuleftu ValueErrorurepr(unodeuoperandulefturight(u_convertu _safe_names(u(/opt/alt/python33/lib64/python3.3/ast.pyu_convert2sB uliteral_eval.._convertNTF(uNoneuTrueuFalseu isinstanceustruparseu Expressionubody(unode_or_string((u_convertu _safe_namesu(/opt/alt/python33/lib64/python3.3/ast.pyu literal_eval&s $u literal_evalcsJ‡‡‡fdd†‰t|tƒs@td|jjƒ‚nˆ|ƒS(u» Return a formatted dump of the tree in *node*. This is mainly useful for debugging purposes. The returned string will show the names and the values for fields. This makes the code impossible to evaluate, so if evaluation is wanted *annotate_fields* must be set to False. Attributes such as line numbers and column offsets are not dumped by default. If this is wanted, *include_attributes* can be set to True. cs tˆtƒrΟ‡fdd†tˆƒDƒ}dˆjjdjˆrYdd„|Dƒndd„|Dƒƒf}ˆrLjjrΗ||r‘dp”d7}|dj‡‡fd d†ˆjDƒƒ7}n|d Stˆtƒrd dj‡fd d†ˆDƒƒStˆƒS( Ncs(g|]\}}|ˆ|ƒf‘qS(((u.0uaub(u_format(u(/opt/alt/python33/lib64/python3.3/ast.pyu ds u)dump.._format..u%s(%su, css|]}d|VqdS(u%s=%sN((u.0ufield((u(/opt/alt/python33/lib64/python3.3/ast.pyu fsu(dump.._format..css|]\}}|VqdS(N((u.0uaub((u(/opt/alt/python33/lib64/python3.3/ast.pyu hsu c3s.|]$}d|ˆtˆ|ƒƒfVqdS(u%s=%sN(ugetattr(u.0ua(u_formatunode(u(/opt/alt/python33/lib64/python3.3/ast.pyu lsu)u[%s]c3s|]}ˆ|ƒVqdS(N((u.0ux(u_format(u(/opt/alt/python33/lib64/python3.3/ast.pyu ps( u isinstanceuASTu iter_fieldsu __class__u__name__ujoinu _attributesulisturepr(unodeufieldsurv(u_formatuannotate_fieldsuinclude_attributes(unodeu(/opt/alt/python33/lib64/python3.3/ast.pyu_formatbs$udump.._formatuexpected AST, got %r(u isinstanceuASTu TypeErroru __class__u__name__(unodeuannotate_fieldsuinclude_attributes((u_formatuannotate_fieldsuinclude_attributesu(/opt/alt/python33/lib64/python3.3/ast.pyudumpYs udumpc Cs^xWdD]O}||jkr||jkrt||ƒrt||t||ƒƒqqW|S(u‹ Copy source location (`lineno` and `col_offset` attributes) from *old_node* to *new_node* if possible, and return *new_node*. ulinenou col_offset(ulinenou col_offset(u _attributesuhasattrusetattrugetattr(unew_nodeuold_nodeuattr((u(/opt/alt/python33/lib64/python3.3/ast.pyu copy_locationws   u copy_locationcs&‡fdd†‰ˆ|ddƒ|S(u{ When you compile a node tree with compile(), the compiler expects lineno and col_offset attributes for every node that supports them. This is rather tedious to fill in for generated nodes, so this helper adds these attributes recursively where not already set, by setting them to the values of the parent node. It works recursively starting at *node*. cs—d|jkr6t|dƒs*||_q6|j}nd|jkrlt|dƒs`||_ql|j}nx$t|ƒD]}ˆ|||ƒqyWdS(Nulinenou col_offset(u _attributesuhasattrulinenou col_offsetuiter_child_nodes(unodeulinenou col_offsetuchild(u_fix(u(/opt/alt/python33/lib64/python3.3/ast.pyu_fix‹s    u#fix_missing_locations.._fixii((unode((u_fixu(/opt/alt/python33/lib64/python3.3/ast.pyufix_missing_locationsƒs ufix_missing_locationsicCsFx?t|ƒD]1}d|jkr t|ddƒ||_q q W|S(uœ Increment the line number of each node in the tree starting at *node* by *n*. This is useful to "move code" to a different location in a file. ulinenoi(uwalku _attributesugetattrulineno(unodeunuchild((u(/opt/alt/python33/lib64/python3.3/ast.pyuincrement_linenoœs uincrement_linenoc csEx>|jD]3}y|t||ƒfVWq tk r<Yq Xq WdS(us Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` that is present on *node*. N(u_fieldsugetattruAttributeError(unodeufield((u(/opt/alt/python33/lib64/python3.3/ast.pyu iter_fields§s  u iter_fieldsccsrxkt|ƒD]]\}}t|tƒr0|Vq t|tƒr x(|D]}t|tƒrF|VqFqFWq q WdS(u‰ Yield all direct child nodes of *node*, that is, all fields that are nodes and all items of fields that are lists of nodes. N(u iter_fieldsu isinstanceuASTulist(unodeunameufielduitem((u(/opt/alt/python33/lib64/python3.3/ast.pyuiter_child_nodes³s uiter_child_nodescCsͺt|tttfƒs1td|jjƒ‚n|jr¦t|jdtƒr¦t|jdj t ƒr¦|r•ddl }|j |jdj j ƒS|jdj j SdS(uͺ Return the docstring for the given node or None if no docstring can be found. If the node provided does not have docstrings a TypeError will be raised. u%r can't have docstringsiN(u isinstanceu FunctionDefuClassDefuModuleu TypeErroru __class__u__name__ubodyuExpruvalueuStruinspectucleandocus(unodeucleanuinspect((u(/opt/alt/python33/lib64/python3.3/ast.pyu get_docstringΑs u get_docstringccsTddlm}||gƒ}x.|rO|jƒ}|jt|ƒƒ|Vq"WdS(uε Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context. i(udequeN(u collectionsudequeupopleftuextenduiter_child_nodes(unodeudequeutodo((u(/opt/alt/python33/lib64/python3.3/ast.pyuwalkΡs   uwalkcBs2|EeZdZdZdd„Zdd„ZdS(u NodeVisitoru< A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value which is forwarded by the `visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. Per default the visitor functions for the nodes are ``'visit_'`` + class name of the node. So a `TryFinally` node visit function would be `visit_TryFinally`. This behavior can be changed by overriding the `visit` method. If no visitor function exists for a node (return value `None`) the `generic_visit` visitor is used instead. Don't use the `NodeVisitor` if you want to apply changes to nodes during traversing. For this a special visitor exists (`NodeTransformer`) that allows modifications. cCs/d|jj}t|||jƒ}||ƒS(u Visit a node.uvisit_(u __class__u__name__ugetattru generic_visit(uselfunodeumethoduvisitor((u(/opt/alt/python33/lib64/python3.3/ast.pyuvisitσsuNodeVisitor.visitcCs‚x{t|ƒD]m\}}t|tƒr[xO|D]%}t|tƒr/|j|ƒq/q/Wq t|tƒr |j|ƒq q WdS(u9Called if no explicit visitor function exists for a node.N(u iter_fieldsu isinstanceulistuASTuvisit(uselfunodeufielduvalueuitem((u(/opt/alt/python33/lib64/python3.3/ast.pyu generic_visitωs uNodeVisitor.generic_visitN(u__name__u __module__u __qualname__u__doc__uvisitu generic_visit(u __locals__((u(/opt/alt/python33/lib64/python3.3/ast.pyu NodeVisitorίs u NodeVisitorcBs&|EeZdZdZdd„ZdS(uNodeTransformeru\ A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. The `NodeTransformer` will walk the AST and use the return value of the visitor methods to replace or remove the old node. If the return value of the visitor method is ``None``, the node will be removed from its location, otherwise it is replaced with the return value. The return value may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: class RewriteName(NodeTransformer): def visit_Name(self, node): return copy_location(Subscript( value=Name(id='data', ctx=Load()), slice=Index(value=Str(s=node.id)), ctx=node.ctx ), node) Keep in mind that if the node you're operating on has child nodes you must either transform the child nodes yourself or call the :meth:`generic_visit` method for the node first. For nodes that were part of a collection of statements (that applies to all statement nodes), the visitor may also return a list of nodes rather than just a single node. Usually you use the transformer like this:: node = YourTransformer().visit(node) cCsxt|ƒD]\}}t||dƒ}t|tƒrΖg}xp|D]h}t|tƒr’|j|ƒ}|dkr}qGq’t|tƒs’|j|ƒqGq’n|j|ƒqGW||dd…s  3   %