summaryrefslogtreecommitdiff
path: root/test/scanners/python/pleac.expected.raydebug
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-10-19 17:25:57 +0000
committermurphy <murphy@rubychan.de>2009-10-19 17:25:57 +0000
commit094616e18e4a0f441fe6f88c65dc1b86be5668d2 (patch)
treef785565c18598425c11ef52a39616531041f3db2 /test/scanners/python/pleac.expected.raydebug
parent98cd8c95c53d7865db469f742c541f274057770a (diff)
downloadcoderay-094616e18e4a0f441fe6f88c65dc1b86be5668d2.tar.gz
Updated Python scanner (#41)
* Unicode support (kind of) * [from ...] import ... as construct highlighted as :include * added a test case for import statements
Diffstat (limited to 'test/scanners/python/pleac.expected.raydebug')
-rw-r--r--test/scanners/python/pleac.expected.raydebug846
1 files changed, 423 insertions, 423 deletions
diff --git a/test/scanners/python/pleac.expected.raydebug b/test/scanners/python/pleac.expected.raydebug
index b0c64fa..6c110f6 100644
--- a/test/scanners/python/pleac.expected.raydebug
+++ b/test/scanners/python/pleac.expected.raydebug
@@ -50,7 +50,7 @@ comment(#-----------------------------)
comment(# get a 5-char string, skip 3, then grab 2 8-char strings, then the rest)
comment(# Note that struct.unpack cannot use * for an unknown length.)
comment(# See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65224)
-keyword(import) ident(struct)
+keyword(import) include(struct)
operator(()ident(lead)operator(,) ident(s1)operator(,) ident(s2)operator(\))operator(,) ident(tail) operator(=) ident(struct)operator(.)ident(unpack)operator(()string<delimiter(")content(5s 3x 8s 8s)delimiter(")>operator(,) ident(data)operator([)operator(:)integer(24)operator(])operator(\))operator(,) ident(data)operator([)integer(24)operator(:)operator(])
comment(# split at five-char boundaries)
@@ -82,13 +82,13 @@ ident(mystr) operator(=) string<delimiter(")content(This is what you have)delimi
ident(mystr) operator(=) ident(mystr)operator(.)ident(replace)operator(()string<delimiter(")content( is )delimiter(")>operator(,) string<delimiter(")content( wasn't )delimiter(")>operator(\))
comment(# DON'T DO THIS: In-place modification could be done using character arrays)
-keyword(import) ident(array)
+keyword(import) include(array)
ident(mystr) operator(=) ident(array)operator(.)ident(array)operator(()string<delimiter(")content(c)delimiter(")>operator(,) string<delimiter(")content(This is what you have)delimiter(")>operator(\))
ident(mystr)operator([)integer(5)operator(:)integer(7)operator(]) operator(=) ident(array)operator(.)ident(array)operator(()string<delimiter(")content(c)delimiter(")>operator(,) string<delimiter(")content(wasn't)delimiter(")>operator(\))
comment(# mystr is now array('c', "This wasn't what you have"\))
comment(# DON'T DO THIS: It could also be done using MutableString )
-keyword(from) ident(UserString) keyword(import) ident(MutableString)
+keyword(from) include(UserString) keyword(import) include(MutableString)
ident(mystr) operator(=) ident(MutableString)operator(()string<delimiter(")content(This is what you have)delimiter(")>operator(\))
ident(mystr)operator([)operator(-)integer(12)operator(:)operator(]) operator(=) string<delimiter(")content(ondrous)delimiter(")>
comment(# mystr is now "This is wondrous")
@@ -173,11 +173,11 @@ comment(#-----------------------------)
ident(foo) operator(=) ident(bar) keyword(or) string<delimiter(")content(DEFAULT VALUE)delimiter(")>
comment(#-----------------------------)
comment(# To get a user (for both UNIX and Windows\), use:)
-keyword(import) ident(getpass)
+keyword(import) include(getpass)
ident(user) operator(=) ident(getpass)operator(.)ident(getuser)operator(()operator(\))
comment(# DON'T DO THIS: find the user name on Unix systems )
-keyword(import) ident(os)
+keyword(import) include(os)
ident(user) operator(=) ident(os)operator(.)ident(environ)operator(.)ident(get)operator(()string<delimiter(")content(USER)delimiter(")>operator(\))
keyword(if) ident(user) keyword(is) pre_constant(None)operator(:)
ident(user) operator(=) ident(os)operator(.)ident(environ)operator(.)ident(get)operator(()string<delimiter(")content(LOGNAME)delimiter(")>operator(\))
@@ -258,7 +258,7 @@ keyword(def) method(checksum)operator(()ident(myfile)operator(\))operator(:)
ident(values) operator(=) operator([)predefined(ord)operator(()ident(c)operator(\)) keyword(for) ident(line) keyword(in) ident(myfile) keyword(for) ident(c) keyword(in) ident(line)operator(])
keyword(return) predefined(sum)operator(()ident(values)operator(\))operator(%)operator(()integer(2)operator(**)integer(16)operator(\)) operator(-) integer(1)
-keyword(import) ident(fileinput)
+keyword(import) include(fileinput)
keyword(print) ident(checksum)operator(()ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(\)) comment(# data from sys.stdin)
comment(# Using a function means any iterable can be checksummed:)
@@ -268,8 +268,8 @@ comment(#-----------------------------)
comment(#!/usr/bin/python)
comment(# slowcat - emulate a s l o w line printer)
comment(# usage: slowcat [- DELAY] [files ...])
-keyword(import) ident(sys)operator(,) ident(select)
-keyword(import) ident(re)
+keyword(import) include(sys)operator(,) include(select)
+keyword(import) include(re)
ident(DELAY) operator(=) integer(1)
keyword(if) ident(re)operator(.)ident(match)operator(()string<delimiter(")content(^-)content(\\d)content(+$)delimiter(")>operator(,)ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(\))operator(:)
ident(DELAY)operator(=)operator(-)predefined(int)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(\))
@@ -349,7 +349,7 @@ ident(text) operator(=) string<delimiter(")content(I am %(rows\)s high and %(col
keyword(print) ident(text)
comment(#=> I am 24 high and 80 long)
comment(#-----------------------------)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(print) ident(re)operator(.)ident(sub)operator(()string<delimiter(")content(\\d)content(+)delimiter(")>operator(,) keyword(lambda) ident(i)operator(:) predefined(str)operator(()integer(2) operator(*) predefined(int)operator(()ident(i)operator(.)ident(group)operator(()integer(0)operator(\))operator(\))operator(\))operator(,) string<delimiter(")content(I am 17 years old)delimiter(")>operator(\))
comment(#=> I am 34 years old)
comment(#-----------------------------)
@@ -365,7 +365,7 @@ keyword(print) ident(text)
comment(#=> Hello and [No Variable: bye]!)
comment(#If you don't need a particular error message, just use the Template class:)
-keyword(from) ident(string) keyword(import) ident(Template)
+keyword(from) include(string) keyword(import) include(Template)
ident(x) operator(=) ident(Template)operator(()string<delimiter(")content($hi and $bye!)delimiter(")>operator(\))
ident(hi) operator(=) string<delimiter(")content(Hello)delimiter(")>
keyword(print) ident(x)operator(.)ident(safe_substitute)operator(()predefined(locals)operator(()operator(\))operator(\))
@@ -389,7 +389,7 @@ comment(#-----------------------------)
keyword(if) ident(a)operator(.)ident(upper)operator(()operator(\)) operator(==) ident(b)operator(.)ident(upper)operator(()operator(\))operator(:)
keyword(print) string<delimiter(")content(a and b are the same)delimiter(")>
comment(#-----------------------------)
-keyword(import) ident(random)
+keyword(import) include(random)
keyword(def) method(randcase_one)operator(()ident(letter)operator(\))operator(:)
keyword(if) ident(random)operator(.)ident(randint)operator(()integer(0)operator(,)integer(5)operator(\))operator(:) comment(# True on 1, 2, 3, 4)
keyword(return) ident(letter)operator(.)ident(lower)operator(()operator(\))
@@ -410,7 +410,7 @@ string<delimiter(")content(I have %d guanacos.)delimiter(")> operator(%) operato
keyword(print) string<delimiter(")content(I have)delimiter(")>operator(,) ident(n)operator(+)integer(1)operator(,) string<delimiter(")content(guanacos.)delimiter(")>
comment(#-----------------------------)
comment(#Python templates disallow in-string calculations (see PEP 292\))
-keyword(from) ident(string) keyword(import) ident(Template)
+keyword(from) include(string) keyword(import) include(Template)
ident(email_template) operator(=) ident(Template)operator(()string<delimiter(""")char(\\
)content(To: $address)content(
@@ -427,8 +427,8 @@ ident(email_template) operator(=) ident(Template)operator(()string<delimiter("""
)content(the management)content(
)delimiter(""")>operator(\))
-keyword(import) ident(random)
-keyword(import) ident(datetime)
+keyword(import) include(random)
+keyword(import) include(datetime)
ident(person) operator(=) operator({)string<delimiter(")content(address)delimiter(")>operator(:)string<delimiter(")content(Joe@somewhere.com)delimiter(")>operator(,)
string<delimiter(")content(name)delimiter(")>operator(:) string<delimiter(")content(Joe)delimiter(")>operator(,)
@@ -449,7 +449,7 @@ ident(var) operator(=) string<delimiter(""")content(
)content( )delimiter(""")>
comment(# using regular expressions)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(re_leading_blanks) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(")content(^)content(\\s)content(+)delimiter(")>operator(,)ident(re)operator(.)ident(MULTILINE)operator(\))
ident(var1) operator(=) ident(re_leading_blanks)operator(.)ident(sub)operator(()string<delimiter(")delimiter(")>operator(,)ident(var)operator(\))operator([)operator(:)operator(-)integer(1)operator(])
@@ -468,14 +468,14 @@ ident(poem) operator(=) string<delimiter(""")content(
)content( --Bilbo in /usr/src/perl/pp_ctl.c )content(
)content( )delimiter(""")>
-keyword(import) ident(textwrap)
+keyword(import) include(textwrap)
keyword(print) ident(textwrap)operator(.)ident(dedent)operator(()ident(poem)operator(\))operator([)integer(1)operator(:)operator(-)integer(1)operator(])
comment(#-----------------------------)
comment(# @@PLEAC@@_1.12)
comment(#-----------------------------)
-keyword(from) ident(textwrap) keyword(import) ident(wrap)
+keyword(from) include(textwrap) keyword(import) include(wrap)
ident(output) operator(=) ident(wrap)operator(()ident(para)operator(,)
ident(initial_indent)operator(=)ident(leadtab)
ident(subsequent_indent)operator(=)ident(nexttab)operator(\))
@@ -490,7 +490,7 @@ ident(txt) operator(=) string<delimiter(""")char(\\
)content(mobile electrons!)content(
)delimiter(""")>
-keyword(from) ident(textwrap) keyword(import) ident(TextWrapper)
+keyword(from) include(textwrap) keyword(import) include(TextWrapper)
ident(wrapper) operator(=) ident(TextWrapper)operator(()ident(width)operator(=)integer(20)operator(,)
ident(initial_indent)operator(=)string<delimiter(")content( )delimiter(")>operator(*)integer(4)operator(,)
@@ -515,8 +515,8 @@ string<delimiter(""")content(Expected result:)content(
comment(#-----------------------------)
comment(# merge multiple lines into one, then wrap one long line)
-keyword(from) ident(textwrap) keyword(import) ident(fill)
-keyword(import) ident(fileinput)
+keyword(from) include(textwrap) keyword(import) include(fill)
+keyword(import) include(fileinput)
keyword(print) ident(fill)operator(()string<delimiter(")delimiter(")>operator(.)ident(join)operator(()ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(\))operator(\))
@@ -527,16 +527,16 @@ comment(# recipe from python-list #530228 is shown here.)
comment(# (http://aspn.activestate.com/ASPN/Mail/Message/python-list/530228\))
comment(# Be aware that this will work on Unix but not on Windows.)
-keyword(from) ident(termwrap) keyword(import) ident(wrap)
-keyword(import) ident(struct)operator(,) ident(fcntl)
+keyword(from) include(termwrap) keyword(import) include(wrap)
+keyword(import) include(struct)operator(,) include(fcntl)
keyword(def) method(getheightwidth)operator(()operator(\))operator(:)
ident(height)operator(,) ident(width) operator(=) ident(struct)operator(.)ident(unpack)operator(()
string<delimiter(")content(hhhh)delimiter(")>operator(,) ident(fcntl)operator(.)ident(ioctl)operator(()integer(0)operator(,) ident(TERMIOS)operator(.)ident(TIOCGWINSZ) operator(,)string<delimiter(")char(\\000)delimiter(")>operator(*)integer(8)operator(\))operator(\))operator([)integer(0)operator(:)integer(2)operator(])
keyword(return) ident(height)operator(,) ident(width)
comment(# PERL <>, $/, $\\ emulation)
-keyword(import) ident(fileinput)
-keyword(import) ident(re)
+keyword(import) include(fileinput)
+keyword(import) include(re)
ident(_)operator(,) ident(width) operator(=) ident(getheightwidth)operator(()operator(\))
keyword(for) ident(para) keyword(in) ident(re)operator(.)ident(split)operator(()string<modifier(r)delimiter(")content(\\n)content({2,})delimiter(")>operator(,) string<delimiter(")delimiter(")>operator(.)ident(join)operator(()ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(\))operator(\))operator(:)
@@ -560,7 +560,7 @@ ident(mystr) operator(=) ident(mystr)operator(.)ident(strip)operator(()operator(
comment(# @@PLEAC@@_1.15)
comment(#-----------------------------)
-keyword(import) ident(csv)
+keyword(import) include(csv)
keyword(def) method(parse_csv)operator(()ident(line)operator(\))operator(:)
ident(reader) operator(=) ident(csv)operator(.)ident(reader)operator(()operator([)ident(line)operator(])operator(,) ident(escapechar)operator(=)string<delimiter(')char(\\\\)delimiter(')>operator(\))
keyword(return) ident(reader)operator(.)ident(next)operator(()operator(\))
@@ -573,7 +573,7 @@ keyword(for) ident(i)operator(,) ident(field) keyword(in) predefined(enumerate)o
keyword(print) string<delimiter(")content(%d : %s)delimiter(")> operator(%) operator(()ident(i)operator(,) ident(field)operator(\))
comment(# pre-2.3 version of parse_csv)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(def) method(parse_csv)operator(()ident(text)operator(\))operator(:)
ident(pattern) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(''')content("([^")char(\\\\)content(\\])content(*(?:)char(\\\\)content(\\.)content([^")char(\\\\)content(\\])content(*\)*\)",?|([^,]+\),?|,)delimiter(''')>operator(\))
ident(mylist) operator(=) operator([)string<delimiter(")delimiter(")>operator(.)ident(join)operator(()ident(elem)operator(\))
@@ -636,7 +636,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_1.17)
comment(#-----------------------------)
-keyword(import) ident(sys)operator(,) ident(fileinput)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(fileinput)operator(,) include(re)
ident(data) operator(=) string<delimiter(""")char(\\
)content(analysed => analyzed)content(
@@ -697,7 +697,7 @@ comment(# compiling user queries into code.)
comment(#)
comment(# examples :)
comment(# psgrep "uid<10")
-keyword(import) ident(sys)operator(,) ident(os)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(os)operator(,) include(re)
keyword(class) class(PsLineMatch)operator(:)
comment(# each field from the PS header)
@@ -815,7 +815,7 @@ comment(# equal to accuracy number of decimal places)
keyword(def) method(equal)operator(()ident(num1)operator(,) ident(num2)operator(,) ident(accuracy)operator(\))operator(:)
keyword(return) predefined(abs)operator(()ident(num1) operator(-) ident(num2)operator(\)) operator(<) integer(10)operator(**)operator(()operator(-)ident(accuracy)operator(\))
comment(#-----------------------------)
-keyword(from) ident(__future__) keyword(import) ident(division) comment(# use / for float div and // for int div)
+keyword(from) include(__future__) keyword(import) include(division) comment(# use / for float div and // for int div)
ident(wage) operator(=) integer(536) comment(# $5.36/hour)
ident(week) operator(=) integer(40) operator(*) ident(wage) comment(# $214.40)
@@ -836,7 +836,7 @@ comment(#=> Rounded: 0.26)
comment(#=> Unrounded: 0.255000)
comment(#=> Rounded: 0.26)
comment(#-----------------------------)
-keyword(from) ident(math) keyword(import) ident(floor)operator(,) ident(ceil)
+keyword(from) include(math) keyword(import) include(floor)operator(,) include(ceil)
keyword(print) string<delimiter(")content(number)char(\\t)content(int)char(\\t)content(floor)char(\\t)content(ceil)delimiter(")>
ident(a) operator(=) operator([)float(3.3)operator(,) float(3.5)operator(,) float(3.7)operator(,) operator(-)float(3.3)operator(])
@@ -856,7 +856,7 @@ ident(num) operator(=) predefined(int)operator(()string<delimiter(')content(0110
comment(# To convert an int to an string representation in another base, you could use)
comment(# <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/111286>:)
-keyword(import) ident(baseconvert)
+keyword(import) include(baseconvert)
keyword(def) method(dec2bin)operator(()ident(i)operator(\))operator(:)
keyword(return) ident(baseconvert)operator(.)ident(baseconvert)operator(()ident(i)operator(,) ident(baseconvert)operator(.)ident(BASE10)operator(,) ident(baseconvert)operator(.)ident(BASE2)operator(\))
@@ -901,7 +901,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_2.7)
comment(#-----------------------------)
-keyword(import) ident(random) comment(# use help(random\) to see the (large\) list of funcs)
+keyword(import) include(random) comment(# use help(random\) to see the (large\) list of funcs)
ident(rand) operator(=) ident(random)operator(.)ident(randint)operator(()ident(x)operator(,) ident(y)operator(\))
comment(#-----------------------------)
@@ -910,7 +910,7 @@ keyword(print) ident(rand)
comment(#-----------------------------)
ident(elt) operator(=) ident(random)operator(.)ident(choice)operator(()ident(mylist)operator(\))
comment(#-----------------------------)
-keyword(import) ident(string)
+keyword(import) include(string)
ident(chars) operator(=) ident(string)operator(.)ident(letters) operator(+) ident(string)operator(.)ident(digits) operator(+) string<delimiter(")content(!@$%^&*)delimiter(")>
ident(password) operator(=) string<delimiter(")delimiter(")>operator(.)ident(join)operator(()operator([)ident(random)operator(.)ident(choice)operator(()ident(chars)operator(\)) keyword(for) ident(i) keyword(in) predefined(range)operator(()integer(8)operator(\))operator(])operator(\))
comment(#-----------------------------)
@@ -937,7 +937,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_2.10)
comment(#-----------------------------)
-keyword(import) ident(random)
+keyword(import) include(random)
ident(mean) operator(=) integer(25)
ident(sdev) operator(=) integer(2)
ident(salary) operator(=) ident(random)operator(.)ident(gauss)operator(()ident(mean)operator(,) ident(sdev)operator(\))
@@ -950,15 +950,15 @@ ident(radians) operator(=) ident(math)operator(.)ident(radians)operator(()ident(
ident(degrees) operator(=) ident(math)operator(.)ident(degrees)operator(()ident(radians)operator(\))
comment(# pre-2.3:)
-keyword(from) ident(__future__) keyword(import) ident(division)
-keyword(import) ident(math)
+keyword(from) include(__future__) keyword(import) include(division)
+keyword(import) include(math)
keyword(def) method(deg2rad)operator(()ident(degrees)operator(\))operator(:)
keyword(return) operator(()ident(degrees) operator(/) integer(180)operator(\)) operator(*) ident(math)operator(.)ident(pi)
keyword(def) method(rad2deg)operator(()ident(radians)operator(\))operator(:)
keyword(return) operator(()ident(radians) operator(/) ident(math)operator(.)ident(pi)operator(\)) operator(*) integer(180)
comment(#-----------------------------)
comment(# Use deg2rad instead of math.radians if you have pre-2.3 Python.)
-keyword(import) ident(math)
+keyword(import) include(math)
keyword(def) method(degree_sine)operator(()ident(degrees)operator(\))operator(:)
ident(radians) operator(=) ident(math)operator(.)ident(radians)operator(()ident(degrees)operator(\))
keyword(return) ident(math)operator(.)ident(sin)operator(()ident(radians)operator(\))
@@ -966,7 +966,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_2.12)
comment(#-----------------------------)
-keyword(import) ident(math)
+keyword(import) include(math)
comment(# DON'T DO THIS. Use math.tan(\) instead.)
keyword(def) method(tan)operator(()ident(theta)operator(\))operator(:)
@@ -981,7 +981,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_2.13)
comment(#-----------------------------)
-keyword(import) ident(math)
+keyword(import) include(math)
ident(log_e) operator(=) ident(math)operator(.)ident(log)operator(()ident(VALUE)operator(\))
comment(#-----------------------------)
ident(log_10) operator(=) ident(math)operator(.)ident(log10)operator(()ident(VALUE)operator(\))
@@ -1000,7 +1000,7 @@ comment(#-----------------------------)
comment(# NOTE: must have NumPy installed. See)
comment(# http://www.pfdubois.com/numpy/)
-keyword(import) ident(Numeric)
+keyword(import) include(Numeric)
ident(a) operator(=) ident(Numeric)operator(.)ident(array)operator(() operator(()operator(()integer(3)operator(,) integer(2)operator(,) integer(3)operator(\))operator(,)
operator(()integer(5)operator(,) integer(9)operator(,) integer(8)operator(\)) operator(\))operator(,) string<delimiter(")content(d)delimiter(")>operator(\))
ident(b) operator(=) ident(Numeric)operator(.)ident(array)operator(() operator(()operator(()integer(4)operator(,) integer(7)operator(\))operator(,)
@@ -1027,7 +1027,7 @@ comment(#=> c = (16+4j\))
keyword(print) ident(c)operator(.)ident(real)operator(,) ident(c)operator(.)ident(imag)operator(,) ident(c)operator(.)ident(conjugate)operator(()operator(\))
comment(#=> 16.0 4.0 (16-4j\))
comment(#-----------------------------)
-keyword(import) ident(cmath)
+keyword(import) include(cmath)
keyword(print) ident(cmath)operator(.)ident(sqrt)operator(()integer(3)operator(+)imaginary(4j)operator(\))
comment(#=> (2+1j\))
comment(#-----------------------------)
@@ -1064,7 +1064,7 @@ comment(#=> 12,345,678)
comment(# DON'T DO THIS. It works on 2.3+ only and is slower and less straightforward)
comment(# than the non-regex version above.)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(def) method(commify)operator(()ident(amount)operator(\))operator(:)
ident(amount) operator(=) predefined(str)operator(()ident(amount)operator(\))
ident(amount) operator(=) ident(amount)operator([)operator(:)operator(:)operator(-)integer(1)operator(])
@@ -1086,7 +1086,7 @@ keyword(print) string<delimiter(")content(%d %s %s enough.)delimiter(")> operato
ident(pluralise)operator(()ident(duration)operator(,) string<delimiter(')content(hour)delimiter(')>operator(\))operator(,)
ident(pluralise)operator(()ident(duration)operator(,) string<delimiter(')delimiter(')>operator(,) string<delimiter(')content(is)delimiter(')>operator(,) string<delimiter(')content(are)delimiter(')>operator(\))operator(\))
comment(#-----------------------------)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(def) method(noun_plural)operator(()ident(word)operator(\))operator(:)
ident(endings) operator(=) operator([)operator(()string<delimiter(")content(ss)delimiter(")>operator(,) string<delimiter(")content(sses)delimiter(")>operator(\))operator(,)
operator(()string<delimiter(")content(([psc]h\))delimiter(")>operator(,) string<modifier(r)delimiter(")content(\\1)content(es)delimiter(")>operator(\))operator(,)
@@ -1125,7 +1125,7 @@ comment(#)
comment(#% bigfact 25000000000000000000000000)
comment(#25000000000000000000000000 2**24 5**26)
comment(#-----------------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(def) method(factorise)operator(()ident(num)operator(\))operator(:)
ident(factors) operator(=) operator({)operator(})
@@ -1216,8 +1216,8 @@ comment(# datetime - a new library module for Python 2.3 and used for most of th
comment(# (I will use full names to show which module they are in, but you can also use)
comment(# from datetime import datetime, timedelta and so on for convenience\) )
-keyword(import) ident(time)
-keyword(import) ident(datetime)
+keyword(import) include(time)
+keyword(import) include(datetime)
keyword(print) string<delimiter(")content(Today is day)delimiter(")>operator(,) ident(time)operator(.)ident(localtime)operator(()operator(\))operator([)integer(7)operator(])operator(,) string<delimiter(")content(of the current year)delimiter(")>
comment(# Today is day 218 of the current year)
@@ -1400,7 +1400,7 @@ comment(# 174485.55702610247)
comment(#----------------------------- )
comment(# Also useful;)
-keyword(import) ident(timeit)
+keyword(import) include(timeit)
ident(code) operator(=) string<delimiter(')content([x for x in range(10\) if x % 2 == 0])delimiter(')>
predefined(eval)operator(()ident(code)operator(\))
comment(# [0, 2, 4, 6, 8])
@@ -1413,7 +1413,7 @@ comment(# 10,000 repeats of that code takes: 0.128238644856 seconds)
comment(# 1,000,000 repeats of that code takes: 12.5396490336 seconds)
comment(#----------------------------- )
-keyword(import) ident(timeit)
+keyword(import) include(timeit)
ident(code) operator(=) string<delimiter(')content(import random; l = random.sample(xrange(10000000\), 1000\); l.sort(\))delimiter(')>
ident(t) operator(=) ident(timeit)operator(.)ident(Timer)operator(()ident(code)operator(\))
@@ -1438,8 +1438,8 @@ comment(# and it will process the headers and show the time taken)
comment(# for each server hop (nb: if server times are wrong, negative dates)
comment(# might appear in the output\).)
-keyword(import) ident(datetime)operator(,) ident(email)operator(,) ident(email)operator(.)ident(Utils)
-keyword(import) ident(os)operator(,) ident(sys)operator(,) ident(time)
+keyword(import) include(datetime)operator(,) include(email)operator(,) include(email.Utils)
+keyword(import) include(os)operator(,) include(sys)operator(,) include(time)
keyword(def) method(extract_date)operator(()ident(hop)operator(\))operator(:)
comment(# According to RFC822, the date will be prefixed with)
@@ -1546,7 +1546,7 @@ ident(banner) operator(=) string<delimiter(")content(Speak, )delimiter(")> opera
ident(banner) operator(=) string<delimiter(")content(Speak, %s, and welcome!)delimiter(")> operator(%) ident(name)
comment(#-----------------------------)
ident(his_host) operator(=) string<delimiter(")content(www.python.org)delimiter(")>
-keyword(import) ident(os)
+keyword(import) include(os)
ident(host_info) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(nslookup )delimiter(")> operator(+) ident(his_host)operator(\))operator(.)ident(read)operator(()operator(\))
comment(# NOTE: not really relevant to Python (no magic '$$' variable\))
@@ -1716,7 +1716,7 @@ comment(#-----------------------------)
keyword(for) ident(user) keyword(in) ident(bad_users)operator(:)
ident(complain)operator(()ident(user)operator(\))
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(for) operator(()ident(key)operator(,) ident(val)operator(\)) keyword(in) predefined(sorted)operator(()ident(os)operator(.)ident(environ)operator(.)ident(items)operator(()operator(\))operator(\))operator(:)
keyword(print) string<delimiter(")content(%s=%s)delimiter(")> operator(%) operator(()ident(key)operator(,) ident(val)operator(\))
comment(#-----------------------------)
@@ -1725,7 +1725,7 @@ keyword(for) ident(user) keyword(in) ident(all_users)operator(:)
keyword(if) ident(disk_space) operator(>) ident(MAX_QUOTA)operator(:) comment(# if it's more than we want ...)
ident(complain)operator(()ident(user)operator(\)) comment(# ... then object vociferously)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(for) ident(line) keyword(in) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(who)delimiter(")>operator(\))operator(:)
keyword(if) string<delimiter(")content(dalke)delimiter(")> keyword(in) ident(line)operator(:)
keyword(print) ident(line)operator(,) comment(# or print line[:-1])
@@ -1822,13 +1822,13 @@ keyword(for) ident(item) keyword(in) ident(mylist)operator(:)
ident(seen)operator([)ident(item)operator(]) operator(=) ident(count) operator(+) integer(1)
comment(#-----------------------------)
comment(# generate a list of users logged in, removing duplicates)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(usernames) operator(=) operator([)ident(line)operator(.)ident(split)operator(()operator(\))operator([)integer(0)operator(]) keyword(for) ident(line) keyword(in) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(who)delimiter(")>operator(\))operator(])
ident(uniq) operator(=) predefined(sorted)operator(()predefined(set)operator(()ident(usernames)operator(\))operator(\))
keyword(print) string<delimiter(")content(users logged in:)delimiter(")>operator(,) string<delimiter(")content( )delimiter(")>operator(.)ident(join)operator(()ident(uniq)operator(\))
comment(# DON'T DO THIS:)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(ucnt) operator(=) operator({)operator(})
keyword(for) ident(line) keyword(in) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(who)delimiter(")>operator(\))operator(:)
ident(username) operator(=) ident(line)operator(.)ident(split)operator(()operator(\))operator([)integer(0)operator(]) comment(# Get the first word)
@@ -2120,7 +2120,7 @@ comment(#-----------------------------)
ident(bigs) operator(=) operator([)ident(num) keyword(for) ident(num) keyword(in) ident(nums) keyword(if) ident(num) operator(>) integer(1000000)operator(])
ident(pigs) operator(=) operator([)ident(user) keyword(for) operator(()ident(user)operator(,) ident(val)operator(\)) keyword(in) ident(users)operator(.)ident(items)operator(()operator(\)) keyword(if) ident(val) operator(>) float(1e7)operator(])
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(matching) operator(=) operator([)ident(line) keyword(for) ident(line) keyword(in) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(who)delimiter(")>operator(\))
keyword(if) ident(line)operator(.)ident(startswith)operator(()string<delimiter(")content(gnat )delimiter(")>operator(\))operator(])
comment(#-----------------------------)
@@ -2135,7 +2135,7 @@ comment(# @@PLEAC@@_4.14)
ident(sorted_list) operator(=) predefined(sorted)operator(()ident(unsorted_list)operator(\))
comment(#-----------------------------)
comment(# pids is an unsorted list of process IDs)
-keyword(import) ident(os)operator(,) ident(signal)operator(,) ident(time)
+keyword(import) include(os)operator(,) include(signal)operator(,) include(time)
keyword(for) ident(pid) keyword(in) predefined(sorted)operator(()ident(pids)operator(\))operator(:)
keyword(print) ident(pid)
@@ -2200,7 +2200,7 @@ ident(sorted_employees) operator(=) predefined(sorted)operator(()ident(employees
comment(#-----------------------------)
comment(# NOTE: Python should allow access to the pwd fields by name)
comment(# as well as by position.)
-keyword(import) ident(pwd)
+keyword(import) include(pwd)
comment(# fetch all users)
ident(users) operator(=) ident(pwd)operator(.)ident(getpwall)operator(()operator(\))
keyword(for) ident(user) keyword(in) predefined(sorted)operator(()ident(users)operator(,) ident(key)operator(=)keyword(lambda) ident(x)operator(:) ident(x)operator([)integer(0)operator(])operator(\))operator(:)
@@ -2232,13 +2232,13 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_4.16)
comment(#-----------------------------)
-keyword(import) ident(itertools)
+keyword(import) include(itertools)
keyword(for) ident(process) keyword(in) ident(itertools)operator(.)ident(cycle)operator(()operator([)integer(1)operator(,) integer(2)operator(,) integer(3)operator(,) integer(4)operator(,) integer(5)operator(])operator(\))operator(:)
keyword(print) string<delimiter(")content(Handling process)delimiter(")>operator(,) ident(process)
ident(time)operator(.)ident(sleep)operator(()integer(1)operator(\))
comment(# pre 2.3:)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(class) class(Circular)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:)
keyword(assert) predefined(len)operator(()ident(data)operator(\)) operator(>=) integer(1)operator(,) string<delimiter(")content(Cannot use an empty list)delimiter(")>
@@ -2257,7 +2257,7 @@ keyword(for) ident(process) keyword(in) ident(circular)operator(:)
comment(# DON'T DO THIS. All those pops and appends mean that the list needs to be )
comment(# constantly reallocated. This is rather bad if your list is large:)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(class) class(Circular)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:)
keyword(assert) predefined(len)operator(()ident(data)operator(\)) operator(>=) integer(1)operator(,) string<delimiter(")content(Cannot use an empty list)delimiter(")>
@@ -2278,13 +2278,13 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_4.17)
comment(#-----------------------------)
comment(# generate a random permutation of mylist in place)
-keyword(import) ident(random)
+keyword(import) include(random)
ident(random)operator(.)ident(shuffle)operator(()ident(mylist)operator(\))
comment(#-----------------------------)
comment(# @@PLEAC@@_4.18)
comment(#-----------------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(def) method(make_columns)operator(()ident(mylist)operator(,) ident(screen_width)operator(=)integer(78)operator(\))operator(:)
keyword(if) ident(mylist)operator(:)
@@ -2307,7 +2307,7 @@ keyword(for) ident(row) keyword(in) ident(make_columns)operator(()ident(sys)oper
comment(# A more literal translation)
-keyword(import) ident(sys)
+keyword(import) include(sys)
comment(# subroutine to check whether at last item on line)
keyword(def) method(EOL)operator(()ident(item)operator(\))operator(:)
@@ -2317,7 +2317,7 @@ comment(# Might not be portable to non-linux systems)
keyword(def) method(getwinsize)operator(()operator(\))operator(:)
comment(# Use the curses module if installed)
keyword(try)operator(:)
- keyword(import) ident(curses)
+ keyword(import) include(curses)
ident(stdscr) operator(=) ident(curses)operator(.)ident(initscr)operator(()operator(\))
ident(rows)operator(,) ident(cols) operator(=) ident(stdscr)operator(.)ident(getmaxyx)operator(()operator(\))
keyword(return) ident(cols)
@@ -2326,12 +2326,12 @@ keyword(def) method(getwinsize)operator(()operator(\))operator(:)
comment(# Nope, so deal with ioctl directly. What value for TIOCGWINSZ?)
keyword(try)operator(:)
- keyword(import) ident(termios)
+ keyword(import) include(termios)
ident(TIOCGWINSZ) operator(=) ident(termios)operator(.)ident(TIOCGWINSZ)
keyword(except) exception(ImportError)operator(:)
ident(TIOCGWINSZ) operator(=) hex(0x40087468) comment(# This is Linux specific)
- keyword(import) ident(struct)operator(,) ident(fcntl)
+ keyword(import) include(struct)operator(,) include(fcntl)
ident(s) operator(=) ident(struct)operator(.)ident(pack)operator(()string<delimiter(")content(HHHH)delimiter(")>operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(\))
keyword(try)operator(:)
ident(x) operator(=) ident(fcntl)operator(.)ident(ioctl)operator(()ident(sys)operator(.)ident(stdout)operator(.)ident(fileno)operator(()operator(\))operator(,) ident(TIOCGWINSZ)operator(,) ident(s)operator(\))
@@ -2394,7 +2394,7 @@ keyword(for) ident(permutation) keyword(in) ident(permute)operator(()predefined(
keyword(print) ident(permutation)
comment(#-----------------------------)
comment(# DON'T DO THIS)
-keyword(import) ident(fileinput)
+keyword(import) include(fileinput)
comment(# Slightly modified from)
comment(# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66463)
@@ -2424,8 +2424,8 @@ keyword(class) class(FactorialMemo)operator(()predefined(list)operator(\))operat
ident(factorial) operator(=) ident(FactorialMemo)operator(()operator(\))
-keyword(import) ident(sys)
-keyword(import) ident(time)
+keyword(import) include(sys)
+keyword(import) include(time)
ident(sys)operator(.)ident(setrecursionlimit)operator(()integer(10000)operator(\))
ident(start) operator(=) ident(time)operator(.)ident(time)operator(()operator(\))
@@ -2534,7 +2534,7 @@ comment(#=> Phantasm: Exists)
comment(#=> Relic:)
comment(#-----------------------------)
comment(# Get file sizes for the requested filenames)
-keyword(import) ident(fileinput)operator(,) ident(os)
+keyword(import) include(fileinput)operator(,) include(os)
ident(size) operator(=) operator({)operator(})
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
ident(filename) operator(=) ident(line)operator(.)ident(rstrip)operator(()operator(\))
@@ -2629,7 +2629,7 @@ comment(#-----------------------------)
comment(#!/usr/bin/env python)
comment(# countfrom - count number of messages from each sender)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\)) operator(>) integer(1)operator(:)
ident(infile) operator(=) predefined(open)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(\))
keyword(else)operator(:)
@@ -2656,7 +2656,7 @@ comment(#-----------------------------)
keyword(print) ident(mydict)
comment(#=> {'firstname': 'Andrew', 'login': 'dalke', 'state': 'New Mexico', 'lastname': 'Dalke'})
comment(#-----------------------------)
-keyword(import) ident(pprint)
+keyword(import) include(pprint)
ident(pprint)operator(.)ident(pprint)operator(()predefined(dict)operator(\))
comment(#=> {'firstname': 'Andrew',)
comment(#=> 'lastname': 'Dalke',)
@@ -2773,7 +2773,7 @@ keyword(if) ident(__name__)operator(==)string<delimiter(")content(__main__)delim
comment(# @@PLEAC@@_5.7)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(ttys) operator(=) operator({)operator(})
ident(who) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(who)delimiter(")>operator(\))
@@ -2785,7 +2785,7 @@ keyword(for) ident(line) keyword(in) ident(who)operator(:)
keyword(for) operator(()ident(user)operator(,) ident(tty_list)operator(\)) keyword(in) predefined(sorted)operator(()ident(ttys)operator(.)ident(items)operator(()operator(\))operator(\))operator(:)
keyword(print) ident(user) operator(+) string<delimiter(")content(: )delimiter(")> operator(+) string<delimiter(")content( )delimiter(")>operator(.)ident(join)operator(()ident(tty_list)operator(\))
comment(#-----------------------------)
-keyword(import) ident(pwd)
+keyword(import) include(pwd)
keyword(for) operator(()ident(user)operator(,) ident(tty_list)operator(\)) keyword(in) ident(ttys)operator(.)ident(items)operator(()operator(\))operator(:)
keyword(print) ident(user) operator(+) string<delimiter(")content(:)delimiter(")>operator(,) predefined(len)operator(()ident(tty_list)operator(\))operator(,) string<delimiter(")content(ttys.)delimiter(")>
keyword(for) ident(tty) keyword(in) predefined(sorted)operator(()ident(tty_list)operator(\))operator(:)
@@ -2809,7 +2809,7 @@ comment(#-----------------------------)
comment(#!/usr/bin/perl -w)
comment(# foodfind - find match for food or color)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(if) keyword(not) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(:)
keyword(raise) exception(SystemExit)operator(()string<delimiter(")content(usage: foodfind food_or_color)delimiter(")>operator(\))
ident(given) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])
@@ -2971,7 +2971,7 @@ keyword(for) ident(element) keyword(in) ident(mylist)operator(:)
comment(# @@PLEAC@@_5.15)
comment(#-----------------------------)
-keyword(import) ident(fileinput)
+keyword(import) include(fileinput)
ident(father) operator(=) operator({)string<delimiter(')content(Cain)delimiter(')>operator(:) string<delimiter(')content(Adam)delimiter(')>operator(,)
string<delimiter(')content(Abel)delimiter(')>operator(:) string<delimiter(')content(Adam)delimiter(')>operator(,)
@@ -2994,7 +2994,7 @@ keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)oper
keyword(print)
comment(#-----------------------------)
-keyword(import) ident(fileinput)
+keyword(import) include(fileinput)
ident(children) operator(=) operator({)operator(})
keyword(for) ident(k)operator(,) ident(v) keyword(in) ident(father)operator(.)ident(items)operator(()operator(\))operator(:)
@@ -3006,7 +3006,7 @@ keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)oper
keyword(print) ident(person)operator(,) string<delimiter(")content(begat)delimiter(")>operator(,) string<delimiter(")content(, )delimiter(")>operator(.)ident(join)operator(()ident(kids)operator(\))
comment(#-----------------------------)
-keyword(import) ident(sys)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(re)
ident(pattern) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(')content(^)content(\\s)content(*#)content(\\s)content(*include)content(\\s)content(*<([^>]+\))delimiter(')>operator(\))
ident(includes) operator(=) operator({)operator(})
keyword(for) ident(filename) keyword(in) ident(filenames)operator(:)
@@ -3032,7 +3032,7 @@ comment(# @@PLEAC@@_5.16)
comment(#-----------------------------)
comment(#!/usr/bin/env python -w)
comment(# dutree - print sorted indented rendition of du output)
-keyword(import) ident(os)operator(,) ident(sys)
+keyword(import) include(os)operator(,) include(sys)
keyword(def) method(get_input)operator(()ident(args)operator(\))operator(:)
comment(# NOTE: This is insecure - use only from trusted code!)
@@ -3094,7 +3094,7 @@ comment(# @@PLEAC@@_6.0)
comment(# Note: regexes are used less often in Python than in Perl as tasks are often)
comment(# covered by string methods, or specialised objects, modules, or packages.)
-keyword(import) ident(re) comment(# "re" is the regular expression module.)
+keyword(import) include(re) comment(# "re" is the regular expression module.)
ident(re)operator(.)ident(search)operator(()string<delimiter(")content(sheep)delimiter(")>operator(,)ident(meadow)operator(\)) comment(# returns a MatchObject is meadow contains "sheep".)
keyword(if) keyword(not) ident(re)operator(.)ident(search)operator(()string<delimiter(")content(sheep)delimiter(")>operator(,)ident(meadow)operator(\))operator(:)
keyword(print) string<delimiter(")content(no sheep on this meadow only a fat python.)delimiter(")>
@@ -3119,7 +3119,7 @@ ident(echo) ident(ababacaca) operator(|) ident(python) operator(-)ident(c) strin
comment(#-----------------------------)
comment(# pattern matching modifiers)
comment(# assume perl code iterates over some file)
-keyword(import) ident(re)operator(,) ident(fileinput)
+keyword(import) include(re)operator(,) include(fileinput)
keyword(for) ident(ln) operator(=) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
ident(fnd) operator(=) ident(re)operator(.)ident(findall)operator(()string<delimiter(")content(()content(\\d)content(+\))delimiter(")>operator(,)ident(ln)operator(\))
keyword(if) predefined(len)operator(()ident(fnd)operator(\)) operator(>) integer(0)operator(:)
@@ -3138,7 +3138,7 @@ comment(# (And \) (little lambs\) ( eat ivy\))
comment(# @@PLEAC@@_6.1)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(dst) operator(=) ident(re)operator(.)ident(sub)operator(()string<delimiter(")content(this)delimiter(")>operator(,)string<delimiter(")content(that)delimiter(")>operator(,)ident(src)operator(\))
comment(#-----------------------------)
comment(# strip to basename)
@@ -3167,15 +3167,15 @@ comment(##---------------------------)
comment(# DON'T DO THIS. use line[:-1].isalpha(\) [this probably goes for the)
comment(# remainder of this section too!])
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(if) ident(re)operator(.)ident(match)operator(()string<delimiter(")content(^[A-Za-z]+$)delimiter(")>operator(,)ident(line)operator(\))operator(:)
keyword(print) string<delimiter(")content(pure alphabetic)delimiter(")>
comment(##---------------------------)
keyword(if) ident(re)operator(.)ident(match)operator(()string<modifier(r)delimiter(")content(^[^)content(\\W)content(\\d)content(_]+$)delimiter(")>operator(,) ident(line)operator(,) ident(re)operator(.)ident(LOCALE)operator(\))operator(:)
keyword(print) string<delimiter(")content(pure alphabetic)delimiter(")>
comment(##---------------------------)
-keyword(import) ident(re)
-keyword(import) ident(locale)
+keyword(import) include(re)
+keyword(import) include(locale)
keyword(try)operator(:)
ident(locale)operator(.)ident(setlocale)operator(()ident(locale)operator(.)ident(LC_ALL)operator(,) string<delimiter(')content(fr_CA.ISO8859-1)delimiter(')>operator(\))
@@ -3225,9 +3225,9 @@ comment(#!/usr/bin/python)
comment(# resname - change all "foo.bar.com" style names in the input stream)
comment(# into "foo.bar.com [204.148.40.9]" (or whatever\) instead)
-keyword(import) ident(socket) comment(# load inet_addr)
-keyword(import) ident(fileinput)
-keyword(import) ident(re)
+keyword(import) include(socket) comment(# load inet_addr)
+keyword(import) include(fileinput)
+keyword(import) include(re)
ident(match) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(""")content((?P<hostname> # capture hostname)content(
)content( (?: # these parens for grouping only)content(
@@ -3270,7 +3270,7 @@ ident(re)operator(.)ident(sub)operator(()string<delimiter(""")content((?x\)
comment(##-----------------------------)
comment(# @@PLEAC@@_6.5)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(pond) operator(=) string<delimiter(")content(one fish two fish red fish blue fish)delimiter(")>
ident(fishes) operator(=) ident(re)operator(.)ident(findall)operator(()string<modifier(r)delimiter(")content((?i\)()content(\\w)content(+\))content(\\s)content(+fish)content(\\b)delimiter(")>operator(,)ident(pond)operator(\))
keyword(if) predefined(len)operator(()ident(fishes)operator(\))operator(>)integer(2)operator(:)
@@ -3302,7 +3302,7 @@ ident(color) operator(=) ident(re)operator(.)ident(findall)operator(()string<mod
keyword(print) string<delimiter(")content(The third fish in the pond is %s.)delimiter(")> operator(%) operator(()ident(color)operator(\))
comment(##-----------------------------)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(pond) operator(=) string<delimiter(")content(one fish two fish red fish blue fish)delimiter(")>
ident(matches) operator(=) ident(re)operator(.)ident(findall)operator(()string<modifier(r)delimiter(")content(()content(\\w)content(+\))content(\\s)content(+fish)content(\\b)delimiter(")>operator(,)ident(pond)operator(\))
@@ -3362,8 +3362,8 @@ comment(# Matching Multiple Lines)
comment(#)
comment(#!/usr/bin/python)
comment(# killtags - very bad html tag killer)
-keyword(import) ident(re)
-keyword(import) ident(sys)
+keyword(import) include(re)
+keyword(import) include(sys)
ident(text) operator(=) predefined(open)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(\))operator(.)ident(read)operator(()operator(\)) comment(# read the whole file)
ident(text) operator(=) ident(re)operator(.)ident(sub)operator(()string<delimiter(")content((?ms\)<.*?>)delimiter(")>operator(,)string<delimiter(")delimiter(")>operator(,)ident(text)operator(\)) comment(# strip tags (terrible)
@@ -3371,7 +3371,7 @@ keyword(print) ident(text)
comment(## ----------------------------)
comment(#!/usr/bin/python)
comment(# headerfy: change certain chapter headers to html)
-keyword(import) ident(sys)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(re)
ident(match) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(""")content((?xms\) # re.VERBOSE, re.MULTILINE, and re.DOTALL)content(
)content( )content(\\A)content( # start of the string)content(
@@ -3405,13 +3405,13 @@ keyword(for) ident(paragraph) keyword(in) predefined(open)operator(()ident(sys)o
comment(## ----------------------------)
comment(# @@PLEAC@@_6.7)
-keyword(import) ident(sys)
+keyword(import) include(sys)
comment(# Read the whole file and split)
ident(chunks) operator(=) predefined(open)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(\))operator(.)ident(read)operator(()operator(\))operator(.)ident(split)operator(()operator(\)) comment(# on whitespace)
ident(chunks) operator(=) predefined(open)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(\))operator(.)ident(read)operator(()operator(\))operator(.)ident(split)operator(()string<delimiter(")char(\\n)delimiter(")>operator(\)) comment(# on line ends)
comment(# splitting on pattern)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(pattern) operator(=) string<modifier(r)delimiter(")content(x)delimiter(")>
ident(chunks) operator(=) ident(re)operator(.)ident(split)operator(()ident(pattern)operator(,) predefined(open)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(\))operator(.)ident(read)operator(()operator(\))operator(\))
comment(##-----------------------------)
@@ -3449,7 +3449,7 @@ keyword(for) ident(i)operator(,) ident(line) keyword(in) predefined(enumerate)op
comment(# Using patterned ranges is slightly trickier -)
comment(# You need to search for the first pattern then)
comment(# search for the next pattern:)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(for) ident(line) keyword(in) ident(myfile)operator(:)
keyword(if) ident(re)operator(.)ident(match)operator(()ident(pat1)operator(,) ident(line)operator(\))operator(:)
keyword(break)
@@ -3523,8 +3523,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# popgrep1 - grep for abbreviations of places that say "pop")
comment(# version 1: slow but obvious way)
-keyword(import) ident(fileinput)
-keyword(import) ident(re)
+keyword(import) include(fileinput)
+keyword(import) include(re)
ident(popstates) operator(=) operator([)string<delimiter(")content(CO)delimiter(")>operator(,)string<delimiter(")content(ON)delimiter(")>operator(,)string<delimiter(")content(MI)delimiter(")>operator(,)string<delimiter(")content(WI)delimiter(")>operator(,)string<delimiter(")content(MN)delimiter(")>operator(])
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
keyword(for) ident(state) keyword(in) ident(popstates)operator(:)
@@ -3538,8 +3538,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# popgrep2 - grep for abbreviations of places that say "pop")
comment(# version 2: compile the patterns)
-keyword(import) ident(fileinput)
-keyword(import) ident(re)
+keyword(import) include(fileinput)
+keyword(import) include(re)
ident(popstates) operator(=) operator([)string<delimiter(")content(CO)delimiter(")>operator(,)string<delimiter(")content(ON)delimiter(")>operator(,)string<delimiter(")content(MI)delimiter(")>operator(,)string<delimiter(")content(WI)delimiter(")>operator(,)string<delimiter(")content(MN)delimiter(")>operator(])
ident(state_re) operator(=) operator([)operator(])
keyword(for) ident(state) keyword(in) ident(popstates)operator(:)
@@ -3555,8 +3555,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# popgrep3 - grep for abbreviations of places that say "pop")
comment(# version 3: compile a single pattern)
-keyword(import) ident(fileinput)
-keyword(import) ident(re)
+keyword(import) include(fileinput)
+keyword(import) include(re)
ident(popstates) operator(=) operator([)string<delimiter(")content(CO)delimiter(")>operator(,)string<delimiter(")content(ON)delimiter(")>operator(,)string<delimiter(")content(MI)delimiter(")>operator(,)string<delimiter(")content(WI)delimiter(")>operator(,)string<delimiter(")content(MN)delimiter(")>operator(])
ident(state_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(\\b)content((?:)delimiter(")>operator(+)string<delimiter(")content(|)delimiter(")>operator(.)ident(join)operator(()ident(popstates)operator(\))operator(+)string<modifier(r)delimiter(")content(\))content(\\b)delimiter(")>operator(\))
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
@@ -3568,8 +3568,8 @@ comment(#-----------------------------)
comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# grepauth - print lines that mention both Tom and Nat)
-keyword(import) ident(fileinput)
-keyword(import) ident(re)
+keyword(import) include(fileinput)
+keyword(import) include(re)
keyword(def) method(build_match_any)operator(()ident(words)operator(\))operator(:)
keyword(return) ident(re)operator(.)ident(compile)operator(()string<delimiter(")content(|)delimiter(")>operator(.)ident(join)operator(()ident(words)operator(\))operator(\))
@@ -3599,7 +3599,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_6.11)
comment(# Testing for a Valid Pattern)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(while) pre_constant(True)operator(:)
ident(pat) operator(=) predefined(raw_input)operator(()string<delimiter(")content(Pattern? )delimiter(")>operator(\))
keyword(try)operator(:)
@@ -3626,7 +3626,7 @@ comment(#)
comment(# differs from perl version in parano.)
comment(# python version displays paragraph in current file.)
-keyword(import) ident(sys)operator(,) ident(os)operator(.)ident(path)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(os.path)operator(,) include(re)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(<=)integer(1)operator(:)
keyword(print) string<delimiter(")content(usage: %s pat [files])char(\\n)delimiter(")> operator(%) ident(sys)operator(.)ident(argv)operator([)integer(0)operator(])
ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\))
@@ -3664,9 +3664,9 @@ comment(#)
comment(# re must be told to respect locale either in the regexp)
comment(# "(?L\)" or as flag to the call (python 2.4\) "re.LOCALE".)
-keyword(import) ident(sys)
-keyword(import) ident(re)operator(,) ident(string)
-keyword(from) ident(locale) keyword(import) ident(LC_CTYPE)operator(,) ident(setlocale)operator(,) ident(getlocale)
+keyword(import) include(sys)
+keyword(import) include(re)operator(,) include(string)
+keyword(from) include(locale) keyword(import) include(LC_CTYPE)operator(,) include(setlocale)operator(,) include(getlocale)
ident(name) operator(=) string<delimiter(")content(andreas k)char(\\xF6)content(nig)delimiter(")>
ident(locale) operator(=) operator({)string<delimiter(")content(German)delimiter(")> operator(:) string<delimiter(")content(de_DE.ISO_8859-1)delimiter(")>operator(,) string<delimiter(")content(English)delimiter(")> operator(:) string<delimiter(")content(en_US)delimiter(")>operator(})
@@ -3695,7 +3695,7 @@ keyword(print) string<delimiter(")content(German names: %s)delimiter(")> operato
comment(# @@PLEAC@@_6.13)
comment(##-----------------------------)
-keyword(import) ident(difflib)
+keyword(import) include(difflib)
ident(matchlist) operator(=) operator([)string<delimiter(")content(ape)delimiter(")>operator(,) string<delimiter(")content(apple)delimiter(")>operator(,) string<delimiter(")content(lapel)delimiter(")>operator(,) string<delimiter(")content(peach)delimiter(")>operator(,) string<delimiter(")content(puppy)delimiter(")>operator(])
keyword(print) ident(difflib)operator(.)ident(get_close_matches)operator(()string<delimiter(")content(appel)delimiter(")>operator(,) ident(matchlist)operator(\))
comment(#=> ['lapel', 'apple', 'ape'])
@@ -3773,7 +3773,7 @@ keyword(for) ident(curr)operator(,) predefined(next) keyword(in) predefined(zip)
keyword(print) string<delimiter(")content(Duplicate word '%s' found.)delimiter(")> operator(%) ident(curr)
comment(# DON'T DO THIS)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(pat) operator(=) string<modifier(r)delimiter(""")content(
)content( )content(\\b)content( # start at a word boundary (begin letters\))content(
)content( ()content(\\S)content(+\) # find chunk of non-whitespace)content(
@@ -3838,7 +3838,7 @@ keyword(if) ident(re)operator(.)ident(match)operator(()ident(pat1)operator(,) id
comment(##-----------------------------)
comment(# DON'T DO THIS.)
string<delimiter(""")content(minigrep - trivial grep)delimiter(""")>
-keyword(import) ident(sys)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(re)
ident(pat) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])
keyword(for) ident(line) keyword(in) ident(sys)operator(.)ident(stdin)operator(:)
@@ -3914,7 +3914,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_6.19)
comment(##-----------------------------)
-keyword(from) ident(email)operator(.)ident(_parseaddr) keyword(import) ident(AddressList)
+keyword(from) include(email._parseaddr) keyword(import) include(AddressList)
keyword(print) ident(AddressList)operator(()string<delimiter(")content(fred&barney@stonehenge.com)delimiter(")>operator(\))operator(.)ident(addresslist)operator([)integer(0)operator(])
@@ -3939,14 +3939,14 @@ keyword(print) string<delimiter(")content(Action is %s.)delimiter(")>operator(%)
comment(#=> Action is list.)
comment(##-----------------------------)
comment(#DON'T DO THIS:)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(answer) operator(=) string<delimiter(")content(ab)delimiter(")>
ident(answer) operator(=) ident(re)operator(.)ident(escape)operator(()ident(answer)operator(.)ident(strip)operator(()operator(\))operator(\))
keyword(for) ident(action) keyword(in) operator(()string<delimiter(")content(SEND)delimiter(")>operator(,) string<delimiter(")content(STOP)delimiter(")>operator(,) string<delimiter(")content(ABORT)delimiter(")>operator(,) string<delimiter(")content(LIST)delimiter(")>operator(,) string<delimiter(")content(EDIT)delimiter(")>operator(\))operator(:)
keyword(if) ident(re)operator(.)ident(match)operator(()ident(answer)operator(,) ident(action)operator(,) ident(flags)operator(=)ident(re)operator(.)ident(IGNORECASE)operator(\))operator(:)
keyword(print) string<delimiter(")content(Action is %s.)delimiter(")>operator(%)ident(action)operator(.)ident(lower)operator(()operator(\))
comment(##-----------------------------)
-keyword(import) ident(re)operator(,) ident(sys)
+keyword(import) include(re)operator(,) include(sys)
keyword(def) method(handle_cmd)operator(()ident(cmd)operator(\))operator(:)
ident(cmd) operator(=) ident(re)operator(.)ident(escape)operator(()ident(cmd)operator(.)ident(strip)operator(()operator(\))operator(\))
keyword(for) ident(name)operator(,) ident(action) keyword(in) operator({)string<delimiter(")content(edit)delimiter(")>operator(:) ident(invoke_editor)operator(,)
@@ -3964,7 +3964,7 @@ ident(handle_cmd)operator(()string<delimiter(")content(ab)delimiter(")>operator(
comment(# @@PLEAC@@_6.21)
comment(##-----------------------------)
comment(# urlify - wrap HTML links around URL-like constructs)
-keyword(import) ident(re)operator(,) ident(sys)operator(,) ident(fileinput)
+keyword(import) include(re)operator(,) include(sys)operator(,) include(fileinput)
keyword(def) method(urlify_string)operator(()ident(s)operator(\))operator(:)
ident(urls) operator(=) string<modifier(r)delimiter(')content((http|telnet|gopher|file|wais|ftp\))delimiter(')>
@@ -4051,7 +4051,7 @@ comment(# Alternatively for file operations use os.path, shutil, etc.)
comment(# DON'T DO THIS)
keyword(print) ident(re)operator(.)ident(sub)operator(()string<delimiter(")content(/usr/bin)delimiter(")>operator(,) string<delimiter(")content(/usr/local/bin)delimiter(")>operator(,) ident(txt)operator(\))
comment(##-----------------------------)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(def) method(unescape_hex)operator(()ident(matchobj)operator(\))operator(:)
keyword(return) predefined(chr)operator(()predefined(int)operator(()ident(matchobj)operator(.)ident(groups)operator(()integer(0)operator(\))operator([)integer(0)operator(])operator(,) integer(16)operator(\))operator(\))
@@ -4083,7 +4083,7 @@ ident(txt) operator(=) ident(re)operator(.)ident(sub)operator(()string<delimiter
comment(##-----------------------------)
ident(txt) operator(=) ident(re)operator(.)ident(sub)operator(()string<delimiter(")content(^.*::)delimiter(")>operator(,) string<delimiter(")delimiter(")>operator(\))
comment(##-----------------------------)
-keyword(import) ident(socket)
+keyword(import) include(socket)
ident(socket)operator(.)ident(inet_aton)operator(()ident(txt)operator(\)) comment(# Will raise an error if incorrect)
comment(# DON'T DO THIS.)
@@ -4103,7 +4103,7 @@ ident(fname) operator(=) ident(os)operator(.)ident(path)operator(.)ident(basenam
comment(# DON'T DO THIS.)
ident(fname) operator(=) ident(re)operator(.)ident(sub)operator(()string<delimiter(")content(^.*/)delimiter(")>operator(,) string<delimiter(")delimiter(")>operator(,) ident(path)operator(\))
comment(##-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(try)operator(:)
ident(tc) operator(=) ident(os)operator(.)ident(environ)operator([)string<delimiter(")content(TERMCAP)delimiter(")>operator(])
keyword(except) exception(KeyError)operator(:)
@@ -4174,7 +4174,7 @@ ident(txt) operator(=) ident(re)operator(.)ident(sub)operator(()string<delimiter
comment(##-----------------------------)
ident(sentences) operator(=) operator([)ident(elem)operator([)integer(0)operator(]) keyword(for) ident(elem) keyword(in) ident(re)operator(.)ident(findall)operator(()string<modifier(r)delimiter(")content((.*?[!?.]\)( |)content(\\Z)content(\))delimiter(")>operator(,) ident(s)operator(\))operator(])
comment(##-----------------------------)
-keyword(import) ident(time)
+keyword(import) include(time)
ident(dt) operator(=) ident(time)operator(.)ident(strptime)operator(()ident(txt)operator(,) string<delimiter(")content(%Y-%m-%d)delimiter(")>operator(\))
comment(# DON'T DO THIS.)
@@ -4212,7 +4212,7 @@ keyword(for) ident(line) keyword(in) predefined(open)operator(()string<delimiter
keyword(if) ident(blue) keyword(in) ident(line)operator(:)
keyword(print) ident(line)operator([)operator(:)operator(-)integer(1)operator(])
comment(#---------)
-keyword(import) ident(sys)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(re)
ident(pattern) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(\\d)delimiter(")>operator(\))
keyword(for) ident(line) keyword(in) ident(sys)operator(.)ident(stdin)operator(:)
keyword(if) keyword(not) ident(pattern)operator(.)ident(search)operator(()ident(line)operator(\))operator(:)
@@ -4228,7 +4228,7 @@ keyword(print)operator(>>)ident(logfile)operator(,) string<delimiter(")content(C
keyword(print) string<delimiter(")content(You have 30 seconds to reach minimum safety distance.)delimiter(")>
comment(# DONT DO THIS)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(old_output)operator(,) ident(sys)operator(.)ident(stdout) operator(=) ident(sys)operator(.)ident(stdout)operator(,) ident(logfile)
keyword(print) string<delimiter(")content(Countdown initiated ...)delimiter(")>
ident(sys)operator(.)ident(stdout) operator(=) ident(old_output)
@@ -4246,7 +4246,7 @@ comment(# commands, so their inclusion here is just silly. If )
comment(# os.fdopen(os.open(...\)\) were needed often, it would be turned)
comment(# into its own function. Instead, I'll use 'fd' to hint that)
comment(# os.open returns a file descriptor)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(source_fd) operator(=) ident(os)operator(.)ident(open)operator(()ident(path)operator(,) ident(os)operator(.)ident(O_RDONLY)operator(\))
ident(source) operator(=) ident(os)operator(.)ident(fdopen)operator(()ident(fd)operator(\))
ident(sink_fd) operator(=) ident(os)operator(.)ident(open)operator(()ident(path)operator(,) ident(os)operator(.)ident(O_WRONLY)operator(\))
@@ -4289,7 +4289,7 @@ comment(# @@PLEAC@@_7.2)
comment(# Nothing different needs to be done with Python)
comment(# @@PLEAC@@_7.3)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(filename) operator(=) ident(os)operator(.)ident(path)operator(.)ident(expanduser)operator(()ident(filename)operator(\))
comment(# @@PLEAC@@_7.4)
@@ -4302,14 +4302,14 @@ keyword(except) exception(IOError)operator(,) ident(err)operator(:)
operator(()ident(filename)operator(,) ident(err)operator(.)ident(strerror)operator(\))operator(\))
comment(# @@PLEAC@@_7.5)
-keyword(import) ident(tempfile)
+keyword(import) include(tempfile)
ident(myfile) operator(=) ident(tempfile)operator(.)ident(TemporaryFile)operator(()operator(\))
comment(#-----------------------------)
comment(# NOTE: The TemporaryFile(\) call is much more appropriate)
comment(# I would not suggest using this code for real work.)
-keyword(import) ident(os)operator(,) ident(tempfile)
+keyword(import) include(os)operator(,) include(tempfile)
keyword(while) pre_constant(True)operator(:)
ident(name) operator(=) ident(os)operator(.)ident(tmpnam)operator(()operator(\))
@@ -4322,7 +4322,7 @@ ident(myfile) operator(=) ident(tempfile)operator(.)ident(TemporaryFileWrapper)o
comment(# now go on to use the file ...)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(while) pre_constant(True)operator(:)
ident(tmpname) operator(=) ident(os)operator(.)ident(tmpnam)operator(()operator(\))
ident(fd) operator(=) ident(os)operator(.)ident(open)operator(()ident(tmpnam)operator(,) ident(os)operator(.)ident(O_RDWR) operator(|) ident(os)operator(.)ident(O_CREAT) operator(|) ident(os)operator(.)ident(O_EXCL)operator(\))
@@ -4333,7 +4333,7 @@ keyword(while) pre_constant(True)operator(:)
ident(os)operator(.)ident(remove)operator(()ident(tmpnam)operator(\))
comment(#-----------------------------)
-keyword(import) ident(tempfile)
+keyword(import) include(tempfile)
ident(myfile) operator(=) ident(tempfile)operator(.)ident(TemporaryFile)operator(()ident(bufsize) operator(=) integer(0)operator(\))
keyword(for) ident(i) keyword(in) predefined(range)operator(()integer(10)operator(\))operator(:)
@@ -4355,12 +4355,12 @@ keyword(for) ident(line) keyword(in) ident(sys)operator(.)ident(stdin)operator(:
keyword(pass) comment(# do something with the line)
comment(# processing a list of files from commandline)
-keyword(import) ident(fileinput)
+keyword(import) include(fileinput)
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
ident(do) ident(something) keyword(with) ident(the) ident(line)
comment(#-----------------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(def) method(do_with)operator(()ident(myfile)operator(\))operator(:)
keyword(for) ident(line) keyword(in) ident(myfile)operator(:)
@@ -4378,12 +4378,12 @@ keyword(else)operator(:)
ident(do_with)operator(()ident(sys)operator(.)ident(stdin)operator(\))
comment(#-----------------------------)
-keyword(import) ident(sys)operator(,) ident(glob)
+keyword(import) include(sys)operator(,) include(glob)
ident(ARGV) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(]) keyword(or) ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*.[Cch])delimiter(")>operator(\))
comment(#-----------------------------)
comment(# NOTE: the getopt module is the prefered mechanism for reading)
comment(# command line arguments)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(args) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])
ident(chop_first) operator(=) integer(0)
@@ -4396,7 +4396,7 @@ comment(# arg demo 2: Process optional -NUMBER flag)
comment(# NOTE: You just wouldn't process things this way for Python,)
comment(# but I'm trying to preserve the same semantics.)
-keyword(import) ident(sys)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(re)
ident(digit_pattern) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(-()content(\\d)content(+\)$)delimiter(")>operator(\))
ident(args) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])
@@ -4421,7 +4421,7 @@ keyword(for) ident(i) keyword(in) predefined(range)operator(()predefined(len)ope
comment(# arg demo 3: Process clustering -a, -i, -n, or -u flags)
-keyword(import) ident(sys)operator(,) ident(getopt)
+keyword(import) include(sys)operator(,) include(getopt)
keyword(try)operator(:)
ident(args)operator(,) ident(filenames) operator(=) ident(getopt)operator(.)ident(getopt)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(,) string<delimiter(")content(ainu)delimiter(")>operator(\))
keyword(except) ident(getopt)operator(.)ident(error)operator(:)
@@ -4438,7 +4438,7 @@ keyword(for) ident(k)operator(,) ident(v) keyword(in) ident(args)operator(:)
comment(#-----------------------------)
comment(# Note: Idiomatic Perl get translated to idiomatic Python)
-keyword(import) ident(fileinput)
+keyword(import) include(fileinput)
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
ident(sys)operator(.)ident(stdout)operator(.)ident(write)operator(()string<delimiter(")content(%s:%s:%s)delimiter(")> operator(%)
operator(()ident(fileinput)operator(.)ident(filename)operator(()operator(\))operator(,) ident(fileinput)operator(.)ident(filelineno)operator(()operator(\))operator(,) ident(line)operator(\))operator(\))
@@ -4477,7 +4477,7 @@ keyword(print) string<delimiter(")content(Found)delimiter(")>operator(,) ident(c
comment(# @@PLEAC@@_7.8)
-keyword(import) ident(shutil)
+keyword(import) include(shutil)
ident(old) operator(=) predefined(open)operator(()string<delimiter(")content(old)delimiter(")>operator(\))
ident(new) operator(=) predefined(open)operator(()string<delimiter(")content(new)delimiter(")>operator(,)string<delimiter(")content(w)delimiter(")>operator(\))
@@ -4508,14 +4508,14 @@ keyword(for) ident(i)operator(,) ident(line) keyword(in) predefined(enumerate)op
comment(# @@PLEAC@@_7.9)
comment(# modifying with "-i" commandline switch is a perl feature)
comment(# python has fileinput)
-keyword(import) ident(fileinput)operator(,) ident(sys)operator(,) ident(time)
+keyword(import) include(fileinput)operator(,) include(sys)operator(,) include(time)
ident(today) operator(=) ident(time)operator(.)ident(strftime)operator(()string<delimiter(")content(%Y-%m-%d)delimiter(")>operator(,)ident(time)operator(.)ident(localtime)operator(()operator(\))operator(\))
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()ident(inplace)operator(=)integer(1)operator(,) ident(backup)operator(=)string<delimiter(")content(.orig)delimiter(")>operator(\))operator(:)
ident(sys)operator(.)ident(stdout)operator(.)ident(write)operator(()ident(line)operator(.)ident(replace)operator(()string<delimiter(")content(DATE)delimiter(")>operator(,)ident(today)operator(\))operator(\))
comment(# set up to iterate over the *.c files in the current directory,)
comment(# editing in place and saving the old file with a .orig extension.)
-keyword(import) ident(glob)operator(,) ident(re)
+keyword(import) include(glob)operator(,) include(re)
ident(match) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(")content((?<=[pP]\)earl)delimiter(")>operator(\))
ident(files) operator(=) ident(fileinput)operator(.)ident(FileInput)operator(()ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*.c)delimiter(")>operator(\))operator(,) ident(inplace)operator(=)integer(1)operator(,) ident(backup)operator(=)string<delimiter(")content(.orig)delimiter(")>operator(\))
keyword(while) pre_constant(True)operator(:)
@@ -4548,7 +4548,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_7.11)
-keyword(import) ident(fcntl)
+keyword(import) include(fcntl)
ident(myfile) operator(=) predefined(open)operator(()ident(somepath)operator(,) string<delimiter(')content(r+)delimiter(')>operator(\))
ident(fcntl)operator(.)ident(flock)operator(()ident(myfile)operator(,) ident(fcntl)operator(.)ident(LOCK_EX)operator(\))
comment(# update file, then...)
@@ -4559,7 +4559,7 @@ ident(fcntl)operator(.)ident(LOCK_EX)
ident(fcntl)operator(.)ident(LOCK_NB)
ident(fcntl)operator(.)ident(LOCK_UN)
comment(#-----------------------------)
-keyword(import) ident(warnings)
+keyword(import) include(warnings)
keyword(try)operator(:)
ident(fcntl)operator(.)ident(flock)operator(()ident(myfile)operator(,) ident(fcntl)operator(.)ident(LOCK_EX)operator(|)ident(fcntl)operator(.)ident(LOCK_NB)operator(\))
keyword(except) exception(IOError)operator(:)
@@ -4589,11 +4589,11 @@ ident(myfile) operator(=) predefined(open)operator(()ident(filename)operator(,)
ident(myfile)operator(.)ident(flush)operator(()operator(\)) comment(# Flush the I/O buffer)
comment(# stdout is treated as a file. If you ever need to flush it, do so:)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(sys)operator(.)ident(stdout)operator(.)ident(flush)operator(()operator(\))
comment(# DON'T DO THIS. Use urllib, etc.)
-keyword(import) ident(socket)
+keyword(import) include(socket)
ident(mysock) operator(=) ident(socket)operator(.)ident(socket)operator(()operator(\))
ident(mysock)operator(.)ident(connect)operator(()operator(()string<delimiter(')content(www.perl.com)delimiter(')>operator(,) integer(80)operator(\))operator(\))
comment(# mysock.setblocking(True\))
@@ -4604,7 +4604,7 @@ keyword(for) ident(line) keyword(in) ident(f)operator(:)
keyword(print) ident(line)operator([)operator(:)operator(-)integer(1)operator(])
comment(# @@PLEAC@@_7.13)
-keyword(import) ident(select)
+keyword(import) include(select)
keyword(while) pre_constant(True)operator(:)
ident(rlist)operator(,) ident(wlist)operator(,) ident(xlist) operator(=) ident(select)operator(.)ident(select)operator(()operator([)ident(file1)operator(,) ident(file2)operator(,) ident(file3)operator(])operator(,) operator([)operator(])operator(,) operator([)operator(])operator(,) integer(0)operator(\))
keyword(for) ident(r) keyword(in) ident(rlist)operator(:)
@@ -4636,12 +4636,12 @@ keyword(for) ident(myfile) keyword(in) ident(files)operator(:)
keyword(print)operator(>>)ident(myfile)operator(,) ident(stuff_to_print)
comment(# NOTE: This is unix specific)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(file) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(tee file1 file2 file3 >/dev/null)delimiter(")>operator(,) string<delimiter(")content(w)delimiter(")>operator(\))
keyword(print)operator(>>)ident(myfile)operator(,) string<delimiter(")content(whatever)delimiter(")>
comment(# NOTE: the "make STDOUT go to three files" is bad programming style)
-keyword(import) ident(os)operator(,) ident(sys)
+keyword(import) include(os)operator(,) include(sys)
ident(sys)operator(.)ident(stdout)operator(.)ident(file) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(tee file1 file2 file3)delimiter(")>operator(,) string<delimiter(")content(w)delimiter(")>operator(\))
keyword(print) string<delimiter(")content(whatever)delimiter(")>
ident(sys)operator(.)ident(stdout)operator(.)ident(close)operator(()operator(\))
@@ -4669,7 +4669,7 @@ keyword(print)operator(>>)ident(fd)operator(,) string<delimiter(")content(Testin
ident(fd)operator(.)ident(close)operator(()operator(\))
comment(# @@PLEAC@@_7.19)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(myfile) operator(=) ident(os)operator(.)ident(fdopen)operator(()ident(fdnum)operator(\)) comment(# open the descriptor itself)
ident(myfile) operator(=) ident(os)operator(.)ident(fdopen)operator(()ident(os)operator(.)ident(dup)operator(()ident(fdnum)operator(\))operator(\)) comment(# open to a copy of the descriptor)
@@ -4684,7 +4684,7 @@ ident(alias)operator(.)ident(close)operator(()operator(\))
keyword(print) ident(original)operator(.)ident(closed)
comment(#=>True)
-keyword(import) ident(copy)
+keyword(import) include(copy)
ident(original) operator(=) predefined(open)operator(()string<delimiter(")content(C:/test.txt)delimiter(")>operator(\))
ident(dupe) operator(=) ident(copy)operator(.)ident(copy)operator(()ident(original)operator(\))
@@ -4693,7 +4693,7 @@ keyword(print) ident(original)operator(.)ident(closed)
comment(#=>False)
comment(# DON'T DO THIS.)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(oldstderr) operator(=) ident(sys)operator(.)ident(stderr)
ident(oldstdout) operator(=) ident(sys)operator(.)ident(stdout)
@@ -4713,12 +4713,12 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_7.22)
comment(# On Windows:)
-keyword(import) ident(msvcrt)
+keyword(import) include(msvcrt)
ident(myfile)operator(.)ident(seek)operator(()integer(5)operator(,) integer(0)operator(\))
ident(msvcrt)operator(.)ident(locking)operator(()ident(myfile)operator(.)ident(fileno)operator(()operator(\))operator(,) ident(msvcrt)operator(.)ident(LK_NBLCK)operator(,) integer(3)operator(\))
comment(# On Unix:)
-keyword(import) ident(fcntl)
+keyword(import) include(fcntl)
ident(fcntl)operator(.)ident(lockf)operator(()ident(myfile)operator(.)ident(fileno)operator(()operator(\))operator(,) ident(fcntl)operator(.)ident(LOCK_EX) operator(|) ident(fcntl)operator(.)ident(LOCK_NB)operator(,) integer(3)operator(,) integer(5)operator(\))
@@ -4785,7 +4785,7 @@ keyword(for) ident(line) keyword(in) ident(ContReader)operator(()ident(datafile)
keyword(pass) comment(# process full record in 'line' here)
comment(# ^^PLEAC^^_8.2)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(count) operator(=) predefined(int)operator(()ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(wc -l < )delimiter(")> operator(+) ident(filename)operator(\))operator(.)ident(read)operator(()operator(\))operator(\))
comment(#-----------------------------)
keyword(for) ident(count)operator(,) ident(line) keyword(in) predefined(enumerate)operator(()predefined(open)operator(()ident(filename)operator(\))operator(\))operator(:)
@@ -4815,7 +4815,7 @@ keyword(for) ident(line)operator(,) ident(count) keyword(in) predefined(zip)oper
keyword(pass)
comment(# 'count' now holds the number of lines read)
comment(#-----------------------------)
-keyword(import) ident(fileinput)
+keyword(import) include(fileinput)
ident(fi) operator(=) ident(fileinput)operator(.)ident(FileInput)operator(()ident(filename)operator(\))
keyword(while) ident(fi)operator(.)ident(readline)operator(()operator(\))operator(:) keyword(pass)
@@ -4873,7 +4873,7 @@ keyword(for) ident(line) keyword(in) ident(sys)operator(.)ident(stdin)operator(:
comment(#-----------------------------)
comment(# Make a word frequency count)
-keyword(import) ident(fileinput)operator(,) ident(re)
+keyword(import) include(fileinput)operator(,) include(re)
ident(pat) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(()content(\\w)content([)content(\\w)content('-]*\))delimiter(")>operator(\))
ident(seen) operator(=) operator({)operator(})
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
@@ -4892,7 +4892,7 @@ keyword(for) ident(text)operator(,) ident(count) keyword(in) predefined(sorted)o
comment(#-----------------------------)
comment(# Line frequency count)
-keyword(import) ident(fileinput)operator(,) ident(sys)
+keyword(import) include(fileinput)operator(,) include(sys)
ident(seen) operator(=) operator({)operator(})
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
ident(text) operator(=) ident(line)operator(.)ident(lower)operator(()operator(\))
@@ -4924,14 +4924,14 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_8.5)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(while) pre_constant(True)operator(:)
keyword(for) ident(line) keyword(in) ident(infile)operator(:)
keyword(pass) comment(# do something with the line)
ident(time)operator(.)ident(sleep)operator(()ident(SOMETIME)operator(\))
ident(infile)operator(.)ident(seek)operator(()integer(0)operator(,) integer(1)operator(\))
comment(#-----------------------------)
-keyword(import) ident(time)
+keyword(import) include(time)
ident(naptime) operator(=) integer(1)
ident(logfile) operator(=) predefined(open)operator(()string<delimiter(")content(/tmp/logfile)delimiter(")>operator(\))
@@ -4951,14 +4951,14 @@ keyword(while) pre_constant(True)operator(:)
ident(sleep)operator(()ident(naptime)operator(\))
ident(logfile)operator(.)ident(seek)operator(()ident(curpos)operator(,) integer(0)operator(\)) comment(# seek to where we had been)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(if) ident(os)operator(.)ident(stat)operator(()ident(LOGFILENAME)operator(\))operator(.)ident(st_nlink) operator(==) integer(0)operator(:)
keyword(raise) exception(SystemExit)
comment(#-----------------------------)
comment(# ^^PLEAC^^_8.6)
-keyword(import) ident(random)operator(,) ident(fileinput)
+keyword(import) include(random)operator(,) include(fileinput)
ident(text) operator(=) pre_constant(None)
keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)operator(()operator(\))operator(:)
keyword(if) ident(random)operator(.)ident(randrange)operator(()ident(fileinput)operator(.)ident(lineno)operator(()operator(\))operator(\)) operator(==) integer(0)operator(:)
@@ -4966,7 +4966,7 @@ keyword(for) ident(line) keyword(in) ident(fileinput)operator(.)ident(input)oper
comment(# 'text' is the random line)
comment(#-----------------------------)
comment(# XXX is the perl code correct? Where is the fortunes file opened?)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(adage) operator(=) pre_constant(None)
keyword(for) ident(i)operator(,) ident(rec) keyword(in) predefined(enumerate)operator(()ident(SepReader)operator(()predefined(open)operator(()string<delimiter(")content(/usr/share/games/fortunes)delimiter(")>operator(\))operator(,) string<delimiter(")content(%)char(\\n)delimiter(")>operator(\))operator(\))operator(:)
keyword(if) ident(random)operator(.)ident(randrange)operator(()ident(i)operator(+)integer(1)operator(\)) operator(==) integer(0)operator(:)
@@ -4976,7 +4976,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_8.7)
-keyword(import) ident(random)
+keyword(import) include(random)
ident(lines) operator(=) ident(data)operator(.)ident(readlines)operator(()operator(\))
ident(random)operator(.)ident(shuffle)operator(()ident(lines)operator(\))
keyword(for) ident(line) keyword(in) ident(lines)operator(:)
@@ -4987,7 +4987,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_8.8)
comment(# using efficient caching system)
-keyword(import) ident(linecache)
+keyword(import) include(linecache)
ident(linecache)operator(.)ident(getline)operator(()ident(filename)operator(,) ident(DESIRED_LINE_NUMBER)operator(\))
comment(# or doing it more oldskool)
@@ -5081,7 +5081,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_8.13)
-keyword(import) ident(posixfile)
+keyword(import) include(posixfile)
ident(address) operator(=) ident(recsize) operator(*) ident(recno)
ident(myfile)operator(.)ident(seek)operator(()ident(address)operator(\))
ident(buffer) operator(=) ident(myfile)operator(.)ident(read)operator(()ident(recsize)operator(\))
@@ -5127,7 +5127,7 @@ comment(# bgets - get a string from an address in a binary file)
comment(#-----------------------------)
comment(#!/usr/bin/perl)
comment(# strings - pull strings out of a binary file)
-keyword(import) ident(re)operator(,) ident(sys)
+keyword(import) include(re)operator(,) include(sys)
comment(## Assumes SepReader from above)
@@ -5149,7 +5149,7 @@ comment(# RECORDSIZE is the length of a record, in bytes.)
comment(# TEMPLATE is the unpack template for the record)
comment(# FILE is the file to read from)
comment(# FIELDS is a tuple, one element per field)
-keyword(import) ident(struct)
+keyword(import) include(struct)
ident(RECORDSIZE)operator(=) ident(struct)operator(.)ident(calcsize)operator(()ident(TEMPLATE)operator(\))
keyword(while) pre_constant(True)operator(:)
ident(record) operator(=) ident(FILE)operator(.)ident(read)operator(()ident(RECORDSIZE)operator(\))operator(:)
@@ -5161,7 +5161,7 @@ comment(# ----)
comment(# ^^PLEAC^^_8.16)
comment(# NOTE: to parse INI file, see the stanard ConfigParser module.)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(pat) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(\\s)content(*=)content(\\s)content(*)delimiter(")>operator(\))
keyword(for) ident(line) keyword(in) ident(config_file)operator(:)
keyword(if) string<delimiter(")content(#)delimiter(")> keyword(in) ident(line)operator(:) comment(# no comments)
@@ -5176,7 +5176,7 @@ keyword(for) ident(line) keyword(in) ident(config_file)operator(:)
comment(# ^^PLEAC^^_8.17)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(mode)operator(,) ident(ino)operator(,) ident(dev)operator(,) ident(nlink)operator(,) ident(uid)operator(,) ident(gid)operator(,) ident(size)operator(,) \
ident(atime)operator(,) ident(mtime)operator(,) ident(ctime) operator(=) ident(os)operator(.)ident(stat)operator(()ident(filename)operator(\))
@@ -5190,7 +5190,7 @@ keyword(if) ident(info)operator(.)ident(st_uid) operator(==) integer(0)operator(
keyword(if) ident(info)operator(.)ident(st_atime) operator(>) ident(info)operator(.)ident(st_mtime)operator(:)
keyword(print) ident(filename)operator(,) string<delimiter(")content(has been read since it was written.)delimiter(")>
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(def) method(is_safe)operator(()ident(path)operator(\))operator(:)
ident(info) operator(=) ident(os)operator(.)ident(stat)operator(()ident(path)operator(\))
@@ -5266,9 +5266,9 @@ comment(# #define DEAD_PROCESS 8 /* Terminated process. */)
comment(# )
comment(# #define ACCOUNTING 9)
-keyword(import) ident(time)
-keyword(import) ident(struct)
-keyword(import) ident(os)
+keyword(import) include(time)
+keyword(import) include(struct)
+keyword(import) include(os)
keyword(class) class(WTmpRecord)operator(:)
ident(fmt) operator(=) string<delimiter(")content(hI32s4s32s256siili4l20s)delimiter(")>operator(;)
@@ -5317,11 +5317,11 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_8.20)
comment(#!/usr/bin/python)
comment(# laston - find out when given user last logged on)
-keyword(import) ident(sys)
-keyword(import) ident(struct)
-keyword(import) ident(pwd)
-keyword(import) ident(time)
-keyword(import) ident(re)
+keyword(import) include(sys)
+keyword(import) include(struct)
+keyword(import) include(pwd)
+keyword(import) include(time)
+keyword(import) include(re)
ident(f) operator(=) predefined(open)operator(()string<delimiter(")content(/var/log/lastlog)delimiter(")>operator(,)string<delimiter(")content(rb)delimiter(")>operator(\))
@@ -5403,7 +5403,7 @@ comment(#-----------------------------)
comment(#!/usr/bin/perl -w)
comment(# uvi - vi a file without changing its access times)
-keyword(import) ident(sys)operator(,) ident(os)
+keyword(import) include(sys)operator(,) include(os)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\)) operator(!=) integer(2)operator(:)
keyword(raise) exception(SystemExit)operator(()string<delimiter(")content(usage: uvi filename)delimiter(")>operator(\))
ident(filename) operator(=) ident(argv)operator([)integer(1)operator(])
@@ -5443,7 +5443,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_9.3)
comment(#-----------------------------)
-keyword(import) ident(shutil)
+keyword(import) include(shutil)
ident(shutil)operator(.)ident(copy)operator(()ident(oldfile)operator(,) ident(newfile)operator(\))
comment(#-----------------------------)
comment(## NOTE: this doesn't do the same thing as the Perl code,)
@@ -5466,7 +5466,7 @@ comment(# WARNING: these are insecure - do not use in hostile environments)
ident(os)operator(.)ident(system)operator(()string<delimiter(")content(cp %s %s)delimiter(")> operator(%) operator(()ident(oldfile)operator(,) ident(newfile)operator(\))operator(\)) comment(# unix)
ident(os)operator(.)ident(system)operator(()string<delimiter(")content(copy %s %s)delimiter(")> operator(%) operator(()ident(oldfile)operator(,) ident(newfile)operator(\))operator(\)) comment(# dos, vms)
comment(#-----------------------------)
-keyword(import) ident(shutil)
+keyword(import) include(shutil)
ident(shutil)operator(.)ident(copy)operator(()string<delimiter(")content(datafile.dat)delimiter(")>operator(,) string<delimiter(")content(datafile.bak)delimiter(")>operator(\))
@@ -5477,7 +5477,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_9.4)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(seen) operator(=) operator({)operator(})
keyword(def) method(do_my_thing)operator(()ident(filename)operator(\))operator(:)
@@ -5525,16 +5525,16 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_9.6)
comment(#-----------------------------)
-keyword(import) ident(glob)
+keyword(import) include(glob)
ident(filenames) operator(=) ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*.c)delimiter(")>operator(\))
comment(#-----------------------------)
ident(filenames) operator(=) operator([)ident(filename) keyword(for) ident(filename) keyword(in) ident(os)operator(.)ident(listdir)operator(()ident(path)operator(\)) keyword(if) ident(filename)operator(.)ident(endswith)operator(()string<delimiter(")content(.c)delimiter(")>operator(\))operator(])
comment(#-----------------------------)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(allowed_name) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(\\.)content([ch]$)delimiter(")>operator(,) ident(re)operator(.)ident(I)operator(\))operator(.)ident(search)
ident(filenames) operator(=) operator([)ident(f) keyword(for) ident(f) keyword(in) ident(os)operator(.)ident(listdir)operator(()ident(path)operator(\)) keyword(if) ident(allowed_name)operator(()ident(f)operator(\))operator(])
comment(#-----------------------------)
-keyword(import) ident(re)operator(,) ident(os)
+keyword(import) include(re)operator(,) include(os)
ident(allowed_name) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(\\.)content([ch]$)delimiter(")>operator(,) ident(re)operator(.)ident(I)operator(\))operator(.)ident(search)
ident(fnames) operator(=) operator([)ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(dirname)operator(,) ident(fname)operator(\))
@@ -5556,12 +5556,12 @@ comment(# For pre-2.3 code, there is os.path.walk, which is)
comment(# little harder to use.)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(in) ident(os)operator(.)ident(walk)operator(()ident(top)operator(\))operator(:)
keyword(pass) comment(# do whatever)
comment(#-----------------------------)
-keyword(import) ident(os)operator(,) ident(os)operator(.)ident(path)
+keyword(import) include(os)operator(,) include(os.path)
keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(in) ident(os)operator(.)ident(walk)operator(()ident(top)operator(\))operator(:)
keyword(for) ident(name) keyword(in) ident(dirs)operator(:)
keyword(print) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(root)operator(,) ident(name)operator(\)) operator(+) string<delimiter(')content(/)delimiter(')>
@@ -5569,7 +5569,7 @@ keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(
keyword(print) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(root)operator(,) ident(name)operator(\))
comment(#-----------------------------)
-keyword(import) ident(os)operator(,) ident(os)operator(.)ident(path)
+keyword(import) include(os)operator(,) include(os.path)
ident(numbytes) operator(=) integer(0)
keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(in) ident(os)operator(.)ident(walk)operator(()ident(top)operator(\))operator(:)
keyword(for) ident(name) keyword(in) ident(files)operator(:)
@@ -5578,7 +5578,7 @@ keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(
keyword(print) string<delimiter(")content(%s contains %s bytes)delimiter(")> operator(%) operator(()ident(top)operator(,) ident(numbytes)operator(\))
comment(#-----------------------------)
-keyword(import) ident(os)operator(,) ident(os)operator(.)ident(path)
+keyword(import) include(os)operator(,) include(os.path)
ident(saved_size)operator(,) ident(saved_name) operator(=) operator(-)integer(1)operator(,) string<delimiter(')delimiter(')>
keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(in) ident(os)operator(.)ident(walk)operator(()ident(top)operator(\))operator(:)
keyword(for) ident(name) keyword(in) ident(files)operator(:)
@@ -5591,7 +5591,7 @@ keyword(print) string<delimiter(")content(Biggest file %s in %s is %s bytes long
ident(saved_name)operator(,) ident(top)operator(,) ident(saved_size)operator(\))
comment(#-----------------------------)
-keyword(import) ident(os)operator(,) ident(os)operator(.)ident(path)operator(,) ident(time)
+keyword(import) include(os)operator(,) include(os.path)operator(,) include(time)
ident(saved_age)operator(,) ident(saved_name) operator(=) pre_constant(None)operator(,) string<delimiter(')delimiter(')>
keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(in) ident(os)operator(.)ident(walk)operator(()ident(top)operator(\))operator(:)
keyword(for) ident(name) keyword(in) ident(files)operator(:)
@@ -5605,7 +5605,7 @@ keyword(print) string<delimiter(")content(%s %s)delimiter(")> operator(%) operat
comment(#-----------------------------)
comment(#!/usr/bin/env python)
comment(# fdirs - find all directories)
-keyword(import) ident(sys)operator(,) ident(os)operator(,) ident(os)operator(.)ident(path)
+keyword(import) include(sys)operator(,) include(os)operator(,) include(os.path)
ident(argv) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(]) keyword(or) operator([)string<delimiter(')content(.)delimiter(')>operator(])
keyword(for) ident(top) keyword(in) ident(argv)operator(:)
keyword(for) ident(root)operator(,) ident(dirs)operator(,) ident(files) keyword(in) ident(os)operator(.)ident(walk)operator(()ident(top)operator(\))operator(:)
@@ -5617,11 +5617,11 @@ keyword(for) ident(top) keyword(in) ident(argv)operator(:)
comment(# ^^PLEAC^^_9.8)
comment(#-----------------------------)
comment(# DeleteDir - remove whole directory trees like rm -r)
-keyword(import) ident(shutil)
+keyword(import) include(shutil)
ident(shutil)operator(.)ident(rmtree)operator(()ident(path)operator(\))
comment(# DON'T DO THIS:)
-keyword(import) ident(os)operator(,) ident(sys)
+keyword(import) include(os)operator(,) include(sys)
keyword(def) method(DeleteDir)operator(()predefined(dir)operator(\))operator(:)
keyword(for) ident(name) keyword(in) ident(os)operator(.)ident(listdir)operator(()predefined(dir)operator(\))operator(:)
ident(file) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()predefined(dir)operator(,) ident(name)operator(\))
@@ -5636,7 +5636,7 @@ comment(# Renaming Files)
comment(# code sample one to one from my perlcookbook)
comment(# looks strange to me.)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(for) ident(fname) keyword(in) ident(fnames)operator(:)
ident(newname) operator(=) ident(fname)
comment(# change the file's name)
@@ -5649,7 +5649,7 @@ keyword(for) ident(fname) keyword(in) ident(fnames)operator(:)
comment(# use os.renames if newname needs directory creation.)
comment(#A vaguely Pythonic solution is:)
-keyword(import) ident(glob)
+keyword(import) include(glob)
keyword(def) method(rename)operator(()ident(files)operator(,) ident(transfunc)operator(\))
keyword(for) ident(fname) keyword(in) ident(fnames)operator(:)
ident(newname) operator(=) ident(transfunc)operator(()ident(fname)operator(\))
@@ -5687,7 +5687,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_9.10)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(base) operator(=) ident(os)operator(.)ident(path)operator(.)ident(basename)operator(()ident(path)operator(\))
ident(dirname) operator(=) ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(path)operator(\))
@@ -5712,7 +5712,7 @@ comment(# dir is /usr/lib, name is libc, extension is .a)
comment(# while the Perl code prints a '/' after the directory name)
comment(# dir is /usr/lib/, name is libc, extension is .a)
comment(#-----------------------------)
-keyword(import) ident(macpath)
+keyword(import) include(macpath)
ident(path) operator(=) string<delimiter(")content(Hard%20Drive:System%20Folder:README.txt)delimiter(")>
ident(dirname)operator(,) ident(base) operator(=) ident(macpath)operator(.)ident(split)operator(()ident(path)operator(\))
ident(name)operator(,) ident(ext) operator(=) ident(macpath)operator(.)ident(splitext)operator(()ident(base)operator(\))
@@ -5736,7 +5736,7 @@ comment(# @@PLEAC@@_9.11)
comment(#!/usr/bin/python)
comment(# sysmirror - build spectral forest of symlinks)
-keyword(import) ident(sys)operator(,) ident(os)operator(,) ident(os)operator(.)ident(path)
+keyword(import) include(sys)operator(,) include(os)operator(,) include(os.path)
ident(pgmname) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(0)operator(])
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(!=)integer(3)operator(:)
@@ -5804,7 +5804,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_10.1)
comment(#-----------------------------)
-keyword(import) ident(math)
+keyword(import) include(math)
comment(# Provided for demonstration purposes only. Use math.hypot(\) instead.)
keyword(def) method(hypotenuse)operator(()ident(side1)operator(,) ident(side2)operator(\))operator(:)
keyword(return) ident(math)operator(.)ident(sqrt)operator(()ident(side1)operator(**)integer(2) operator(+) ident(side2)operator(**)integer(2)operator(\))
@@ -5855,7 +5855,7 @@ comment(# using the "global" keyword if they are modified)
keyword(def) method(somefunc)operator(()operator(\))operator(:)
ident(variable) operator(=) ident(something) comment(# variable is invisible outside of somefunc)
comment(#-----------------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(name)operator(,) ident(age) operator(=) ident(sys)operator(.)ident(args)operator([)integer(1)operator(:)operator(]) comment(# assumes two and only two command line parameters)
ident(start) operator(=) ident(fetch_time)operator(()operator(\))
comment(#-----------------------------)
@@ -5946,7 +5946,7 @@ comment(## Python evolves. There may be cleaner ways to do this.)
comment(## This also may not work for code called from functions)
comment(## written in C.)
comment(#-----------------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(this_function) operator(=) ident(sys)operator(.)ident(_getframe)operator(()integer(0)operator(\))operator(.)ident(f_code)operator(.)ident(co_name)
comment(#-----------------------------)
ident(i) operator(=) integer(0) comment(# how far up the call stack to look)
@@ -5998,7 +5998,7 @@ comment(# see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/284742 for
comment(#)
comment(# NB: it has been tested under Python 2.3.x and no guarantees can be given)
comment(# that it works under any future Python version.)
-keyword(import) ident(inspect)operator(,)ident(dis)
+keyword(import) include(inspect)operator(,)include(dis)
keyword(def) method(expecting)operator(()operator(\))operator(:)
string<delimiter(""")content(Return how many values the caller is expecting)delimiter(""")>
@@ -6159,7 +6159,7 @@ comment(# trap specific exceptions. For instance these bare excepts will)
comment(# catch KeyboardInterrupt, SystemExit, and MemoryError as well as)
comment(# more common errors. In addition they force you to import sys to)
comment(# get the error message.)
-keyword(import) ident(warnings)operator(,) ident(sys)
+keyword(import) include(warnings)operator(,) include(sys)
keyword(try)operator(:)
ident(func)operator(()operator(\))
keyword(except)operator(:)
@@ -6314,7 +6314,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_10.17)
comment(#-----------------------------)
-keyword(import) ident(mailbox)operator(,) ident(sys)
+keyword(import) include(mailbox)operator(,) include(sys)
ident(mbox) operator(=) ident(mailbox)operator(.)ident(PortableUnixMailbox)operator(()ident(sys)operator(.)ident(stdin)operator(\))
keyword(def) method(extract_data)operator(()ident(msg)operator(,) ident(idx)operator(\))operator(:)
@@ -6458,7 +6458,7 @@ ident(value) operator(=) ident(href)operator([)ident(key)operator(])
ident(slice) operator(=) operator([)ident(href)operator([)ident(k)operator(]) keyword(for) ident(k) keyword(in) operator(()ident(key1)operator(,) ident(key2)operator(,) ident(key3)operator(\))operator(])
ident(keys) operator(=) predefined(hash)operator(.)ident(keys)operator(()operator(\))
-keyword(import) ident(types)
+keyword(import) include(types)
keyword(if) predefined(type)operator(()ident(someref)operator(\)) operator(!=) ident(types)operator(.)ident(DictType)operator(:)
keyword(raise) string<delimiter(")content(Expected a dictionary, not %s)delimiter(")> operator(%) predefined(type)operator(()ident(someref)operator(\))
keyword(if) predefined(isinstance)operator(()ident(someref)operator(,)predefined(dict)operator(\))operator(:)
@@ -6527,7 +6527,7 @@ comment(#=> 3)
comment(#=> 4)
comment(#=> 5 0)
comment(#-----------------------------)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(def) method(timestamp)operator(()operator(\))operator(:)
ident(start_time) operator(=) ident(time)operator(.)ident(time)operator(()operator(\))
keyword(def) method(elapsed)operator(()operator(\))operator(:)
@@ -6589,7 +6589,7 @@ comment(#=> [1, s, [1, 1, 1, 1]])
comment(# If you need to modify every value in a list, you should use a list comprehension)
comment(# which does NOT modify inplace:)
-keyword(import) ident(math)
+keyword(import) include(math)
ident(mylist) operator(=) operator([)operator(()ident(val)operator(**)integer(3) operator(*) integer(4)operator(/)integer(3)operator(*)ident(math)operator(.)ident(pi)operator(\)) keyword(for) ident(val) keyword(in) ident(mylist)operator(])
comment(# @@PLEAC@@_11.7)
@@ -6702,7 +6702,7 @@ keyword(for) ident(record) keyword(in) ident(list_of_records)operator(:)
keyword(print) string<delimiter(")content(%s: %s)delimiter(")> operator(%) operator(()ident(key)operator(,) ident(record)operator([)ident(key)operator(])operator(\))
keyword(print)
comment(#-----------------------------)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(list_of_records) operator(=) operator([)operator({)operator(})operator(])
keyword(while) pre_constant(True)operator(:)
ident(line) operator(=) ident(sys)operator(.)ident(stdin)operator(.)ident(readline)operator(()operator(\))
@@ -6720,7 +6720,7 @@ keyword(while) pre_constant(True)operator(:)
ident(list_of_records)operator([)operator(-)integer(1)operator(])operator([)ident(key)operator(]) operator(=) ident(value)
comment(#-----------------------------)
comment(# @@PLEAC@@_11.11)
-keyword(import) ident(pprint)
+keyword(import) include(pprint)
ident(mylist) operator(=) operator([)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(])operator(,) operator([)integer(4)operator(,) operator([)integer(5)operator(,)integer(6)operator(,)integer(7)operator(])operator(,) integer(8)operator(,)integer(9)operator(,) operator([)integer(0)operator(,)integer(3)operator(,)integer(5)operator(])operator(])operator(,) integer(7)operator(,) integer(8)operator(])
ident(mydict) operator(=) operator({)string<delimiter(")content(abc)delimiter(")>operator(:) string<delimiter(")content(def)delimiter(")>operator(,) string<delimiter(")content(ghi)delimiter(")>operator(:)operator([)integer(1)operator(,)integer(2)operator(,)integer(3)operator(])operator(})
@@ -6739,7 +6739,7 @@ ident(newlist) operator(=) predefined(list)operator(()ident(mylist)operator(\))
ident(newdict) operator(=) predefined(dict)operator(()ident(mydict)operator(\)) comment(# shallow copy)
comment(# Pre 2.3:)
-keyword(import) ident(copy)
+keyword(import) include(copy)
ident(newlist) operator(=) ident(copy)operator(.)ident(copy)operator(()ident(mylist)operator(\)) comment(# shallow copy)
ident(newdict) operator(=) ident(copy)operator(.)ident(copy)operator(()ident(mydict)operator(\)) comment(# shallow copy)
@@ -6758,12 +6758,12 @@ ident(mylist)operator([)integer(0)operator(])operator([)integer(0)operator(]) op
keyword(print) ident(mylist)operator(,) ident(newlist)
comment(#=> [['0', '2', '3'], 4] [['0', '2', '3'], 4])
comment(#-----------------------------)
-keyword(import) ident(copy)
+keyword(import) include(copy)
ident(newlist) operator(=) ident(copy)operator(.)ident(deepcopy)operator(()ident(mylist)operator(\)) comment(# deep copy)
ident(newdict) operator(=) ident(copy)operator(.)ident(deepcopy)operator(()ident(mydict)operator(\)) comment(# deep copy)
comment(# deep copies copy a data structure recursively:)
-keyword(import) ident(copy)
+keyword(import) include(copy)
ident(mylist) operator(=) operator([)operator([)string<delimiter(")content(1)delimiter(")>operator(,) string<delimiter(")content(2)delimiter(")>operator(,) string<delimiter(")content(3)delimiter(")>operator(])operator(,) integer(4)operator(])
ident(newlist) operator(=) ident(copy)operator(.)ident(deepcopy)operator(()ident(mylist)operator(\))
@@ -6772,7 +6772,7 @@ keyword(print) ident(mylist)operator(,) ident(newlist)
comment(#=> [['0', '2', '3'], 4] [['1', '2', '3'], 4])
comment(#-----------------------------)
comment(# @@PLEAC@@_11.13)
-keyword(import) ident(pickle)
+keyword(import) include(pickle)
keyword(class) class(Foo)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:)
pre_constant(self)operator(.)ident(val) operator(=) integer(1)
@@ -6786,7 +6786,7 @@ keyword(print) ident(x)operator(.)ident(val)
comment(#=> 3)
comment(#-----------------------------)
comment(# @@PLEAC@@_11.14)
-keyword(import) ident(os)operator(,) ident(shelve)
+keyword(import) include(os)operator(,) include(shelve)
ident(fname) operator(=) string<delimiter(")content(testfile.db)delimiter(")>
keyword(if) keyword(not) ident(os)operator(.)ident(path)operator(.)ident(exists)operator(()ident(fname)operator(\))operator(:)
ident(d) operator(=) ident(shelve)operator(.)ident(open)operator(()string<delimiter(")content(testfile.db)delimiter(")>operator(\))
@@ -6802,8 +6802,8 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_11.15)
comment(# bintree - binary tree demo program)
comment(# Use the heapq module instead?)
-keyword(import) ident(random)
-keyword(import) ident(warnings)
+keyword(import) include(random)
+keyword(import) include(warnings)
keyword(class) class(BTree)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:)
@@ -6905,17 +6905,17 @@ comment(#=== In the file "Omega.py")
ident(name) operator(=) string<delimiter(")content(last)delimiter(")>
comment(#=== End of file)
-keyword(import) ident(Alpha)operator(,) ident(Omega)
+keyword(import) include(Alpha)operator(,) include(Omega)
keyword(print) string<delimiter(")content(Alpha is %s, Omega is %s.)delimiter(")> operator(%) operator(()ident(Alpha)operator(.)ident(name)operator(,) ident(Omega)operator(.)ident(name)operator(\))
comment(#> Alpha is first, Omega is last.)
comment(#-----------------------------)
comment(# Python does not have an equivalent to "compile-time load")
-keyword(import) ident(sys)
+keyword(import) include(sys)
comment(# Depending on the implementation, this could use a builtin)
comment(# module or load a file with the extension .py, .pyc, pyo, .pyd,)
comment(# .so, .dll, or (with imputils\) load from other files.)
-keyword(import) ident(Cards)operator(.)ident(Poker)
+keyword(import) include(Cards.Poker)
comment(#-----------------------------)
comment(#=== In the file Cards/Poker.py)
@@ -6939,21 +6939,21 @@ comment(# your code goes here)
comment(########################)
comment(#-----------------------------)
-keyword(import) ident(YourModule) comment(# Import the module into my package)
+keyword(import) include(YourModule) comment(# Import the module into my package)
comment(# (does not import any of its symbols\))
-keyword(import) ident(YourModule) keyword(as) ident(Module) comment(# Use a different name for the module)
+keyword(import) include(YourModule) keyword(as) ident(Module) comment(# Use a different name for the module)
-keyword(from) ident(YourModule) keyword(import) operator(*) comment(# Import all module symbols not starting)
+keyword(from) include(YourModule) keyword(import) include(*) comment(# Import all module symbols not starting)
comment(# with an underscore (default\); if __all__)
comment(# is defined, only imports those symbols.)
comment(# Using this is discouraged unless the )
comment(# module is specifically designed for it.)
-keyword(from) ident(YourModule) keyword(import) ident(name1)operator(,) ident(name2)operator(,) ident(xxx)
+keyword(from) include(YourModule) keyword(import) include(name1)operator(,) include(name2)operator(,) include(xxx)
comment(# Import the named symbols from the module)
-keyword(from) ident(YourModule) keyword(import) ident(name1) keyword(as) ident(name2)
+keyword(from) include(YourModule) keyword(import) include(name1) keyword(as) ident(name2)
comment(# Import the named object, but use a)
comment(# different name to access it locally.)
@@ -6962,9 +6962,9 @@ ident(__all__) operator(=) operator([)string<delimiter(")content(F1)delimiter(")
comment(#-----------------------------)
ident(__all__) operator(=) operator([)string<delimiter(")content(Op_Func)delimiter(")>operator(,) string<delimiter(")content(Table)delimiter(")>operator(])
comment(#-----------------------------)
-keyword(from) ident(YourModule) keyword(import) ident(Op_Func)operator(,) ident(Table)operator(,) ident(F1)
+keyword(from) include(YourModule) keyword(import) include(Op_Func)operator(,) include(Table)operator(,) include(F1)
comment(#-----------------------------)
-keyword(from) ident(YourModule) keyword(import) ident(Functions)operator(,) ident(Table)
+keyword(from) include(YourModule) keyword(import) include(Functions)operator(,) include(Table)
comment(#-----------------------------)
comment(# ^^PLEAC^^_12.2)
@@ -6978,13 +6978,13 @@ keyword(except) exception(ImportError)operator(,) ident(err)operator(:)
comment(# imports into current package)
keyword(try)operator(:)
- keyword(import) ident(module)
+ keyword(import) include(module)
keyword(except) exception(ImportError)operator(,) ident(err)operator(:)
keyword(raise) exception(ImportError)operator(()string<delimiter(")content(couldn't load 'module': %s)delimiter(")> operator(%) operator(()ident(err)operator(,) operator(\))operator(\))
comment(# imports into current package, if the name is known)
keyword(try)operator(:)
- keyword(import) ident(module)
+ keyword(import) include(module)
keyword(except) exception(ImportError)operator(,) ident(err)operator(:)
keyword(raise) exception(ImportError)operator(()string<delimiter(")content(couldn't load 'module': %s)delimiter(")> operator(%) operator(()ident(err)operator(,) operator(\))operator(\))
@@ -7021,27 +7021,27 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_12.3)
comment(#-----------------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(if) ident(__name__) operator(==) string<delimiter(")content(__main__)delimiter(")>operator(:)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\)) operator(!=) integer(3) keyword(or) keyword(not) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(.)ident(isdigit)operator(()operator(\)) \
keyword(or) keyword(not) ident(sys)operator(.)ident(argv)operator([)integer(2)operator(])operator(.)ident(isdigit)operator(()operator(\))operator(:)
keyword(raise) exception(SystemExit)operator(()string<delimiter(")content(usage: %s num1 num2)delimiter(")> operator(%) ident(sys)operator(.)ident(argv)operator([)integer(0)operator(])operator(\))
-keyword(import) ident(Some)operator(.)ident(Module)
-keyword(import) ident(More)operator(.)ident(Modules)
+keyword(import) include(Some.Module)
+keyword(import) include(More.Modules)
comment(#-----------------------------)
keyword(if) ident(opt_b)operator(:)
- keyword(import) ident(math)
+ keyword(import) include(math)
comment(#-----------------------------)
-keyword(from) ident(os) keyword(import) ident(O_EXCL)operator(,) ident(O_CREAT)operator(,) ident(O_RDWR)
+keyword(from) include(os) keyword(import) include(O_EXCL)operator(,) include(O_CREAT)operator(,) include(O_RDWR)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(O_EXCL) operator(=) ident(os)operator(.)ident(O_EXCL)
ident(O_CREAT) operator(=) ident(os)operator(.)ident(O_CREAT)
ident(O_RDWR) operator(=) ident(os)operator(.)ident(O_RDWR)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(O_EXCL)operator(,) ident(O_CREAT)operator(,) ident(O_RDWR) operator(=) ident(os)operator(.)ident(O_EXCL)operator(,) ident(os)operator(.)ident(O_CREAT)operator(,) ident(os)operator(.)ident(O_RDWR)
comment(#-----------------------------)
ident(load_module)operator(()string<delimiter(')content(os)delimiter(')>operator(,) string<delimiter(")content(O_EXCL O_CREAT O_RDWR)delimiter(")>operator(.)ident(split)operator(()operator(\))operator(\))
@@ -7098,7 +7098,7 @@ keyword(if) ident(__name__) operator(==) string<delimiter(")content(__main__)del
ident(main)operator(()operator(\))
comment(# DON'T DO THIS:)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(def) method(nreadline)operator(()ident(count)operator(,) ident(handle_name)operator(\))operator(:)
keyword(assert) ident(count) operator(>) integer(0)operator(,) string<delimiter(")content(count must be > 0)delimiter(")>
@@ -7125,7 +7125,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_12.6)
comment(#-----------------------------)
comment(## There is no direct equivalent in Python to an END block)
-keyword(import) ident(time)operator(,) ident(os)operator(,) ident(sys)
+keyword(import) include(time)operator(,) include(os)operator(,) include(sys)
comment(# Tricks to ensure the needed functions exist during module cleanup)
keyword(def) method(_getgmtime)operator(()ident(asctime)operator(=)ident(time)operator(.)ident(asctime)operator(,) ident(gmtime)operator(=)ident(time)operator(.)ident(gmtime)operator(,)
@@ -7162,7 +7162,7 @@ comment(## It is more appropriate to use try/finally around the)
comment(## main code, so the order of initialization and finalization)
comment(## can be specified.)
keyword(if) ident(__name__) operator(==) string<delimiter(")content(__main__)delimiter(")>operator(:)
- keyword(import) ident(logger)
+ keyword(import) include(logger)
ident(logger)operator(.)ident(init)operator(()string<delimiter(")content(/tmp/mylog)delimiter(")>operator(\))
keyword(try)operator(:)
ident(main)operator(()operator(\))
@@ -7187,13 +7187,13 @@ comment(#$ export PYTHONPATH=$HOME/pythonlib)
comment(# syntax for csh or tcsh)
comment(#% setenv PYTHONPATH ~/pythonlib)
comment(#-----------------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(sys)operator(.)ident(path)operator(.)ident(insert)operator(()integer(0)operator(,) string<delimiter(")content(/projects/spectre/lib)delimiter(")>operator(\))
comment(#-----------------------------)
-keyword(import) ident(FindBin)
+keyword(import) include(FindBin)
ident(sys)operator(.)ident(path)operator(.)ident(insert)operator(()integer(0)operator(,) ident(FindBin)operator(.)ident(Bin)operator(\))
comment(#-----------------------------)
-keyword(import) ident(FindBin)
+keyword(import) include(FindBin)
ident(Bin) operator(=) string<delimiter(")content(Name)delimiter(")>
ident(bin) operator(=) predefined(getattr)operator(()ident(FindBin)operator(,) ident(Bin)operator(\))
ident(sys)operator(.)ident(path)operator(.)ident(insert)operator(()integer(0)operator(,) predefined(bin) operator(+) string<delimiter(")content(/../lib)delimiter(")>operator(\))
@@ -7229,7 +7229,7 @@ comment(#=== In MyModule)
keyword(def) method(open)operator(()operator(\))operator(:)
keyword(pass) comment(# TBA)
comment(#-----------------------------)
-keyword(from) ident(MyModule) keyword(import) predefined(open)
+keyword(from) include(MyModule) keyword(import) include(open)
ident(file) operator(=) predefined(open)operator(()operator(\))
comment(#-----------------------------)
@@ -7248,7 +7248,7 @@ keyword(def) method(even_only)operator(()ident(n)operator(\))operator(:)
comment(#....)
comment(#-----------------------------)
-keyword(import) ident(warnings)
+keyword(import) include(warnings)
keyword(def) method(even_only)operator(()ident(n)operator(\))operator(:)
keyword(if) ident(n) operator(&) integer(1)operator(:) comment(# test whether odd number)
ident(warnings)operator(.)ident(warn)operator(()string<delimiter(")content(%s is not even, continuing)delimiter(")> operator(%) operator(()ident(n)operator(\))operator(\))
@@ -7266,7 +7266,7 @@ predefined(getattr)operator(()predefined(__import__)operator(()ident(packname)op
comment(#-----------------------------)
comment(# DON'T DO THIS [Use math.log(val, base\) instead])
-keyword(import) ident(math)
+keyword(import) include(math)
keyword(def) method(make_log)operator(()ident(n)operator(\))operator(:)
keyword(def) method(logn)operator(()ident(val)operator(\))operator(:)
keyword(return) ident(math)operator(.)ident(log)operator(()ident(val)operator(,) ident(n)operator(\))
@@ -7355,7 +7355,7 @@ ident(foo)operator(.)ident(__doc__) operator(=) string<delimiter(")content(A fun
comment(# the pydoc module is used to display a range of information about )
comment(# an object including its docstrings:)
-keyword(import) ident(pydoc)
+keyword(import) include(pydoc)
keyword(print) ident(pydoc)operator(.)ident(getdoc)operator(()predefined(int)operator(\))
ident(pydoc)operator(.)ident(help)operator(()predefined(int)operator(\))
@@ -7401,7 +7401,7 @@ comment(# ^^PLEAC^^_12.19)
comment(#-----------------------------)
comment(#% pmdesc)
comment(#-----------------------------)
-keyword(import) ident(sys)operator(,) ident(pydoc)
+keyword(import) include(sys)operator(,) include(pydoc)
keyword(def) method(print_module_info)operator(()ident(path)operator(,) ident(modname)operator(,) ident(desc)operator(\))operator(:)
comment(# Skip files starting with "test_")
@@ -7484,13 +7484,13 @@ comment(#-----------------------------)
keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:)
keyword(pass)
comment(#-----------------------------)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:)
pre_constant(self)operator(.)ident(start) operator(=) ident(time)operator(.)ident(time)operator(()operator(\)) comment(# init data fields)
pre_constant(self)operator(.)ident(age) operator(=) integer(0)
comment(#-----------------------------)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(kwargs)operator(\))operator(:)
comment(# Sets self.start to the current time, and self.age to 0. If called)
@@ -7502,7 +7502,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_13.2)
comment(#-----------------------------)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(class) class(Class)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__del__)operator(()pre_constant(self)operator(\))operator(:)
keyword(print) pre_constant(self)operator(,) string<delimiter(")content(dying at)delimiter(")>operator(,) ident(time)operator(.)ident(ctime)operator(()operator(\))
@@ -7591,7 +7591,7 @@ comment(# and 'obj.method(value\)' is a settor. Again, this is not a)
comment(# common Python idiom and should not be used. See below for a)
comment(# more common way to do parameter checking of attribute assignment.)
-keyword(import) ident(re)operator(,) ident(sys)
+keyword(import) include(re)operator(,) include(sys)
keyword(def) method(carp)operator(()ident(s)operator(\))operator(:)
ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()string<delimiter(")content(WARNING: )delimiter(")> operator(+) ident(s) operator(+) string<delimiter(")char(\\n)delimiter(")>operator(\))
@@ -7668,7 +7668,7 @@ keyword(class) class(Person)operator(()predefined(object)operator(\))operator(:)
pre_constant(self)operator(.)ident(body_count)operator([)integer(0)operator(]) operator(-=) integer(1)
comment(# later, the user can say this:)
-keyword(import) ident(Person)
+keyword(import) include(Person)
ident(people) operator(=) operator([)operator(])
keyword(for) ident(i) keyword(in) predefined(range)operator(()integer(10)operator(\))operator(:)
ident(people)operator(.)ident(append)operator(()ident(Person)operator(.)ident(Person)operator(()operator(\))operator(\))
@@ -7741,7 +7741,7 @@ keyword(print) string<delimiter(")content(At age %d, %s's first friend is %s.)de
comment(#-----------------------------)
comment(# This isn't very Pythonic - should create objects with the)
comment(# needed data, and not depend on defaults and modifing the object.)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(def) method(carp)operator(()ident(s)operator(\))operator(:)
ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()string<delimiter(")content(WARNING: )delimiter(")> operator(+) ident(s) operator(+) string<delimiter(")char(\\n)delimiter(")>operator(\))
@@ -7846,7 +7846,7 @@ ident(ob2) operator(=) ident(ob1)operator(.)ident(__class__)operator(()operator(
comment(#-----------------------------)
comment(# XXX I do not know the intent of the original Perl code)
comment(# Do not use this style of programming in Python.)
-keyword(import) ident(time)
+keyword(import) include(time)
keyword(class) class(Person)operator(()ident(possible)operator(,)ident(base)operator(,)ident(classes)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(*)ident(args)operator(,) operator(**)ident(kwargs)operator(\))operator(:)
comment(# Call the parents' constructors, if there are any)
@@ -7982,7 +7982,7 @@ comment(# XXX Does Perl only have single inheritence? Or does)
comment(# it check all base classes? No directly equivalent way)
comment(# to do this in Python, but see above.)
comment(#-----------------------------)
-keyword(import) ident(time)
+keyword(import) include(time)
comment(# The Perl code calls a private '_init' function, but in)
comment(# Python there's need for the complexity of 'new' mechanism)
@@ -8129,7 +8129,7 @@ comment(#-----------------------------)
comment(# ^^PLEAC^^_13.14)
comment(#-----------------------------)
-keyword(import) ident(UserString)
+keyword(import) include(UserString)
keyword(class) class(MyString)operator(()ident(UserString)operator(.)ident(UserString)operator(\))operator(:)
keyword(def) method(__cmp__)operator(()pre_constant(self)operator(,) ident(other)operator(\))operator(:)
keyword(return) predefined(cmp)operator(()pre_constant(self)operator(.)ident(data)operator(.)ident(upper)operator(()operator(\))operator(,) ident(other)operator(.)ident(upper)operator(()operator(\))operator(\))
@@ -8242,7 +8242,7 @@ comment(# square of that is STRFixNum: 11.11)
comment(# This isn't excatly the same as the original Perl code since)
comment(# I couldn't figure out why the PLACES variable was used.)
comment(#-----------------------------)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(_places_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(\\.)content(()content(\\d)content(+\))delimiter(")>operator(\))
ident(default_places) operator(=) integer(0)
@@ -8303,7 +8303,7 @@ keyword(if) ident(__name__) operator(==) string<delimiter(")content(__main__)del
comment(# ^^PLEAC^^_13.15)
comment(# You can't tie a variable, but you can use properties. )
-keyword(import) ident(itertools)
+keyword(import) include(itertools)
keyword(class) class(ValueRing)operator(()predefined(object)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(colours)operator(\))operator(:)
pre_constant(self)operator(.)ident(colourcycle) operator(=) ident(itertools)operator(.)ident(cycle)operator(()ident(colours)operator(\))
@@ -8374,7 +8374,7 @@ comment(#=>verde is green)
comment(#=>green is verde)
comment(#=>red is rojo)
comment(#-------------------------------------)
-keyword(import) ident(itertools)
+keyword(import) include(itertools)
keyword(for) ident(elem) keyword(in) ident(itertools)operator(.)ident(count)operator(()operator(\))operator(:)
keyword(print) string<delimiter(")content(Got)delimiter(")>operator(,) ident(elem)
comment(#-------------------------------------)
@@ -8392,7 +8392,7 @@ comment(#)
comment(# @@PLEAC@@_14.1)
comment(#-------------------------------------)
-keyword(import) ident(anydbm)
+keyword(import) include(anydbm)
ident(filename) operator(=) string<delimiter(")content(test.db)delimiter(")>
keyword(try)operator(:)
ident(db) operator(=) ident(anydbm)operator(.)ident(open)operator(()ident(filename)operator(\))
@@ -8409,7 +8409,7 @@ comment(#!/usr/bin/python)
comment(# userstats - generates statistics on who logged in.)
comment(# call with an argument to display totals)
-keyword(import) ident(sys)operator(,) ident(os)operator(,) ident(anydbm)operator(,) ident(re)
+keyword(import) include(sys)operator(,) include(os)operator(,) include(anydbm)operator(,) include(re)
ident(db_file) operator(=) string<delimiter(')content(/tmp/userstats.db)delimiter(')> comment(# where data is kept between runs)
@@ -8454,7 +8454,7 @@ ident(db)operator(.)ident(close)operator(()operator(\))
comment(# @@PLEAC@@_14.2)
comment(# Emptying a DBM File)
-keyword(import) ident(anydbm)
+keyword(import) include(anydbm)
keyword(try)operator(:)
ident(db) operator(=) ident(anydbm)operator(.)ident(open)operator(()ident(FILENAME)operator(,)string<delimiter(')content(w)delimiter(')>operator(\)) comment(# open, for writing)
@@ -8473,7 +8473,7 @@ keyword(except) ident(anydbm)operator(.)ident(error)operator(,) ident(err)operat
ident(db)operator(.)ident(close)operator(()operator(\))
comment(# -------------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(try)operator(:)
ident(os)operator(.)ident(remove)operator(()ident(FILENAME)operator(\))
keyword(except) exception(OSError)operator(,) ident(err)operator(:)
@@ -8494,8 +8494,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# db2gdbm: converts DB to GDBM)
-keyword(import) ident(sys)
-keyword(import) ident(dbm)operator(,) ident(gdbm)
+keyword(import) include(sys)
+keyword(import) include(dbm)operator(,) include(gdbm)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(<)integer(3)operator(:)
keyword(print) string<delimiter(")content(usage: db2gdbm infile outfile)delimiter(")>
@@ -8544,7 +8544,7 @@ keyword(for) ident(INPUT) keyword(in) operator(()ident(INPUT1)operator(,) ident(
comment(# @@PLEAC@@_14.5)
comment(# On systems where the Berkeley DB supports it, dbhash takes an)
comment(# "l" flag:)
-keyword(import) ident(dbhash)
+keyword(import) include(dbhash)
ident(dbhash)operator(.)ident(open)operator(()string<delimiter(")content(mydb.db)delimiter(")>operator(,) string<delimiter(")content(cl)delimiter(")>operator(\)) comment(# 'c': create if doesn't exist)
comment(# @@INCOMPLETE@@)
@@ -8560,7 +8560,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_14.8)
comment(# shelve uses anydbm to access and chooses between DBMs.)
comment(# anydbm detect file formats automatically.)
-keyword(import) ident(shelve)
+keyword(import) include(shelve)
ident(db) operator(=) ident(shelve)operator(.)ident(open)operator(()string<delimiter(")content(celebrities.db)delimiter(")>operator(\))
ident(name1) operator(=) string<delimiter(")content(Greg Stein)delimiter(")>
@@ -8599,7 +8599,7 @@ comment(#-----------------------------)
comment(# @@PLEAC@@_14.9)
comment(# DON'T DO THIS.)
-keyword(import) ident(os) keyword(as) ident(_os)operator(,) ident(shelve) keyword(as) ident(_shelve)
+keyword(import) include(os) keyword(as) ident(_os)operator(,) include(shelve) keyword(as) ident(_shelve)
ident(_fname) operator(=) string<delimiter(")content(persist.db)delimiter(")>
keyword(if) keyword(not) ident(_os)operator(.)ident(path)operator(.)ident(exists)operator(()ident(_fname)operator(\))operator(:)
@@ -8619,7 +8619,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_14.10)
comment(#-----------------------------)
-keyword(import) ident(dbmodule)
+keyword(import) include(dbmodule)
ident(dbconn) operator(=) ident(dbmodule)operator(.)ident(connect)operator(()ident(arguments)operator(...)operator(\))
@@ -8636,8 +8636,8 @@ ident(cursor)operator(.)ident(close)operator(()operator(\))
ident(dbconn)operator(.)ident(close)operator(()operator(\))
comment(#-----------------------------)
-keyword(import) ident(MySQLdb)
-keyword(import) ident(pwd)
+keyword(import) include(MySQLdb)
+keyword(import) include(pwd)
ident(dbconn) operator(=) ident(MySQLdb)operator(.)ident(connect)operator(()ident(db)operator(=)string<delimiter(')content(dbname)delimiter(')>operator(,) ident(host)operator(=)string<delimiter(')content(mysqlserver.domain.com)delimiter(')>operator(,)
ident(port)operator(=)integer(3306)operator(,) ident(user)operator(=)string<delimiter(')content(user)delimiter(')>operator(,) ident(passwd)operator(=)string<delimiter(')content(password)delimiter(')>operator(\))
@@ -8677,8 +8677,8 @@ comment(# -- getopt way (All Python versions\))
comment(#-----------------------------)
comment(# Preamble)
-keyword(import) ident(sys)
-keyword(import) ident(getopt)
+keyword(import) include(sys)
+keyword(import) include(getopt)
comment(# getopt(\) explicitly receives arguments for it to process.)
comment(# No magic. Explicit is better than implicit.)
@@ -8761,7 +8761,7 @@ comment(# option parsing module. New in 2.3.)
comment(# @@PLEAC@@_15.2)
comment(##------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(def) method(is_interactive_python)operator(()operator(\))operator(:)
keyword(try)operator(:)
@@ -8770,7 +8770,7 @@ keyword(def) method(is_interactive_python)operator(()operator(\))operator(:)
keyword(return) pre_constant(False)
keyword(return) pre_constant(True)
comment(##------------------)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(def) method(is_interactive)operator(()operator(\))operator(:)
comment(# only False if stdin is redirected like "-t" in perl.)
keyword(return) ident(sys)operator(.)ident(stdin)operator(.)ident(isatty)operator(()operator(\))
@@ -8778,7 +8778,7 @@ keyword(def) method(is_interactive)operator(()operator(\))operator(:)
comment(# Or take advantage of Python's Higher Order Functions:)
ident(is_interactive) operator(=) ident(sys)operator(.)ident(stdin)operator(.)ident(isatty)
comment(##------------------)
-keyword(import) ident(posix)
+keyword(import) include(posix)
keyword(def) method(is_interactive_posix)operator(()operator(\))operator(:)
ident(tty) operator(=) predefined(open)operator(()string<delimiter(")content(/dev/tty)delimiter(")>operator(\))
ident(tpgrp) operator(=) ident(posix)operator(.)ident(tcgetpgrp)operator(()ident(tty)operator(.)ident(fileno)operator(()operator(\))operator(\))
@@ -8809,7 +8809,7 @@ comment(# One could use the curses, but this was not ported to windows,)
comment(# use console.)
comment(# just run clear)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(os)operator(.)ident(system)operator(()string<delimiter(")content(clear)delimiter(")>operator(\))
comment(# cache output)
ident(clear) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(clear)delimiter(")>operator(\))operator(.)ident(read)operator(()operator(\))
@@ -8821,17 +8821,17 @@ comment(# @@PLEAC@@_15.4)
comment(# Determining Terminal or Window Size)
comment(# eiter use ioctl)
-keyword(import) ident(struct)operator(,) ident(fcntl)operator(,) ident(termios)operator(,) ident(sys)
+keyword(import) include(struct)operator(,) include(fcntl)operator(,) include(termios)operator(,) include(sys)
ident(s) operator(=) ident(struct)operator(.)ident(pack)operator(()string<delimiter(")content(HHHH)delimiter(")>operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(\))
ident(hchar)operator(,) ident(wchar) operator(=) ident(struct)operator(.)ident(unpack)operator(()string<delimiter(")content(HHHH)delimiter(")>operator(,) ident(fcntl)operator(.)ident(ioctl)operator(()ident(sys)operator(.)ident(stdout)operator(.)ident(fileno)operator(()operator(\))operator(,)
ident(termios)operator(.)ident(TIOCGWINSZ)operator(,) ident(s)operator(\))operator(\))operator([)operator(:)integer(2)operator(])
comment(# or curses)
-keyword(import) ident(curses)
+keyword(import) include(curses)
operator(()ident(hchar)operator(,)ident(wchar)operator(\)) operator(=) ident(curses)operator(.)ident(getmaxyx)operator(()operator(\))
comment(# graph contents of values)
-keyword(import) ident(struct)operator(,) ident(fcntl)operator(,) ident(termios)operator(,) ident(sys)
+keyword(import) include(struct)operator(,) include(fcntl)operator(,) include(termios)operator(,) include(sys)
ident(width) operator(=) ident(struct)operator(.)ident(unpack)operator(()string<delimiter(")content(HHHH)delimiter(")>operator(,) ident(fcntl)operator(.)ident(ioctl)operator(()ident(sys)operator(.)ident(stdout)operator(.)ident(fileno)operator(()operator(\))operator(,)
ident(termios)operator(.)ident(TIOCGWINSZ)operator(,)
ident(struct)operator(.)ident(pack)operator(()string<delimiter(")content(HHHH)delimiter(")>operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(,) integer(0)operator(\))operator(\))operator(\))operator([)integer(1)operator(])
@@ -8879,10 +8879,10 @@ keyword(class) class(_Getch)operator(:)
keyword(class) class(_GetchUnix)operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:)
- keyword(import) ident(tty)operator(,) ident(sys)
+ keyword(import) include(tty)operator(,) include(sys)
keyword(def) method(__call__)operator(()pre_constant(self)operator(\))operator(:)
- keyword(import) ident(sys)operator(,) ident(tty)operator(,) ident(termios)
+ keyword(import) include(sys)operator(,) include(tty)operator(,) include(termios)
ident(fd) operator(=) ident(sys)operator(.)ident(stdin)operator(.)ident(fileno)operator(()operator(\))
ident(old_settings) operator(=) ident(termios)operator(.)ident(tcgetattr)operator(()ident(fd)operator(\))
keyword(try)operator(:)
@@ -8895,10 +8895,10 @@ keyword(class) class(_GetchUnix)operator(:)
keyword(class) class(_GetchWindows)operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:)
- keyword(import) ident(msvcrt)
+ keyword(import) include(msvcrt)
keyword(def) method(__call__)operator(()pre_constant(self)operator(\))operator(:)
- keyword(import) ident(msvcrt)
+ keyword(import) include(msvcrt)
keyword(return) ident(msvcrt)operator(.)ident(getch)operator(()operator(\))
@@ -8926,7 +8926,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_15.9)
comment(# On Windows)
-keyword(import) ident(msvcrt)
+keyword(import) include(msvcrt)
keyword(if) ident(msvcrt)operator(.)ident(kbhit)operator(()operator(\))operator(:)
ident(c) operator(=) ident(msvcrt)operator(.)ident(getch)
@@ -8936,9 +8936,9 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_15.10)
comment(#----------------------------------------)
-keyword(import) ident(getpass)
-keyword(import) ident(pwd)
-keyword(import) ident(crypt)
+keyword(import) include(getpass)
+keyword(import) include(pwd)
+keyword(import) include(crypt)
ident(password) operator(=) ident(getpass)operator(.)ident(getpass)operator(()string<delimiter(')content(Enter your password: )delimiter(')>operator(\))
ident(username) operator(=) ident(getpass)operator(.)ident(getuser)operator(()operator(\))
ident(encrypted) operator(=) ident(pwd)operator(.)ident(getpwnam)operator(()ident(username)operator(\))operator(.)ident(pw_passwd)
@@ -8954,7 +8954,7 @@ comment(#----------------------------------------)
comment(# @@PLEAC@@_15.11)
comment(# simply importing readline gives line edit capabilities to raw_)
-keyword(import) ident(readline)
+keyword(import) include(readline)
ident(readline)operator(.)ident(add_history)operator(()string<delimiter(")content(fake line)delimiter(")>operator(\))
ident(line) operator(=) predefined(raw_input)operator(()operator(\))
@@ -8962,8 +8962,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# vbsh - very bad shell)
-keyword(import) ident(os)
-keyword(import) ident(readline)
+keyword(import) include(os)
+keyword(import) include(readline)
keyword(while) pre_constant(True)operator(:)
keyword(try)operator(:)
@@ -8984,7 +8984,7 @@ ident(readline)operator(.)ident(remove_history_item)operator(()ident(position)op
ident(line) operator(=) ident(readline)operator(.)ident(get_history_item)operator(()ident(index)operator(\))
comment(# an interactive python shell would be)
-keyword(import) ident(code)operator(,) ident(readline)
+keyword(import) include(code)operator(,) include(readline)
ident(code)operator(.)ident(InteractiveConsole)operator(()operator(\))operator(.)ident(interact)operator(()string<delimiter(")content(code.InteractiveConsole)delimiter(")>operator(\))
comment(# @@PLEAC@@_15.12)
@@ -8998,7 +8998,7 @@ comment(# http://pexpect.sourceforge.net/)
comment(# for more information, check pexpect's documentation and example.)
-keyword(import) ident(pexpect)
+keyword(import) include(pexpect)
comment(#----------------------------------------)
comment(# spawn program)
@@ -9016,7 +9016,7 @@ comment(# stop logging)
ident(command)operator(.)ident(setlog)operator(()pre_constant(None)operator(\))
comment(# log to stdout)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(command)operator(.)ident(setlog)operator(()ident(sys)operator(.)ident(stdout)operator(\))
comment(# log to specific file)
@@ -9034,7 +9034,7 @@ comment(# so it's the same thing)
ident(command)operator(.)ident(expect)operator(()string<delimiter(")content(Name.*:)delimiter(")>operator(\))
comment(# you can do it this way, too)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(regex) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(")content(Name.*:)delimiter(")>operator(\))
ident(command)operator(.)ident(expect)operator(()ident(regex)operator(\))
@@ -9074,7 +9074,7 @@ comment(# (that is, freeing file descriptor\))
ident(command)operator(.)ident(close)operator(()operator(\))
comment(# kill child process)
-keyword(import) ident(signal)
+keyword(import) include(signal)
ident(command)operator(.)ident(kill)operator(()ident(signal)operator(.)ident(SIGKILL)operator(\))
comment(#----------------------------------------)
@@ -9101,7 +9101,7 @@ comment(# 4: TIMEOUT)
comment(# 5: EOF)
comment(# @@PLEAC@@_15.14)
-keyword(from) ident(Tkinter) keyword(import) operator(*)
+keyword(from) include(Tkinter) keyword(import) include(*)
keyword(def) method(print_callback)operator(()operator(\))operator(:)
keyword(print) string<delimiter(")content(print_callback)delimiter(")>
@@ -9118,7 +9118,7 @@ ident(file_menu)operator(.)ident(add_command)operator(()ident(label)operator(=)s
ident(main)operator(.)ident(mainloop)operator(()operator(\))
comment(# using a class)
-keyword(from) ident(Tkinter) keyword(import) operator(*)
+keyword(from) include(Tkinter) keyword(import) include(*)
keyword(class) class(Application)operator(()ident(Tk)operator(\))operator(:)
keyword(def) method(print_callback)operator(()pre_constant(self)operator(\))operator(:)
@@ -9198,7 +9198,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_16.1)
-keyword(import) ident(popen2)
+keyword(import) include(popen2)
comment(# other popen methods than popen4 can lead to deadlocks)
comment(# if there is much data on stdout and stderr)
@@ -9221,12 +9221,12 @@ keyword(while) pre_constant(True)operator(:)
ident(output) operator(=) string<delimiter(')delimiter(')>operator(.)ident(join)operator(()ident(output)operator(\))
comment(# @@PLEAC@@_16.2)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(myfile) operator(=) string<delimiter(")content(foo.txt)delimiter(")>
ident(status) operator(=) ident(os)operator(.)ident(system)operator(()string<delimiter(")content(vi %s)delimiter(")> operator(%) ident(myfile)operator(\))
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(os)operator(.)ident(system)operator(()string<delimiter(")content(cmd1 args | cmd2 | cmd3 >outfile)delimiter(")>operator(\))
ident(os)operator(.)ident(system)operator(()string<delimiter(")content(cmd args <infile >outfile 2>errfile)delimiter(")>operator(\))
@@ -9238,9 +9238,9 @@ keyword(if) ident(status) operator(!=) integer(0)operator(:)
comment(# @@PLEAC@@_16.3)
comment(# -----------------------------)
-keyword(import) ident(os)
-keyword(import) ident(sys)
-keyword(import) ident(glob)
+keyword(import) include(os)
+keyword(import) include(sys)
+keyword(import) include(glob)
ident(args) operator(=) ident(glob)operator(.)ident(glob)operator(()string<delimiter(")content(*.data)delimiter(")>operator(\))
keyword(try)operator(:)
@@ -9261,8 +9261,8 @@ comment(# @@PLEAC@@_16.4)
comment(# -------------------------)
comment(# Read from a child process)
-keyword(import) ident(sys)
-keyword(import) ident(popen2)
+keyword(import) include(sys)
+keyword(import) include(popen2)
ident(pipe) operator(=) ident(popen2)operator(.)ident(Popen4)operator(()string<delimiter(")content(program arguments)delimiter(")>operator(\))
ident(pid) operator(=) ident(pipe)operator(.)ident(pid)
keyword(for) ident(line) keyword(in) ident(pipe)operator(.)ident(fromchild)operator(.)ident(readlines)operator(()operator(\))operator(:)
@@ -9278,7 +9278,7 @@ comment(# can use popen2.popen4(...\))
comment(# -----------------------------)
comment(# Write to a child process)
-keyword(import) ident(popen2)
+keyword(import) include(popen2)
ident(pipe) operator(=) ident(popen2)operator(.)ident(Popen4)operator(()string<delimiter(")content(gzip > foo.gz)delimiter(")>operator(\))
ident(pid) operator(=) ident(pipe)operator(.)ident(pid)
@@ -9329,7 +9329,7 @@ keyword(class) class(QuoteFilter)operator(()ident(OutputFilter)operator(\))opera
keyword(def) method(process)operator(()pre_constant(self)operator(,) ident(data)operator(\))operator(:)
keyword(return) string<delimiter(")content(> )delimiter(")> operator(+) ident(data)
-keyword(import) ident(sys)
+keyword(import) include(sys)
ident(f) operator(=) ident(HeadFilter)operator(()ident(sys)operator(.)ident(stdout)operator(,) integer(100)operator(\))
keyword(for) ident(i) keyword(in) predefined(range)operator(()integer(130)operator(\))operator(:)
keyword(print)operator(>>)ident(f)operator(,) ident(i)
@@ -9355,9 +9355,9 @@ comment(# @@PLEAC@@_16.6)
comment(# This script accepts several filenames)
comment(# as argument. If the file is zipped, unzip)
comment(# it first. Then read each line if the file)
-keyword(import) ident(os)
-keyword(import) ident(sys)
-keyword(import) ident(popen2)
+keyword(import) include(os)
+keyword(import) include(sys)
+keyword(import) include(popen2)
keyword(for) predefined(file) keyword(in) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(:)
keyword(if) predefined(file)operator(.)ident(endswith)operator(()string<delimiter(")content(.gz)delimiter(")>operator(\)) keyword(or) predefined(file)operator(.)ident(endswith)operator(()string<delimiter(")content(.Z)delimiter(")>operator(\))operator(:)
@@ -9373,7 +9373,7 @@ comment(#-----------------------------)
comment(#-----------------------------)
comment(# Ask for filename and open it)
-keyword(import) ident(sys)
+keyword(import) include(sys)
keyword(print) string<delimiter(")content(File, please?)delimiter(")>
ident(line) operator(=) ident(sys)operator(.)ident(stdin)operator(.)ident(readline)operator(()operator(\))
ident(file) operator(=) ident(line)operator(.)ident(strip)operator(()operator(\)) comment(# chomp)
@@ -9382,7 +9382,7 @@ predefined(open)operator(()predefined(file)operator(\))
comment(# @@PLEAC@@_16.7)
comment(# Execute foo_command and read the output)
-keyword(import) ident(popen2)
+keyword(import) include(popen2)
operator(()ident(stdout_err)operator(,) ident(stdin)operator(\)) operator(=) ident(popen2)operator(.)ident(popen4)operator(()string<delimiter(")content(foo_command)delimiter(")>operator(\))
keyword(for) ident(line) keyword(in) ident(stdout_err)operator(.)ident(readlines)operator(()operator(\))operator(:)
comment(# ....)
@@ -9391,7 +9391,7 @@ comment(# @@PLEAC@@_16.8)
comment(# Open command in a pipe)
comment(# which reads from stdin and writes to stdout)
-keyword(import) ident(popen2)
+keyword(import) include(popen2)
ident(pipe) operator(=) ident(popen2)operator(.)ident(Popen4)operator(()string<delimiter(")content(wc -l)delimiter(")>operator(\)) comment(# Unix command)
ident(pipe)operator(.)ident(tochild)operator(.)ident(write)operator(()string<delimiter(")content(line 1)char(\\n)content(line 2)char(\\n)content(line 3)char(\\n)delimiter(")>operator(\))
ident(pipe)operator(.)ident(tochild)operator(.)ident(close)operator(()operator(\))
@@ -9404,7 +9404,7 @@ comment(# Attetion: This can lead to deadlock,)
comment(# since the buffer of stderr or stdout might get filled.)
comment(# You need to use select if you want to avoid this.)
-keyword(import) ident(popen2)
+keyword(import) include(popen2)
operator(()ident(child_stdout)operator(,) ident(child_stdin)operator(,) ident(child_stderr)operator(\)) operator(=) ident(popen2)operator(.)ident(popen3)operator(()operator(...)operator(\))
comment(# @@PLEAC@@_16.10)
@@ -9424,7 +9424,7 @@ comment(#)
comment(# Print available signals and their value)
comment(# See "man signal" "man kill" on unix.)
-keyword(import) ident(signal)
+keyword(import) include(signal)
keyword(for) ident(name) keyword(in) predefined(dir)operator(()ident(signal)operator(\))operator(:)
keyword(if) ident(name)operator(.)ident(startswith)operator(()string<delimiter(")content(SIG)delimiter(")>operator(\))operator(:)
ident(value) operator(=) predefined(getattr)operator(()ident(signal)operator(,) ident(name)operator(\))
@@ -9436,7 +9436,7 @@ comment(# with os.kill(pid, signal\))
comment(# @@PLEAC@@_16.15)
-keyword(import) ident(signal)
+keyword(import) include(signal)
keyword(def) method(get_sig_quit)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:)
operator(...)operator(.)
@@ -9449,8 +9449,8 @@ ident(signal)operator(.)ident(signal)operator(()ident(signal)operator(.)ident(SI
comment(# @@PLEAC@@_16.16)
comment(# Example of handler: User must Enter Name ctrl-c does not help)
-keyword(import) ident(sys)
-keyword(import) ident(signal)
+keyword(import) include(sys)
+keyword(import) include(signal)
keyword(def) method(ding)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:)
keyword(print) string<delimiter(")char(\\a)content(Enter your name!)delimiter(")>
@@ -9473,7 +9473,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_16.18)
-keyword(import) ident(signal)
+keyword(import) include(signal)
comment(# ignore signal INT)
ident(signal)operator(.)ident(signal)operator(()ident(signal)operator(.)ident(SIGINT)operator(,) ident(signal)operator(.)ident(SIG_IGN)operator(\))
@@ -9493,7 +9493,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_16.21)
-keyword(import) ident(signal)
+keyword(import) include(signal)
keyword(def) method(handler)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:)
keyword(raise) string<delimiter(")content(timeout)delimiter(")>
@@ -9521,7 +9521,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_17.0)
comment(# Socket Programming (tcp/ip and udp/ip\))
-keyword(import) ident(socket)
+keyword(import) include(socket)
comment(# Convert human readable form to 32 bit value)
ident(packed_ip) operator(=) ident(socket)operator(.)ident(inet_aton)operator(()string<delimiter(")content(208.146.240.1)delimiter(")>operator(\))
@@ -9542,7 +9542,7 @@ comment(# Example: Connect to a server (tcp\))
comment(# Connect to a smtp server at localhost and send an email.)
comment(# For real applications you should use smtplib.)
-keyword(import) ident(socket)
+keyword(import) include(socket)
ident(s) operator(=) ident(socket)operator(.)ident(socket)operator(()ident(socket)operator(.)ident(AF_INET)operator(,) ident(socket)operator(.)ident(SOCK_STREAM)operator(\))
ident(s)operator(.)ident(connect)operator(()operator(()string<delimiter(")content(localhost)delimiter(")>operator(,) integer(25)operator(\))operator(\)) comment(# SMTP)
keyword(print) ident(s)operator(.)ident(recv)operator(()integer(1024)operator(\))
@@ -9561,8 +9561,8 @@ comment(# @@PLEAC@@_17.2)
comment(# Create a Server, calling handler for every client)
comment(# You can test it with "telnet localhost 1029")
-keyword(from) ident(SocketServer) keyword(import) ident(TCPServer)
-keyword(from) ident(SocketServer) keyword(import) ident(BaseRequestHandler)
+keyword(from) include(SocketServer) keyword(import) include(TCPServer)
+keyword(from) include(SocketServer) keyword(import) include(BaseRequestHandler)
keyword(class) class(MyHandler)operator(()ident(BaseRequestHandler)operator(\))operator(:)
keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:)
@@ -9574,9 +9574,9 @@ ident(server)operator(.)ident(serve_forever)operator(()operator(\))
comment(# @@PLEAC@@_17.3)
comment(# This is the continuation of 17.2)
-keyword(import) ident(time)
-keyword(from) ident(SocketServer) keyword(import) ident(TCPServer)
-keyword(from) ident(SocketServer) keyword(import) ident(BaseRequestHandler)
+keyword(import) include(time)
+keyword(from) include(SocketServer) keyword(import) include(TCPServer)
+keyword(from) include(SocketServer) keyword(import) include(BaseRequestHandler)
keyword(class) class(MyHandler)operator(()ident(BaseRequestHandler)operator(\))operator(:)
keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:)
@@ -9599,8 +9599,8 @@ ident(server)operator(.)ident(serve_forever)operator(()operator(\))
comment(# -----------------)
comment(# Using select)
-keyword(import) ident(select)
-keyword(import) ident(socket)
+keyword(import) include(select)
+keyword(import) include(socket)
ident(in_list) operator(=) operator([)operator(])
ident(in_list)operator(.)ident(append)operator(()ident(mysocket)operator(\))
@@ -9626,7 +9626,7 @@ comment(# Missing: setting TCP_NODELAY)
comment(# @@PLEAC@@_17.4)
-keyword(import) ident(socket)
+keyword(import) include(socket)
comment(# Set up a UDP socket)
ident(s) operator(=) ident(socket)operator(.)ident(socket)operator(()ident(socket)operator(.)ident(AF_INET)operator(,) ident(socket)operator(.)ident(SOCK_DGRAM)operator(\))
comment(# send )
@@ -9647,10 +9647,10 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# clockdrift - compare another system's clock with this one)
-keyword(import) ident(socket)
-keyword(import) ident(struct)
-keyword(import) ident(sys)
-keyword(import) ident(time)
+keyword(import) include(socket)
+keyword(import) include(struct)
+keyword(import) include(sys)
+keyword(import) include(time)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(>)integer(1)operator(:)
ident(him) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])
@@ -9671,8 +9671,8 @@ keyword(print) string<delimiter(")content(Clock on %s is %d seconds ahead of thi
comment(# @@PLEAC@@_17.5)
-keyword(import) ident(socket)
-keyword(import) ident(sys)
+keyword(import) include(socket)
+keyword(import) include(sys)
ident(s) operator(=) ident(socket)operator(.)ident(socket)operator(()ident(socket)operator(.)ident(AF_INET)operator(,) ident(socket)operator(.)ident(SOCK_DGRAM)operator(\))
keyword(try)operator(:)
@@ -9690,7 +9690,7 @@ keyword(while) pre_constant(True)operator(:)
ident(s)operator(.)ident(close)operator(()operator(\))
comment(# or )
-keyword(import) ident(SocketServer)
+keyword(import) include(SocketServer)
keyword(class) class(handler)operator(()ident(SocketServer)operator(.)ident(DatagramRequestHandler)operator(\))operator(:)
keyword(def) method(handle)operator(()pre_constant(self)operator(\))operator(:)
@@ -9703,7 +9703,7 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# udpqotd - UDP message server)
-keyword(import) ident(SocketServer)
+keyword(import) include(SocketServer)
ident(PORTNO) operator(=) integer(5151)
@@ -9724,8 +9724,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# udpmsg - send a message to the udpquotd server)
-keyword(import) ident(socket)
-keyword(import) ident(sys)
+keyword(import) include(socket)
+keyword(import) include(sys)
ident(MAXLEN) operator(=) integer(1024)
ident(PORTNO) operator(=) integer(5151)
@@ -9751,8 +9751,8 @@ ident(sock)operator(.)ident(close)operator(()operator(\))
comment(# @@PLEAC@@_17.6)
-keyword(import) ident(socket)
-keyword(import) ident(os)operator(,) ident(os)operator(.)ident(path)
+keyword(import) include(socket)
+keyword(import) include(os)operator(,) include(os.path)
keyword(if) ident(os)operator(.)ident(path)operator(.)ident(exists)operator(()string<delimiter(")content(/tmp/mysock)delimiter(")>operator(\))operator(:)
ident(os)operator(.)ident(remove)operator(()string<delimiter(")content(/tmp/mysock)delimiter(")>operator(\))
@@ -9777,11 +9777,11 @@ comment(# ['64.233.161.147','64.233.161.104', '64.233.161.99']\))
comment(# @@PLEAC@@_17.8)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(kernel)operator(,) ident(hostname)operator(,) ident(release)operator(,) ident(version)operator(,) ident(hardware) operator(=) ident(os)operator(.)ident(uname)operator(()operator(\))
-keyword(import) ident(socket)
+keyword(import) include(socket)
ident(address) operator(=) ident(socket)operator(.)ident(gethostbyname)operator(()ident(hostname)operator(\))
ident(hostname) operator(=) ident(socket)operator(.)ident(gethostbyaddr)operator(()ident(address)operator(\))
@@ -9830,10 +9830,10 @@ comment(# Restart programm on signal SIGHUP)
comment(# Script must be executable: chmod a+x foo.py)
comment(#!/usr/bin/env python)
-keyword(import) ident(os)
-keyword(import) ident(sys)
-keyword(import) ident(time)
-keyword(import) ident(signal)
+keyword(import) include(os)
+keyword(import) include(sys)
+keyword(import) include(time)
+keyword(import) include(signal)
keyword(def) method(phoenix)operator(()ident(signum)operator(,) ident(frame)operator(\))operator(:)
keyword(print) string<delimiter(")content(Restarting myself: %s %s)delimiter(")> operator(%) operator(()pre_constant(self)operator(,) ident(args)operator(\))
@@ -9849,7 +9849,7 @@ keyword(while) pre_constant(True)operator(:)
comment(#--------------------)
comment(# Read config file on SIGHUP)
-keyword(import) ident(signal)
+keyword(import) include(signal)
ident(config_file) operator(=) string<delimiter(")content(/usr/local/etc/myprog/server_conf.py)delimiter(")>
@@ -9862,7 +9862,7 @@ comment(# @@PLEAC@@_17.17)
comment(# chroot)
-keyword(import) ident(os)
+keyword(import) include(os)
keyword(try)operator(:)
ident(os)operator(.)ident(chroot)operator(()string<delimiter(")content(/var/daemon)delimiter(")>operator(\))
@@ -9875,7 +9875,7 @@ comment(# fork (Unix\): Create a new process)
comment(# if pid == 0 --> parent process)
comment(# else child process)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(pid) operator(=) ident(os)operator(.)ident(fork)operator(()operator(\))
keyword(if) ident(pid)operator(:)
@@ -9887,13 +9887,13 @@ keyword(else)operator(:)
comment(# ----------------------------)
comment(# setsid (Unix\): Create a new session)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(id)operator(=)ident(os)operator(.)ident(setsid)operator(()operator(\))
comment(# ----------------------------)
comment(# Work until INT TERM or HUP signal is received)
-keyword(import) ident(time)
-keyword(import) ident(signal)
+keyword(import) include(time)
+keyword(import) include(signal)
ident(time_to_die) operator(=) integer(0)
@@ -9916,7 +9916,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_18.1)
-keyword(import) ident(socket)
+keyword(import) include(socket)
keyword(try)operator(:)
ident(host_info) operator(=) ident(socket)operator(.)ident(gethostbyname_ex)operator(()ident(name)operator(\))
comment(# (hostname, aliaslist, ipaddrlist\))
@@ -9924,7 +9924,7 @@ keyword(except) ident(socket)operator(.)ident(gaierror)operator(,) ident(err)ope
keyword(print) string<delimiter(")content(Can't resolve hostname %s: %s)delimiter(")> operator(%) operator(()ident(name)operator(,) ident(err)operator([)integer(1)operator(])operator(\))
comment(# if you only need the first one)
-keyword(import) ident(socket)
+keyword(import) include(socket)
keyword(try)operator(:)
ident(address) operator(=) ident(socket)operator(.)ident(gethostbyname)operator(()ident(name)operator(\))
keyword(except) ident(socket)operator(.)ident(gaierror)operator(,) ident(err)operator(:)
@@ -9938,7 +9938,7 @@ keyword(except) ident(socket)operator(.)ident(gaierror)operator(,) ident(err)ope
keyword(print) string<delimiter(")content(Can't resolve address %s: %s)delimiter(")> operator(%) operator(()ident(address)operator(,) ident(err)operator([)integer(1)operator(])operator(\))
comment(# checking back)
-keyword(import) ident(socket)
+keyword(import) include(socket)
keyword(try)operator(:)
ident(host_info) operator(=) ident(socket)operator(.)ident(gethostbyaddr)operator(()ident(address)operator(\))
keyword(except) ident(socket)operator(.)ident(gaierror)operator(,) ident(err)operator(:)
@@ -9957,10 +9957,10 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# mxhost - find mx exchangers for a host)
-keyword(import) ident(sys)
+keyword(import) include(sys)
-keyword(import) ident(dns)
-keyword(import) ident(dns)operator(.)ident(resolver)
+keyword(import) include(dns)
+keyword(import) include(dns.resolver)
ident(answers) operator(=) ident(dns)operator(.)ident(resolver)operator(.)ident(query)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(,) string<delimiter(')content(MX)delimiter(')>operator(\))
keyword(for) ident(rdata) keyword(in) ident(answers)operator(:)
@@ -9972,8 +9972,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# hostaddrs - canonize name and show addresses)
-keyword(import) ident(sys)
-keyword(import) ident(socket)
+keyword(import) include(sys)
+keyword(import) include(socket)
ident(name) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])
ident(hent) operator(=) ident(socket)operator(.)ident(gethostbyname_ex)operator(()ident(name)operator(\))
keyword(print) string<delimiter(")content(%s aliases: %s => %s)delimiter(")> operator(%) operator(()
@@ -9983,7 +9983,7 @@ keyword(print) string<delimiter(")content(%s aliases: %s => %s)delimiter(")> ope
comment(# @@PLEAC@@_18.2)
-keyword(import) ident(ftplib)
+keyword(import) include(ftplib)
ident(ftp) operator(=) ident(ftplib)operator(.)ident(FTP)operator(()string<delimiter(")content(ftp.host.com)delimiter(")>operator(\))
ident(ftp)operator(.)ident(login)operator(()ident(username)operator(,) ident(password)operator(\))
ident(ftp)operator(.)ident(cwd)operator(()ident(directory)operator(\))
@@ -10002,8 +10002,8 @@ ident(ftp)operator(.)ident(quit)operator(()operator(\))
comment(# @@PLEAC@@_18.3)
-keyword(import) ident(smtplib)
-keyword(from) ident(email)operator(.)ident(MIMEText) keyword(import) ident(MIMEText)
+keyword(import) include(smtplib)
+keyword(from) include(email.MIMEText) keyword(import) include(MIMEText)
ident(msg) operator(=) ident(MIMEText)operator(()ident(body)operator(\))
ident(msg)operator([)string<delimiter(')content(From)delimiter(')>operator(]) operator(=) ident(from_address)
@@ -10015,7 +10015,7 @@ ident(mailer)operator(.)ident(connect)operator(()operator(\))
ident(mailer)operator(.)ident(sendmail)operator(()ident(from_address)operator(,) operator([)ident(to_address)operator(])operator(,) ident(msg)operator(.)ident(as_string)operator(()operator(\))operator(\))
comment(# @@PLEAC@@_18.4)
-keyword(import) ident(nntplib)
+keyword(import) include(nntplib)
comment(# You can except nntplib.NNTPError to process errors)
comment(# instead of displaying traceback.)
@@ -10036,7 +10036,7 @@ keyword(for) ident(group) keyword(in) ident(grouplist)operator(:)
keyword(pass) comment(# I can post to group)
comment(# @@PLEAC@@_18.5)
-keyword(import) ident(poplib)
+keyword(import) include(poplib)
ident(pop) operator(=) ident(poplib)operator(.)ident(POP3)operator(()string<delimiter(")content(mail.example.com)delimiter(")>operator(\))
ident(pop)operator(.)ident(user)operator(()ident(username)operator(\))
@@ -10052,7 +10052,7 @@ ident(pop)operator(.)ident(quit)operator(()operator(\))
comment(# @@PLEAC@@_18.6)
-keyword(import) ident(telnetlib)
+keyword(import) include(telnetlib)
ident(tn) operator(=) ident(telnetlib)operator(.)ident(Telnet)operator(()ident(hostname)operator(\))
@@ -10110,7 +10110,7 @@ comment(#-----------------------------)
comment(#!/usr/bin/env python)
comment(# hiweb - using FieldStorage class to get at form data)
-keyword(import) ident(cgi)
+keyword(import) include(cgi)
ident(form) operator(=) ident(cgi)operator(.)ident(FieldStorage)operator(()operator(\))
comment(# get a value from the form)
@@ -10126,7 +10126,7 @@ keyword(print) string<delimiter(")content(<P>You typed: <TT>%s</TT></P>)delimite
operator(\))
comment(#-----------------------------)
-keyword(import) ident(cgi)
+keyword(import) include(cgi)
ident(form) operator(=) ident(cgi)operator(.)ident(FieldStorage)operator(()operator(\))
ident(who) operator(=) ident(form)operator(.)ident(getvalue)operator(()string<delimiter(")content(Name)delimiter(")>operator(\))
@@ -10140,8 +10140,8 @@ comment(#-----------------------------)
comment(# Not Implemented)
comment(# To implement -EXPIRES => '+3d', I need to study about)
-keyword(import) ident(cgi)
-keyword(import) ident(datetime)
+keyword(import) include(cgi)
+keyword(import) include(datetime)
ident(time_format) operator(=) string<delimiter(")content(%a, %d %b %Y %H:%M:%S %Z)delimiter(")>
keyword(print) string<delimiter(")content(Expires: %s)delimiter(")> operator(%) operator(()
@@ -10212,15 +10212,15 @@ comment(# to the browser. It is defined as 'enable(display=True, logdir=None,)
comment(# context=5\)'.)
comment(# equivalent to importing CGI::Carp::fatalsToBrowser.)
-keyword(import) ident(cgitb)
+keyword(import) include(cgitb)
ident(cgitb)operator(.)ident(enable)operator(()operator(\))
comment(# to suppress browser output, you should explicitly say so.)
-keyword(import) ident(cgitb)
+keyword(import) include(cgitb)
ident(cgitb)operator(.)ident(enable)operator(()ident(display)operator(=)pre_constant(False)operator(\))
comment(# equivalent to call CGI::Carp::carpout with temporary files.)
-keyword(import) ident(cgitb)
+keyword(import) include(cgitb)
ident(cgitb)operator(.)ident(enable)operator(()ident(logdir)operator(=)string<delimiter(")content(/var/local/cgi-logs/)delimiter(")>operator(\))
comment(# Python exception, traceback facilities are much richer than PERL's)
@@ -10239,7 +10239,7 @@ comment(#)
comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# webwhoami - show web users id)
-keyword(import) ident(getpass)
+keyword(import) include(getpass)
keyword(print) string<delimiter(")content(Content-Type: text/plain)char(\\n)delimiter(")>
keyword(print) string<delimiter(")content(Running as %s)char(\\n)delimiter(")> operator(%) ident(getpass)operator(.)ident(getuser)operator(()operator(\))
@@ -10269,7 +10269,7 @@ operator(<)ident(Directory) operator(/)ident(some)operator(/)ident(directory)ope
operator(<)operator(/)ident(Directory)operator(>)
comment(# test.py file in /some/directory/htdocs/test)
-keyword(from) ident(mod_python) keyword(import) ident(apache)
+keyword(from) include(mod_python) keyword(import) include(apache)
keyword(def) method(handler)operator(()ident(req)operator(\))operator(:)
ident(req)operator(.)ident(write)operator(()string<delimiter(")content(Hello World!)delimiter(")>operator(\))
@@ -10277,7 +10277,7 @@ keyword(def) method(handler)operator(()ident(req)operator(\))operator(:)
comment(# @@PLEAC@@_19.6)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(os)operator(.)ident(system)operator(()string<delimiter(")content(command %s %s)delimiter(")> operator(%) operator(()predefined(input)operator(,) string<delimiter(")content( )delimiter(")>operator(.)ident(join)operator(()ident(files)operator(\))operator(\))operator(\)) comment(# UNSAFE)
comment(# python doc lib cgi-security it says)
@@ -10285,7 +10285,7 @@ comment(#)
comment(# To be on the safe side, if you must pass a string gotten from a form to a shell)
comment(# command, you should make sure the string contains only alphanumeric characters, dashes,)
comment(# underscores, and periods.)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(cmd) operator(=) string<delimiter(")content(command %s %s)delimiter(")> operator(%) operator(()predefined(input)operator(,) string<delimiter(")content( )delimiter(")>operator(.)ident(join)operator(()ident(files)operator(\))operator(\))
keyword(if) ident(re)operator(.)ident(search)operator(()string<modifier(r)delimiter(")content([^a-zA-Z0-9._)content(\\-)content(])delimiter(")>operator(,) ident(cmd)operator(\))operator(:)
keyword(print) string<delimiter(")content(rejected)delimiter(")>
@@ -10301,7 +10301,7 @@ comment(#-----------------------------)
comment(# This uses nevow's (http://nevow.com\) stan; there's no standard)
comment(# way to generate HTML, though there are many implementations of)
comment(# this basic idea.)
-keyword(from) ident(nevow) keyword(import) ident(tags) keyword(as) ident(T)
+keyword(from) include(nevow) keyword(import) include(tags) keyword(as) ident(T)
keyword(print) ident(T)operator(.)ident(ol)operator([)ident(T)operator(.)ident(li)operator([)string<delimiter(')content(red)delimiter(')>operator(])operator(,) ident(T)operator(.)ident(li)operator([)string<delimiter(')content(blue)delimiter(')>operator(])operator(,) ident(T)operator(.)ident(li)operator([)string<delimiter(')content(green)delimiter(')>operator(])operator(])
comment(# <ol><li>red</li><li>blue</li><li>green</li></ol>)
@@ -10358,8 +10358,8 @@ keyword(print) ident(T)operator(.)ident(table)operator([)
keyword(for) ident(k) keyword(in) predefined(sorted)operator(()ident(states)operator(.)ident(keys)operator(()operator(\))operator(\))operator(])operator(])
comment(#-----------------------------)
comment(# salcheck - check for salaries)
-keyword(import) ident(MySQLdb)
-keyword(import) ident(cgi)
+keyword(import) include(MySQLdb)
+keyword(import) include(cgi)
ident(form) operator(=) ident(cgi)operator(.)ident(FieldStorage)operator(()operator(\))
@@ -10407,8 +10407,8 @@ keyword(print) string<delimiter(")content(Location: %s)char(\\n)delimiter(")> op
keyword(raise) exception(SystemExit)
comment(#-----------------------------)
comment(# oreobounce - set a cookie and redirect the browser)
-keyword(import) ident(Cookie)
-keyword(import) ident(time)
+keyword(import) include(Cookie)
+keyword(import) include(time)
ident(c) operator(=) ident(Cookie)operator(.)ident(SimpleCookie)operator(()operator(\))
ident(c)operator([)string<delimiter(')content(filling)delimiter(')>operator(]) operator(=) string<delimiter(')content(vanilla cr?me)delimiter(')>
@@ -10433,7 +10433,7 @@ comment(# expires=Tue, 21-Jul-1998 11:58:55 GMT)
comment(#Location: http://somewhere.perl.com/nonesuch.html)
comment(#-----------------------------)
comment(# os_snipe - redirect to a Jargon File entry about current OS)
-keyword(import) ident(os)operator(,) ident(re)
+keyword(import) include(os)operator(,) include(re)
ident(dir) operator(=) string<delimiter(')content(http://www.wins.uva.nl/%7Emes/jargon)delimiter(')>
ident(matches) operator(=) operator([)
operator(()string<modifier(r)delimiter(')content(Mac)delimiter(')>operator(,) string<delimiter(')content(m/Macintrash.html)delimiter(')>operator(\))operator(,)
@@ -10464,7 +10464,7 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# dummyhttpd - start a HTTP daemon and print what the client sends)
-keyword(import) ident(SocketServer)
+keyword(import) include(SocketServer)
comment(# or use BaseHTTPServer, SimpleHTTPServer, CGIHTTPServer)
keyword(def) method(adr_str)operator(()ident(adr)operator(\))operator(:)
@@ -10489,7 +10489,7 @@ ident(server)operator(.)ident(server_close)operator(()operator(\))
comment(# @@PLEAC@@_19.10)
-keyword(import) ident(Cookie)
+keyword(import) include(Cookie)
ident(cookies) operator(=) ident(Cookie)operator(.)ident(SimpleCookie)operator(()operator(\))
comment(# SimpleCookie is more secure, but does not support all characters.)
ident(cookies)operator([)string<delimiter(")content(preference-name)delimiter(")>operator(]) operator(=) string<delimiter(")content(whatever you'd like)delimiter(")>
@@ -10499,10 +10499,10 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# ic_cookies - sample CGI script that uses a cookie)
-keyword(import) ident(cgi)
-keyword(import) ident(os)
-keyword(import) ident(Cookie)
-keyword(import) ident(datetime)
+keyword(import) include(cgi)
+keyword(import) include(os)
+keyword(import) include(Cookie)
+keyword(import) include(datetime)
ident(cookname) operator(=) string<delimiter(")content(favorite-ice-cream)delimiter(")> comment(# SimpleCookie does not support blanks)
ident(fieldname) operator(=) string<delimiter(")content(flavor)delimiter(")>
@@ -10551,7 +10551,7 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_19.13)
comment(#-----------------------------)
comment(# first open and exclusively lock the file)
-keyword(import) ident(os)operator(,) ident(cgi)operator(,) ident(fcntl)operator(,) ident(cPickle)
+keyword(import) include(os)operator(,) include(cgi)operator(,) include(fcntl)operator(,) include(cPickle)
ident(fh) operator(=) predefined(open)operator(()string<delimiter(')content(/tmp/formlog)delimiter(')>operator(,) string<delimiter(')content(ab)delimiter(')>operator(\))
ident(fcntl)operator(.)ident(flock)operator(()ident(fh)operator(.)ident(fileno)operator(()operator(\))operator(,) ident(fcntl)operator(.)ident(LOCK_EX)operator(\))
@@ -10562,7 +10562,7 @@ comment(# object\).)
ident(cPickle)operator(.)ident(dump)operator(()operator(()ident(form)operator(,) ident(os)operator(.)ident(environ)operator(.)ident(copy)operator(()operator(\))operator(\)) ident(fh)operator(\))
ident(fh)operator(.)ident(close)operator(()operator(\))
comment(#-----------------------------)
-keyword(import) ident(cgi)operator(,) ident(smtplib)operator(,) ident(sys)
+keyword(import) include(cgi)operator(,) include(smtplib)operator(,) include(sys)
ident(form) operator(=) ident(cgi)operator(.)ident(FieldStorage)operator(()operator(\))
ident(email) operator(=) string<delimiter(""")char(\\
@@ -10589,7 +10589,7 @@ comment(# @@INCOMPLETE@@ I don't get the point of these:)
comment(# param("_timestamp", scalar localtime\);)
comment(# param("_environs", %ENV\);)
comment(#-----------------------------)
-keyword(import) ident(fcntl)operator(,) ident(cPickle)
+keyword(import) include(fcntl)operator(,) include(cPickle)
ident(fh) operator(=) predefined(open)operator(()string<delimiter(')content(/tmp/formlog)delimiter(')>operator(,) string<delimiter(')content(rb)delimiter(')>operator(\))
ident(fcntl)operator(.)ident(flock)operator(()ident(fh)operator(.)ident(fileno)operator(()operator(\))operator(,) ident(fcntl)operator(.)ident(LOCK_SH)operator(\))
@@ -10612,11 +10612,11 @@ comment(# @@INCOMPLETE@@)
comment(# @@PLEAC@@_20.1)
comment(#-----------------------------)
-keyword(import) ident(urllib)
+keyword(import) include(urllib)
ident(content) operator(=) ident(urllib)operator(.)ident(urlopen)operator(()ident(url)operator(\))operator(.)ident(read)operator(()operator(\))
keyword(try)operator(:)
- keyword(import) ident(urllib)
+ keyword(import) include(urllib)
ident(content) operator(=) ident(urllib)operator(.)ident(urlopen)operator(()ident(url)operator(\))operator(.)ident(read)operator(()operator(\))
keyword(except) exception(IOError)operator(:)
keyword(print) string<delimiter(")content(could not get %s)delimiter(")> operator(%) ident(url)
@@ -10632,7 +10632,7 @@ comment(# * no URI::Heuristics)
comment(# * perl LWP supports fetching files from local system)
comment(# * fetching a title from ftp or file doesnt work in perl either.)
-keyword(import) ident(sys)operator(,) ident(urllib2)operator(,) ident(HTMLParser)
+keyword(import) include(sys)operator(,) include(urllib2)operator(,) include(HTMLParser)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(<=)integer(1)operator(:)
keyword(print) string<delimiter(")content(usage: %s url)delimiter(")> operator(%) ident(sys)operator(.)ident(argv)operator([)integer(0)operator(])
ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\))
@@ -10692,14 +10692,14 @@ comment(# omly bytes is in response.info(\))
comment(# @@PLEAC@@_20.2)
comment(# GET method)
-keyword(import) ident(httplib)
+keyword(import) include(httplib)
ident(conn) operator(=) ident(httplib)operator(.)ident(HTTPConnection)operator(()string<delimiter(')content(www.perl.com)delimiter(')>operator(\))
ident(conn)operator(.)ident(request)operator(()string<delimiter(')content(GET)delimiter(')>operator(,)string<delimiter(')content(/cgi-bin/cpan_mod?module=DB_File&readme=1)delimiter(')>operator(\))
ident(r1) operator(=) ident(conn)operator(.)ident(getresponse)operator(()operator(\))
ident(content) operator(=) ident(r1)operator(.)ident(read)operator(()operator(\))
comment(# POST method)
-keyword(import) ident(urllib)
+keyword(import) include(urllib)
ident(params) operator(=) ident(urllib)operator(.)ident(urlencode)operator(()operator({)string<delimiter(')content(module)delimiter(')>operator(:) string<delimiter(')content(DB_File)delimiter(')>operator(,) string<delimiter(')content(readme)delimiter(')>operator(:) integer(1)operator(})operator(\))
ident(content) operator(=) ident(urllib)operator(.)ident(urlopen)operator(()string<delimiter(')content(http://www.perl.com)delimiter(')>operator(,) ident(params)operator(\))operator(.)ident(read)operator(()operator(\))
@@ -10714,9 +10714,9 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# xurl - extract unique, sorted list of links from URL)
-keyword(from) ident(HTMLParser) keyword(import) ident(HTMLParser)
-keyword(import) ident(urllib)
-keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) comment(# not needed in 2.4)
+keyword(from) include(HTMLParser) keyword(import) include(HTMLParser)
+keyword(import) include(urllib)
+keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) comment(# not needed in 2.4)
keyword(class) class(myParser)operator(()ident(HTMLParser)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(url)operator(\))operator(:)
pre_constant(self)operator(.)ident(baseUrl) operator(=) ident(url)operator([)operator(:)ident(url)operator(.)ident(rfind)operator(()string<delimiter(')content(/)delimiter(')>operator(\))operator(])
@@ -10750,8 +10750,8 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# text2html - trivial html encoding of normal text)
-keyword(import) ident(sys)
-keyword(import) ident(re)
+keyword(import) include(sys)
+keyword(import) include(re)
comment(# precompile regular expressions)
ident(re_quoted) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content((?m\)^(>.*?\)$)delimiter(")>operator(\))
@@ -10776,8 +10776,8 @@ keyword(for) ident(para) keyword(in) predefined(open)operator(()ident(sys)operat
comment(#-----------------------------)
-keyword(import) ident(sys)operator(,) ident(re)
-keyword(import) ident(htmlentitydefs)
+keyword(import) include(sys)operator(,) include(re)
+keyword(import) include(htmlentitydefs)
keyword(def) method(encode_entities)operator(()ident(s)operator(\))operator(:)
keyword(for) ident(k)operator(,)ident(v) keyword(in) ident(htmlentitydefs)operator(.)ident(codepoint2name)operator(.)ident(items)operator(()operator(\))operator(:)
@@ -10799,12 +10799,12 @@ comment(# @@PLEAC@@_20.5)
comment(# Converting HTML to ASCII)
comment(#-----------------------------)
-keyword(import) ident(os)
+keyword(import) include(os)
ident(ascii) operator(=) ident(os)operator(.)ident(popen)operator(()string<delimiter(")content(lynx -dump )delimiter(")> operator(+) ident(filename)operator(\))operator(.)ident(read)operator(()operator(\))
comment(#-----------------------------)
-keyword(import) ident(formatter)
-keyword(import) ident(htmllib)
+keyword(import) include(formatter)
+keyword(import) include(htmllib)
ident(w) operator(=) ident(formatter)operator(.)ident(DumbWriter)operator(()operator(\))
ident(f) operator(=) ident(formatter)operator(.)ident(AbstractFormatter)operator(()ident(w)operator(\))
@@ -10824,12 +10824,12 @@ comment(# accumulating text instead of printing.)
comment(# @@PLEAC@@_20.6)
-keyword(import) ident(re)
+keyword(import) include(re)
ident(plain_text) operator(=) ident(re)operator(.)ident(sub)operator(()string<modifier(r)delimiter(")content(<[^>]*>)delimiter(")>operator(,)string<delimiter(")delimiter(")>operator(,)ident(html_text)operator(\)) comment(#WRONG)
comment(# using HTMLParser)
-keyword(import) ident(sys)operator(,) ident(HTMLParser)
+keyword(import) include(sys)operator(,) include(HTMLParser)
keyword(class) class(html)operator(()ident(HTMLParser)operator(.)ident(HTMLParser)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(\))operator(:)
@@ -10866,7 +10866,7 @@ comment(#!/usr/bin/python)
comment(# htitlebytes - get html title from URL)
comment(#)
-keyword(import) ident(sys)operator(,) ident(urllib2)operator(,) ident(HTMLParser)
+keyword(import) include(sys)operator(,) include(urllib2)operator(,) include(HTMLParser)
keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(<=)integer(1)operator(:)
keyword(print) string<delimiter(")content(usage: %s url ...)delimiter(")> operator(%) ident(sys)operator(.)ident(argv)operator([)integer(0)operator(])
ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\))
@@ -10916,10 +10916,10 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# churl - check urls)
-keyword(import) ident(sys)
+keyword(import) include(sys)
comment(# head request)
-keyword(import) ident(urllib)
+keyword(import) include(urllib)
keyword(def) method(valid)operator(()ident(url)operator(\))operator(:)
keyword(try)operator(:)
ident(conn) operator(=) ident(urllib)operator(.)ident(urlopen)operator(()ident(url)operator(\))
@@ -10928,8 +10928,8 @@ keyword(def) method(valid)operator(()ident(url)operator(\))operator(:)
keyword(return) integer(0)
comment(# parser class as in xurl)
-keyword(from) ident(HTMLParser) keyword(import) ident(HTMLParser)
-keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) comment(# not needed in 2.4)
+keyword(from) include(HTMLParser) keyword(import) include(HTMLParser)
+keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) comment(# not needed in 2.4)
keyword(class) class(myParser)operator(()ident(HTMLParser)operator(\))operator(:)
keyword(def) method(__init__)operator(()pre_constant(self)operator(,) ident(url)operator(\))operator(:)
pre_constant(self)operator(.)ident(baseUrl) operator(=) ident(url)operator([)operator(:)ident(url)operator(.)ident(rfind)operator(()string<delimiter(')content(/)delimiter(')>operator(\))operator(])
@@ -10971,9 +10971,9 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# surl - sort URLs by their last modification date)
-keyword(import) ident(urllib)
-keyword(import) ident(time)
-keyword(import) ident(sys)
+keyword(import) include(urllib)
+keyword(import) include(time)
+keyword(import) include(sys)
ident(Date) operator(=) operator({)operator(})
keyword(while) integer(1)operator(:)
@@ -10999,7 +10999,7 @@ keyword(for) ident(d) keyword(in) ident(dates)operator(:)
comment(# @@PLEAC@@_20.9)
-keyword(import) ident(re)
+keyword(import) include(re)
keyword(def) method(template)operator(()ident(filename)operator(,) ident(fillings)operator(\))operator(:)
ident(text) operator(=) predefined(open)operator(()ident(filename)operator(\))operator(.)ident(read)operator(()operator(\))
@@ -11018,10 +11018,10 @@ comment(# download the following standalone program)
comment(#!/usr/bin/python)
comment(# userrep1 - report duration of user logins using SQL database)
-keyword(import) ident(MySQLdb)
-keyword(import) ident(cgi)
-keyword(import) ident(re)
-keyword(import) ident(sys)
+keyword(import) include(MySQLdb)
+keyword(import) include(cgi)
+keyword(import) include(re)
+keyword(import) include(sys)
keyword(def) method(template)operator(()ident(filename)operator(,) ident(fillings)operator(\))operator(:)
ident(text) operator(=) predefined(open)operator(()ident(filename)operator(\))operator(.)ident(read)operator(()operator(\))
@@ -11073,7 +11073,7 @@ ident(LOGFILE) operator(=) operator([)
string<delimiter(')content(192.168.0.1 - - [04/Sep/2005:20:50:36 +0200] "GET /bus/libjs/layersmenu-library.js HTTP/1.1" 200 6228 "http://localhost/bus/" "Opera/8.02 (X11; Linux i686; U; en\)")char(\\n)delimiter(')>operator(,)
operator(])
-keyword(import) ident(re)
+keyword(import) include(re)
comment(# similar too perl version.)
ident(web_server_log_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(')content(^()content(\\S)content(+\) ()content(\\S)content(+\) ()content(\\S)content(+\) )content(\\[)content(([^:]+\):()content(\\d)content(+:)content(\\d)content(+:)content(\\d)content(+\) ([^)content(\\])content(]+\))content(\\])content( "()content(\\S)content(+\) (.*?\) ()content(\\S)content(+\)" ()content(\\S)content(+\) ()content(\\S)content(+\)$)delimiter(')>operator(\))