diff options
-rw-r--r-- | lib/coderay/scanners/python.rb | 49 | ||||
-rw-r--r-- | test/scanners/python/import.expected.raydebug | 26 | ||||
-rw-r--r-- | test/scanners/python/import.in.py | 26 | ||||
-rw-r--r-- | test/scanners/python/pleac.expected.raydebug | 846 | ||||
-rw-r--r-- | test/scanners/python/pygments.expected.raydebug | 846 | ||||
-rw-r--r-- | test/scanners/python/unistring.expected.raydebug | 4 |
6 files changed, 941 insertions, 856 deletions
diff --git a/lib/coderay/scanners/python.rb b/lib/coderay/scanners/python.rb index 47fba08..b0aa82a 100644 --- a/lib/coderay/scanners/python.rb +++ b/lib/coderay/scanners/python.rb @@ -61,6 +61,7 @@ module Scanners add(PREDEFINED_VARIABLES_AND_CONSTANTS, :pre_constant). add(PREDEFINED_EXCEPTIONS, :exception) + NAME = / [^\W\d] \w* /x ESCAPE = / [abfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} | N\{[-\w ]+\} /x @@ -84,9 +85,15 @@ module Scanners DEF_NEW_STATE = WordList.new(:initial). add(%w(def), :def_expected). - # add(%w(import from), :include_expected). + add(%w(import from), :include_expected). add(%w(class), :class_expected) + DESCRIPTOR = / + #{NAME} + (?: \. #{NAME} )* + | \* + /x + def scan_tokens tokens, options state = :initial @@ -94,6 +101,7 @@ module Scanners string_raw = false import_clause = class_name_follows = last_token_dot = false unicode = string.respond_to?(:encoding) && string.encoding.name == 'UTF-8' + from_import_state = [] until eos? @@ -124,8 +132,13 @@ module Scanners raise_inspect "else case \" reached; %p not handled." % peek(1), tokens, state end - elsif match = scan(/ [ \t]+ | \\?\n /x) + elsif match = scan(/ [ \t]+ | \\\n /x) + tokens << [match, :space] + next + + elsif match = scan(/\n/) tokens << [match, :space] + state = :initial if state == :include_expected next elsif match = scan(/ \# [^\n]* /mx) @@ -152,9 +165,8 @@ module Scanners # TODO: backticks - elsif match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) + elsif match = scan(unicode ? /#{NAME}/uo : /#{NAME}/o) kind = IDENT_KIND[match] - # TODO: from, import # TODO: keyword arguments kind = :ident if last_token_dot if kind == :old_keyword @@ -163,6 +175,7 @@ module Scanners kind = :ident elsif kind == :keyword state = DEF_NEW_STATE[match] + from_import_state << match.to_sym if state == :include_expected end elsif scan(/@[a-zA-Z0-9_.]+[lL]?/) @@ -199,7 +212,7 @@ module Scanners elsif state == :def_expected state = :initial - if match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) + if match = scan(unicode ? /#{NAME}/uo : /#{NAME}/o) kind = :method else next @@ -207,17 +220,37 @@ module Scanners elsif state == :class_expected state = :initial - if match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) + if match = scan(unicode ? /#{NAME}/uo : /#{NAME}/o) kind = :class else next end elsif state == :include_expected - state = :initial - if match = scan(unicode ? /[[:alpha:]_]\w*/ux : /[[:alpha:]_]\w*/x) + if match = scan(unicode ? /#{DESCRIPTOR}/uo : /#{DESCRIPTOR}/o) kind = :include + if match == 'as' + kind = :keyword + from_import_state << :as + elsif from_import_state.first == :from && match == 'import' + kind = :keyword + from_import_state << :import + elsif from_import_state.last == :as + # kind = match[0,1][unicode ? /[[:upper:]]/u : /[[:upper:]]/] ? :class : :method + kind = :ident + from_import_state.pop + elsif IDENT_KIND[match] == :keyword + unscan + match = nil + state = :initial + next + end + elsif match = scan(/,/) + from_import_state.pop if from_import_state.last == :as + kind = :operator else + from_import_state = [] + state = :initial next end diff --git a/test/scanners/python/import.expected.raydebug b/test/scanners/python/import.expected.raydebug new file mode 100644 index 0000000..d9b7097 --- /dev/null +++ b/test/scanners/python/import.expected.raydebug @@ -0,0 +1,26 @@ +keyword(import) include(YourModule) comment(# Import the module into my package) + comment(# (does not import any of its symbols\)) + +keyword(import) include(YourModule) keyword(as) ident(Module) comment(# Use a different name for the module) + +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) include(YourModule) keyword(import) include(name1)operator(,) include(name2)operator(,) include(xxx) + comment(# Import the named symbols from the module) + +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.) + +comment(#-----------------------------) +ident(__all__) operator(=) operator([)string<delimiter(")content(F1)delimiter(")>operator(,) string<delimiter(")content(F2)delimiter(")>operator(,) string<delimiter(")content(List)delimiter(")>operator(]) +comment(#-----------------------------) +ident(__all__) operator(=) operator([)string<delimiter(")content(Op_Func)delimiter(")>operator(,) string<delimiter(")content(Table)delimiter(")>operator(]) +comment(#-----------------------------) +keyword(from) include(YourModule) keyword(import) include(Op_Func)operator(,) include(Table)operator(,) include(F1) +comment(#-----------------------------) +keyword(from) include(YourModule) keyword(import) include(Functions)operator(,) include(Table)
\ No newline at end of file diff --git a/test/scanners/python/import.in.py b/test/scanners/python/import.in.py new file mode 100644 index 0000000..95dce3d --- /dev/null +++ b/test/scanners/python/import.in.py @@ -0,0 +1,26 @@ +import YourModule # Import the module into my package + # (does not import any of its symbols) + +import YourModule as Module # Use a different name for the module + +from YourModule import * # Import all module symbols not starting + # with an underscore (default); if __all__ + # is defined, only imports those symbols. + # Using this is discouraged unless the + # module is specifically designed for it. + +from YourModule import name1, name2, xxx + # Import the named symbols from the module + +from YourModule import name1 as name2 + # Import the named object, but use a + # different name to access it locally. + +#----------------------------- +__all__ = ["F1", "F2", "List"] +#----------------------------- +__all__ = ["Op_Func", "Table"] +#----------------------------- +from YourModule import Op_Func, Table, F1 +#----------------------------- +from YourModule import Functions, Table
\ No newline at end of file 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(\)) diff --git a/test/scanners/python/pygments.expected.raydebug b/test/scanners/python/pygments.expected.raydebug index 5d82bb0..b88398a 100644 --- a/test/scanners/python/pygments.expected.raydebug +++ b/test/scanners/python/pygments.expected.raydebug @@ -10,21 +10,21 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(os) -keyword(import) ident(sys) -keyword(from) ident(datetime) keyword(import) ident(datetime) -keyword(from) ident(cgi) keyword(import) ident(escape) +keyword(import) include(os) +keyword(import) include(sys) +keyword(from) include(datetime) keyword(import) include(datetime) +keyword(from) include(cgi) keyword(import) include(escape) -keyword(from) ident(docutils) keyword(import) ident(nodes) -keyword(from) ident(docutils)operator(.)ident(parsers)operator(.)ident(rst) keyword(import) ident(directives) -keyword(from) ident(docutils)operator(.)ident(core) keyword(import) ident(publish_parts) -keyword(from) ident(docutils)operator(.)ident(writers) keyword(import) ident(html4css1) +keyword(from) include(docutils) keyword(import) include(nodes) +keyword(from) include(docutils.parsers.rst) keyword(import) include(directives) +keyword(from) include(docutils.core) keyword(import) include(publish_parts) +keyword(from) include(docutils.writers) keyword(import) include(html4css1) -keyword(from) ident(jinja) keyword(import) ident(from_string) +keyword(from) include(jinja) keyword(import) include(from_string) -keyword(from) ident(pygments) keyword(import) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_by_name) -keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) +keyword(from) include(pygments) keyword(import) include(highlight) +keyword(from) include(pygments.lexers) keyword(import) include(get_lexer_by_name) +keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter) ident(LEXERDOC) operator(=) string<delimiter(''')content( @@ -37,7 +37,7 @@ ident(LEXERDOC) operator(=) string<delimiter(''')content( )delimiter(''')> keyword(def) method(generate_lexer_docs)operator(()operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(LEXERS) + keyword(from) include(pygments.lexers) keyword(import) include(LEXERS) ident(out) operator(=) operator([)operator(]) @@ -66,7 +66,7 @@ keyword(def) method(generate_lexer_docs)operator(()operator(\))operator(:) keyword(return) string<delimiter(')delimiter(')>operator(.)ident(join)operator(()ident(out)operator(\)) keyword(def) method(generate_formatter_docs)operator(()operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(FORMATTERS) + keyword(from) include(pygments.formatters) keyword(import) include(FORMATTERS) ident(out) operator(=) operator([)operator(]) keyword(for) ident(cls)operator(,) ident(data) keyword(in) predefined(sorted)operator(()ident(FORMATTERS)operator(.)ident(iteritems)operator(()operator(\))operator(,) @@ -83,7 +83,7 @@ keyword(def) method(generate_formatter_docs)operator(()operator(\))operator(:) keyword(return) string<delimiter(')delimiter(')>operator(.)ident(join)operator(()ident(out)operator(\)) keyword(def) method(generate_filter_docs)operator(()operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(filters) keyword(import) ident(FILTERS) + keyword(from) include(pygments.filters) keyword(import) include(FILTERS) ident(out) operator(=) operator([)operator(]) keyword(for) ident(name)operator(,) ident(cls) keyword(in) ident(FILTERS)operator(.)ident(iteritems)operator(()operator(\))operator(:) @@ -504,13 +504,13 @@ comment(# Set to True if you want inline CSS styles instead of classes) ident(INLINESTYLES) operator(=) pre_constant(False) -keyword(import) ident(re) +keyword(import) include(re) -keyword(from) ident(markdown) keyword(import) ident(TextPreprocessor) +keyword(from) include(markdown) keyword(import) include(TextPreprocessor) -keyword(from) ident(pygments) keyword(import) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_by_name)operator(,) ident(TextLexer) +keyword(from) include(pygments) keyword(import) include(highlight) +keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter) +keyword(from) include(pygments.lexers) keyword(import) include(get_lexer_by_name)operator(,) include(TextLexer) keyword(class) class(CodeBlockPreprocessor)operator(()ident(TextPreprocessor)operator(\))operator(:) @@ -578,12 +578,12 @@ comment(# Set to True if you want inline CSS styles instead of classes) ident(INLINESTYLES) operator(=) pre_constant(False) -keyword(import) ident(sys) +keyword(import) include(sys) -keyword(from) ident(pygments) keyword(import) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_by_name)operator(,) ident(get_lexer_for_filename)operator(,) ident(TextLexer) -keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(ClassNotFound) +keyword(from) include(pygments) keyword(import) include(highlight) +keyword(from) include(pygments.lexers) keyword(import) include(get_lexer_by_name)operator(,) include(get_lexer_for_filename)operator(,) include(TextLexer) +keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter) +keyword(from) include(pygments.util) keyword(import) include(ClassNotFound) comment(# wrap lines in <span>s so that the Moin-generated line numbers work) @@ -685,7 +685,7 @@ comment(# ~~~~~~~) comment(# Set to True if you want inline CSS styles instead of classes) ident(INLINESTYLES) operator(=) pre_constant(False) -keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) +keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter) comment(# The default formatter) ident(DEFAULT) operator(=) ident(HtmlFormatter)operator(()ident(noclasses)operator(=)ident(INLINESTYLES)operator(\)) @@ -696,11 +696,11 @@ ident(VARIANTS) operator(=) operator({) operator(}) -keyword(from) ident(docutils) keyword(import) ident(nodes) -keyword(from) ident(docutils)operator(.)ident(parsers)operator(.)ident(rst) keyword(import) ident(directives) +keyword(from) include(docutils) keyword(import) include(nodes) +keyword(from) include(docutils.parsers.rst) keyword(import) include(directives) -keyword(from) ident(pygments) keyword(import) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_by_name)operator(,) ident(TextLexer) +keyword(from) include(pygments) keyword(import) include(highlight) +keyword(from) include(pygments.lexers) keyword(import) include(get_lexer_by_name)operator(,) include(TextLexer) keyword(def) method(pygments_directive)operator(()ident(name)operator(,) ident(arguments)operator(,) ident(options)operator(,) ident(content)operator(,) ident(lineno)operator(,) ident(content_offset)operator(,) ident(block_text)operator(,) ident(state)operator(,) ident(state_machine)operator(\))operator(:) @@ -734,7 +734,7 @@ string<delimiter(""")content(Bootstrap setuptools installation)content( )content( )content(This file can also be run as a script to install or upgrade setuptools.)content( )delimiter(""")> -keyword(import) ident(sys) +keyword(import) include(sys) ident(DEFAULT_VERSION) operator(=) string<delimiter(")content(0.6c9)delimiter(")> ident(DEFAULT_URL) operator(=) string<delimiter(")content(http://pypi.python.org/packages/%s/s/setuptools/)delimiter(")> operator(%) ident(sys)operator(.)ident(version)operator([)operator(:)integer(3)operator(]) @@ -775,9 +775,9 @@ ident(md5_data) operator(=) operator({) string<delimiter(')content(setuptools-0.6c9-py2.6.egg)delimiter(')>operator(:) string<delimiter(')content(ca37b1ff16fa2ede6e19383e7b59245a)delimiter(')>operator(,) operator(}) -keyword(import) ident(sys)operator(,) ident(os) -keyword(try)operator(:) keyword(from) ident(hashlib) keyword(import) ident(md5) -keyword(except) exception(ImportError)operator(:) keyword(from) ident(md5) keyword(import) ident(md5) +keyword(import) include(sys)operator(,) include(os) +keyword(try)operator(:) keyword(from) include(hashlib) keyword(import) include(md5) +keyword(except) exception(ImportError)operator(:) keyword(from) include(md5) keyword(import) include(md5) keyword(def) method(_validate_md5)operator(()ident(egg_name)operator(,) ident(data)operator(\))operator(:) keyword(if) ident(egg_name) keyword(in) ident(md5_data)operator(:) @@ -809,9 +809,9 @@ operator(\))operator(:) keyword(def) method(do_download)operator(()operator(\))operator(:) ident(egg) operator(=) ident(download_setuptools)operator(()ident(version)operator(,) ident(download_base)operator(,) ident(to_dir)operator(,) ident(download_delay)operator(\)) ident(sys)operator(.)ident(path)operator(.)ident(insert)operator(()integer(0)operator(,) ident(egg)operator(\)) - keyword(import) ident(setuptools)operator(;) ident(setuptools)operator(.)ident(bootstrap_install_from) operator(=) ident(egg) + keyword(import) include(setuptools)operator(;) ident(setuptools)operator(.)ident(bootstrap_install_from) operator(=) ident(egg) keyword(try)operator(:) - keyword(import) ident(pkg_resources) + keyword(import) include(pkg_resources) keyword(except) exception(ImportError)operator(:) keyword(return) ident(do_download)operator(()operator(\)) keyword(try)operator(:) @@ -842,14 +842,14 @@ operator(\))operator(:) )content( with a '/'\). `to_dir` is the directory where the egg will be downloaded.)content( )content( `delay` is the number of seconds to pause before an actual download attempt.)content( )content( )delimiter(""")> - keyword(import) ident(urllib2)operator(,) ident(shutil) + keyword(import) include(urllib2)operator(,) include(shutil) ident(egg_name) operator(=) string<delimiter(")content(setuptools-%s-py%s.egg)delimiter(")> operator(%) operator(()ident(version)operator(,)ident(sys)operator(.)ident(version)operator([)operator(:)integer(3)operator(])operator(\)) ident(url) operator(=) ident(download_base) operator(+) ident(egg_name) ident(saveto) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(to_dir)operator(,) ident(egg_name)operator(\)) ident(src) operator(=) ident(dst) operator(=) pre_constant(None) keyword(if) keyword(not) ident(os)operator(.)ident(path)operator(.)ident(exists)operator(()ident(saveto)operator(\))operator(:) comment(# Avoid repeated downloads) keyword(try)operator(:) - keyword(from) ident(distutils) keyword(import) ident(log) + keyword(from) include(distutils) keyword(import) include(log) keyword(if) ident(delay)operator(:) ident(log)operator(.)ident(warn)operator(()string<delimiter(""")content( )content(---------------------------------------------------------------------------)content( @@ -866,7 +866,7 @@ operator(\))operator(:) )content(and place it in this directory before rerunning this script.\))content( )content(---------------------------------------------------------------------------)delimiter(""")>operator(,) ident(version)operator(,) ident(download_base)operator(,) ident(delay)operator(,) ident(url) - operator(\))operator(;) keyword(from) ident(time) keyword(import) ident(sleep)operator(;) ident(sleep)operator(()ident(delay)operator(\)) + operator(\))operator(;) keyword(from) include(time) keyword(import) include(sleep)operator(;) ident(sleep)operator(()ident(delay)operator(\)) ident(log)operator(.)ident(warn)operator(()string<delimiter(")content(Downloading %s)delimiter(")>operator(,) ident(url)operator(\)) ident(src) operator(=) ident(urllib2)operator(.)ident(urlopen)operator(()ident(url)operator(\)) comment(# Read/write all in one block, so we don't create a corrupt file) @@ -916,13 +916,13 @@ operator(\))operator(:) keyword(def) method(main)operator(()ident(argv)operator(,) ident(version)operator(=)ident(DEFAULT_VERSION)operator(\))operator(:) string<delimiter(""")content(Install or upgrade setuptools and EasyInstall)delimiter(""")> keyword(try)operator(:) - keyword(import) ident(setuptools) + keyword(import) include(setuptools) keyword(except) exception(ImportError)operator(:) ident(egg) operator(=) pre_constant(None) keyword(try)operator(:) ident(egg) operator(=) ident(download_setuptools)operator(()ident(version)operator(,) ident(delay)operator(=)integer(0)operator(\)) ident(sys)operator(.)ident(path)operator(.)ident(insert)operator(()integer(0)operator(,)ident(egg)operator(\)) - keyword(from) ident(setuptools)operator(.)ident(command)operator(.)ident(easy_install) keyword(import) ident(main) + keyword(from) include(setuptools.command.easy_install) keyword(import) include(main) keyword(return) ident(main)operator(()predefined(list)operator(()ident(argv)operator(\))operator(+)operator([)ident(egg)operator(])operator(\)) comment(# we're done here) keyword(finally)operator(:) keyword(if) ident(egg) keyword(and) ident(os)operator(.)ident(path)operator(.)ident(exists)operator(()ident(egg)operator(\))operator(:) @@ -936,19 +936,19 @@ keyword(def) method(main)operator(()ident(argv)operator(,) ident(version)operato ident(sys)operator(.)ident(exit)operator(()integer(2)operator(\)) ident(req) operator(=) string<delimiter(")content(setuptools>=)delimiter(")>operator(+)ident(version) - keyword(import) ident(pkg_resources) + keyword(import) include(pkg_resources) keyword(try)operator(:) ident(pkg_resources)operator(.)ident(require)operator(()ident(req)operator(\)) keyword(except) ident(pkg_resources)operator(.)ident(VersionConflict)operator(:) keyword(try)operator(:) - keyword(from) ident(setuptools)operator(.)ident(command)operator(.)ident(easy_install) keyword(import) ident(main) + keyword(from) include(setuptools.command.easy_install) keyword(import) include(main) keyword(except) exception(ImportError)operator(:) - keyword(from) ident(easy_install) keyword(import) ident(main) + keyword(from) include(easy_install) keyword(import) include(main) ident(main)operator(()predefined(list)operator(()ident(argv)operator(\))operator(+)operator([)ident(download_setuptools)operator(()ident(delay)operator(=)integer(0)operator(\))operator(])operator(\)) ident(sys)operator(.)ident(exit)operator(()integer(0)operator(\)) comment(# try to force an exit) keyword(else)operator(:) keyword(if) ident(argv)operator(:) - keyword(from) ident(setuptools)operator(.)ident(command)operator(.)ident(easy_install) keyword(import) ident(main) + keyword(from) include(setuptools.command.easy_install) keyword(import) include(main) ident(main)operator(()ident(argv)operator(\)) keyword(else)operator(:) keyword(print) string<delimiter(")content(Setuptools version)delimiter(")>operator(,)ident(version)operator(,)string<delimiter(")content(or greater has been installed.)delimiter(")> @@ -957,7 +957,7 @@ keyword(def) method(main)operator(()ident(argv)operator(,) ident(version)operato keyword(def) method(update_md5)operator(()ident(filenames)operator(\))operator(:) string<delimiter(""")content(Update our built-in md5 registry)delimiter(""")> - keyword(import) ident(re) + keyword(import) include(re) keyword(for) ident(name) keyword(in) ident(filenames)operator(:) ident(base) operator(=) ident(os)operator(.)ident(path)operator(.)ident(basename)operator(()ident(name)operator(\)) @@ -969,7 +969,7 @@ keyword(def) method(update_md5)operator(()ident(filenames)operator(\))operator(: ident(data)operator(.)ident(sort)operator(()operator(\)) ident(repl) operator(=) string<delimiter(")delimiter(")>operator(.)ident(join)operator(()ident(data)operator(\)) - keyword(import) ident(inspect) + keyword(import) include(inspect) ident(srcfile) operator(=) ident(inspect)operator(.)ident(getsourcefile)operator(()ident(sys)operator(.)ident(modules)operator([)ident(__name__)operator(])operator(\)) ident(f) operator(=) predefined(open)operator(()ident(srcfile)operator(,) string<delimiter(')content(rb)delimiter(')>operator(\))operator(;) ident(src) operator(=) ident(f)operator(.)ident(read)operator(()operator(\))operator(;) ident(f)operator(.)ident(close)operator(()operator(\)) @@ -1027,9 +1027,9 @@ ident(__docformat__) operator(=) string<delimiter(')content(restructuredtext)del ident(__all__) operator(=) operator([)string<delimiter(')content(lex)delimiter(')>operator(,) string<delimiter(')content(format)delimiter(')>operator(,) string<delimiter(')content(highlight)delimiter(')>operator(]) -keyword(import) ident(sys)operator(,) ident(os) +keyword(import) include(sys)operator(,) include(os) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(StringIO)operator(,) ident(BytesIO) +keyword(from) include(pygments.util) keyword(import) include(StringIO)operator(,) include(BytesIO) keyword(def) method(lex)operator(()ident(code)operator(,) ident(lexer)operator(\))operator(:) @@ -1082,7 +1082,7 @@ keyword(def) method(highlight)operator(()ident(code)operator(,) ident(lexer)oper keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) - keyword(from) ident(pygments)operator(.)ident(cmdline) keyword(import) ident(main) + keyword(from) include(pygments.cmdline) keyword(import) include(main) ident(sys)operator(.)ident(exit)operator(()ident(main)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(\)) comment(# -*- coding: utf-8 -*-) string<delimiter(""")content( @@ -1094,19 +1094,19 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys) -keyword(import) ident(getopt) -keyword(from) ident(textwrap) keyword(import) ident(dedent) +keyword(import) include(sys) +keyword(import) include(getopt) +keyword(from) include(textwrap) keyword(import) include(dedent) -keyword(from) ident(pygments) keyword(import) ident(__version__)operator(,) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(ClassNotFound)operator(,) ident(OptionError)operator(,) ident(docstring_headline) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_all_lexers)operator(,) ident(get_lexer_by_name)operator(,) ident(get_lexer_for_filename)operator(,) \ - ident(find_lexer_class)operator(,) ident(guess_lexer)operator(,) ident(TextLexer) -keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(get_all_formatters)operator(,) ident(get_formatter_by_name)operator(,) \ - ident(get_formatter_for_filename)operator(,) ident(find_formatter_class)operator(,) \ - ident(TerminalFormatter) comment(# pylint:disable-msg=E0611) -keyword(from) ident(pygments)operator(.)ident(filters) keyword(import) ident(get_all_filters)operator(,) ident(find_filter_class) -keyword(from) ident(pygments)operator(.)ident(styles) keyword(import) ident(get_all_styles)operator(,) ident(get_style_by_name) +keyword(from) include(pygments) keyword(import) include(__version__)operator(,) include(highlight) +keyword(from) include(pygments.util) keyword(import) include(ClassNotFound)operator(,) include(OptionError)operator(,) include(docstring_headline) +keyword(from) include(pygments.lexers) keyword(import) include(get_all_lexers)operator(,) include(get_lexer_by_name)operator(,) include(get_lexer_for_filename)operator(,) \ + include(find_lexer_class)operator(,) include(guess_lexer)operator(,) include(TextLexer) +keyword(from) include(pygments.formatters) keyword(import) include(get_all_formatters)operator(,) include(get_formatter_by_name)operator(,) \ + include(get_formatter_for_filename)operator(,) include(find_formatter_class)operator(,) \ + include(TerminalFormatter) comment(# pylint:disable-msg=E0611) +keyword(from) include(pygments.filters) keyword(import) include(get_all_filters)operator(,) include(find_filter_class) +keyword(from) include(pygments.styles) keyword(import) include(get_all_styles)operator(,) include(get_style_by_name) ident(USAGE) operator(=) string<delimiter(""")char(\\ @@ -1502,7 +1502,7 @@ keyword(def) method(main)operator(()ident(args)operator(=)ident(sys)operator(.)i ident(lexer)operator(.)ident(add_filter)operator(()ident(fname)operator(,) operator(**)ident(fopts)operator(\)) ident(highlight)operator(()ident(code)operator(,) ident(lexer)operator(,) ident(fmter)operator(,) ident(outfile)operator(\)) keyword(except) exception(Exception)operator(,) ident(err)operator(:) - keyword(import) ident(traceback) + keyword(import) include(traceback) ident(info) operator(=) ident(traceback)operator(.)ident(format_exception)operator(()operator(*)ident(sys)operator(.)ident(exc_info)operator(()operator(\))operator(\)) ident(msg) operator(=) ident(info)operator([)operator(-)integer(1)operator(])operator(.)ident(strip)operator(()operator(\)) keyword(if) predefined(len)operator(()ident(info)operator(\)) operator(>=) integer(3)operator(:) @@ -1676,15 +1676,15 @@ string<delimiter(""")content( keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(import) ident(re) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(String)operator(,) ident(Comment)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(Error)operator(,) ident(Whitespace)operator(,) \ - ident(string_to_tokentype) -keyword(from) ident(pygments)operator(.)ident(filter) keyword(import) ident(Filter) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_list_opt)operator(,) ident(get_int_opt)operator(,) ident(get_bool_opt)operator(,) ident(get_choice_opt)operator(,) \ - ident(ClassNotFound)operator(,) ident(OptionError) -keyword(from) ident(pygments)operator(.)ident(plugin) keyword(import) ident(find_plugin_filters) +keyword(import) include(re) +keyword(from) include(pygments.token) keyword(import) include(String)operator(,) include(Comment)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(Error)operator(,) include(Whitespace)operator(,) \ + include(string_to_tokentype) +keyword(from) include(pygments.filter) keyword(import) include(Filter) +keyword(from) include(pygments.util) keyword(import) include(get_list_opt)operator(,) include(get_int_opt)operator(,) include(get_bool_opt)operator(,) include(get_choice_opt)operator(,) \ + include(ClassNotFound)operator(,) include(OptionError) +keyword(from) include(pygments.plugin) keyword(import) include(find_plugin_filters) keyword(def) method(find_filter_class)operator(()ident(filtername)operator(\))operator(:) @@ -1965,10 +1965,10 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(codecs) +keyword(import) include(codecs) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt) -keyword(from) ident(pygments)operator(.)ident(styles) keyword(import) ident(get_style_by_name) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt) +keyword(from) include(pygments.styles) keyword(import) include(get_style_by_name) ident(__all__) operator(=) operator([)string<delimiter(')content(Formatter)delimiter(')>operator(]) @@ -2056,12 +2056,12 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(os)operator(.)ident(path) -keyword(import) ident(fnmatch) +keyword(import) include(os.path) +keyword(import) include(fnmatch) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(_mapping) keyword(import) ident(FORMATTERS) -keyword(from) ident(pygments)operator(.)ident(plugin) keyword(import) ident(find_plugin_formatters) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(docstring_headline)operator(,) ident(ClassNotFound) +keyword(from) include(pygments.formatters._mapping) keyword(import) include(FORMATTERS) +keyword(from) include(pygments.plugin) keyword(import) include(find_plugin_formatters) +keyword(from) include(pygments.util) keyword(import) include(docstring_headline)operator(,) include(ClassNotFound) ident(ns) operator(=) predefined(globals)operator(()operator(\)) keyword(for) ident(fcls) keyword(in) ident(FORMATTERS)operator(:) @@ -2129,22 +2129,22 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(docstring_headline) +keyword(from) include(pygments.util) keyword(import) include(docstring_headline) comment(# start) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(bbcode) keyword(import) ident(BBCodeFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(html) keyword(import) ident(HtmlFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(img) keyword(import) ident(BmpImageFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(img) keyword(import) ident(GifImageFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(img) keyword(import) ident(ImageFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(img) keyword(import) ident(JpgImageFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(latex) keyword(import) ident(LatexFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(other) keyword(import) ident(NullFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(other) keyword(import) ident(RawTokenFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(rtf) keyword(import) ident(RtfFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(svg) keyword(import) ident(SvgFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(terminal) keyword(import) ident(TerminalFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(terminal256) keyword(import) ident(Terminal256Formatter) +keyword(from) include(pygments.formatters.bbcode) keyword(import) include(BBCodeFormatter) +keyword(from) include(pygments.formatters.html) keyword(import) include(HtmlFormatter) +keyword(from) include(pygments.formatters.img) keyword(import) include(BmpImageFormatter) +keyword(from) include(pygments.formatters.img) keyword(import) include(GifImageFormatter) +keyword(from) include(pygments.formatters.img) keyword(import) include(ImageFormatter) +keyword(from) include(pygments.formatters.img) keyword(import) include(JpgImageFormatter) +keyword(from) include(pygments.formatters.latex) keyword(import) include(LatexFormatter) +keyword(from) include(pygments.formatters.other) keyword(import) include(NullFormatter) +keyword(from) include(pygments.formatters.other) keyword(import) include(RawTokenFormatter) +keyword(from) include(pygments.formatters.rtf) keyword(import) include(RtfFormatter) +keyword(from) include(pygments.formatters.svg) keyword(import) include(SvgFormatter) +keyword(from) include(pygments.formatters.terminal) keyword(import) include(TerminalFormatter) +keyword(from) include(pygments.formatters.terminal256) keyword(import) include(Terminal256Formatter) ident(FORMATTERS) operator(=) operator({) ident(BBCodeFormatter)operator(:) operator(()string<delimiter(')content(BBCode)delimiter(')>operator(,) operator(()string<delimiter(')content(bbcode)delimiter(')>operator(,) string<delimiter(')content(bb)delimiter(')>operator(\))operator(,) operator(()operator(\))operator(,) string<delimiter(')content(Format tokens with BBcodes. These formatting codes are used by many bulletin boards, so you can highlight your sourcecode with pygments before posting it there.)delimiter(')>operator(\))operator(,) @@ -2163,8 +2163,8 @@ ident(FORMATTERS) operator(=) operator({) operator(}) keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) - keyword(import) ident(sys) - keyword(import) ident(os) + keyword(import) include(sys) + keyword(import) include(os) comment(# lookup formatters) ident(found_formatters) operator(=) operator([)operator(]) @@ -2218,8 +2218,8 @@ string<delimiter(""")content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt) ident(__all__) operator(=) operator([)string<delimiter(')content(BBCodeFormatter)delimiter(')>operator(]) @@ -2325,17 +2325,17 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys)operator(,) ident(os) -keyword(import) ident(StringIO) +keyword(import) include(sys)operator(,) include(os) +keyword(import) include(StringIO) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Token)operator(,) ident(Text)operator(,) ident(STANDARD_TYPES) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_int_opt)operator(,) ident(get_list_opt)operator(,) predefined(bytes) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) +keyword(from) include(pygments.token) keyword(import) include(Token)operator(,) include(Text)operator(,) include(STANDARD_TYPES) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_int_opt)operator(,) include(get_list_opt)operator(,) include(bytes) ident(__all__) operator(=) operator([)string<delimiter(')content(HtmlFormatter)delimiter(')>operator(]) @@ -2352,12 +2352,12 @@ keyword(def) method(escape_html)operator(()ident(text)operator(\))operator(:) keyword(def) method(get_random_id)operator(()operator(\))operator(:) string<delimiter(""")content(Return a random id for javascript fields.)delimiter(""")> - keyword(from) ident(random) keyword(import) ident(random) - keyword(from) ident(time) keyword(import) ident(time) + keyword(from) include(random) keyword(import) include(random) + keyword(from) include(time) keyword(import) include(time) keyword(try)operator(:) - keyword(from) ident(hashlib) keyword(import) ident(sha1) keyword(as) ident(sha) + keyword(from) include(hashlib) keyword(import) include(sha1) keyword(as) ident(sha) keyword(except) exception(ImportError)operator(:) - keyword(import) ident(sha) + keyword(import) include(sha) ident(sha) operator(=) ident(sha)operator(.)ident(new) keyword(return) ident(sha)operator(()string<delimiter(')content(%s|%s)delimiter(')> operator(%) operator(()ident(random)operator(()operator(\))operator(,) ident(time)operator(()operator(\))operator(\))operator(\))operator(.)ident(hexdigest)operator(()operator(\)) @@ -3031,21 +3031,21 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys) -keyword(from) ident(commands) keyword(import) ident(getstatusoutput) +keyword(import) include(sys) +keyword(from) include(commands) keyword(import) include(getstatusoutput) -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_int_opt)operator(,) ident(get_choice_opt) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_int_opt)operator(,) include(get_choice_opt) comment(# Import this carefully) keyword(try)operator(:) - keyword(import) ident(Image)operator(,) ident(ImageDraw)operator(,) ident(ImageFont) + keyword(import) include(Image)operator(,) include(ImageDraw)operator(,) include(ImageFont) ident(pil_available) operator(=) pre_constant(True) keyword(except) exception(ImportError)operator(:) ident(pil_available) operator(=) pre_constant(False) keyword(try)operator(:) - keyword(import) ident(_winreg) + keyword(import) include(_winreg) keyword(except) exception(ImportError)operator(:) ident(_winreg) operator(=) pre_constant(None) @@ -3548,9 +3548,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Token)operator(,) ident(STANDARD_TYPES) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_int_opt)operator(,) ident(StringIO) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) +keyword(from) include(pygments.token) keyword(import) include(Token)operator(,) include(STANDARD_TYPES) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_int_opt)operator(,) include(StringIO) ident(__all__) operator(=) operator([)string<delimiter(')content(LatexFormatter)delimiter(')>operator(]) @@ -3852,10 +3852,10 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(OptionError)operator(,) ident(get_choice_opt)operator(,) ident(b) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Token) -keyword(from) ident(pygments)operator(.)ident(console) keyword(import) ident(colorize) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) +keyword(from) include(pygments.util) keyword(import) include(OptionError)operator(,) include(get_choice_opt)operator(,) include(b) +keyword(from) include(pygments.token) keyword(import) include(Token) +keyword(from) include(pygments.console) keyword(import) include(colorize) ident(__all__) operator(=) operator([)string<delimiter(')content(NullFormatter)delimiter(')>operator(,) string<delimiter(')content(RawTokenFormatter)delimiter(')>operator(]) @@ -3927,13 +3927,13 @@ keyword(class) class(RawTokenFormatter)operator(()ident(Formatter)operator(\))op keyword(raise) exception(TypeError)operator(()string<delimiter(')content(The raw tokens formatter needs a binary )delimiter(')> string<delimiter(')content(output file)delimiter(')>operator(\)) keyword(if) pre_constant(self)operator(.)ident(compress) operator(==) string<delimiter(')content(gz)delimiter(')>operator(:) - keyword(import) ident(gzip) + keyword(import) include(gzip) ident(outfile) operator(=) ident(gzip)operator(.)ident(GzipFile)operator(()string<delimiter(')delimiter(')>operator(,) string<delimiter(')content(wb)delimiter(')>operator(,) integer(9)operator(,) ident(outfile)operator(\)) keyword(def) method(write)operator(()ident(text)operator(\))operator(:) ident(outfile)operator(.)ident(write)operator(()ident(text)operator(.)ident(encode)operator(()operator(\))operator(\)) ident(flush) operator(=) ident(outfile)operator(.)ident(flush) keyword(elif) pre_constant(self)operator(.)ident(compress) operator(==) string<delimiter(')content(bz2)delimiter(')>operator(:) - keyword(import) ident(bz2) + keyword(import) include(bz2) ident(compressor) operator(=) ident(bz2)operator(.)ident(BZ2Compressor)operator(()integer(9)operator(\)) keyword(def) method(write)operator(()ident(text)operator(\))operator(:) ident(outfile)operator(.)ident(write)operator(()ident(compressor)operator(.)ident(compress)operator(()ident(text)operator(.)ident(encode)operator(()operator(\))operator(\))operator(\)) @@ -3969,7 +3969,7 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) ident(__all__) operator(=) operator([)string<delimiter(')content(RtfFormatter)delimiter(')>operator(]) @@ -4105,8 +4105,8 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_int_opt) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_int_opt) ident(__all__) operator(=) operator([)string<delimiter(')content(SvgFormatter)delimiter(')>operator(]) @@ -4259,11 +4259,11 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Token)operator(,) ident(Whitespace) -keyword(from) ident(pygments)operator(.)ident(console) keyword(import) ident(ansiformat) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_choice_opt) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Token)operator(,) include(Whitespace) +keyword(from) include(pygments.console) keyword(import) include(ansiformat) +keyword(from) include(pygments.util) keyword(import) include(get_choice_opt) ident(__all__) operator(=) operator([)string<delimiter(')content(TerminalFormatter)delimiter(')>operator(]) @@ -4383,7 +4383,7 @@ comment(# xterm. This means that default colors are white-on-black, not) comment(# black-on-while, so colors like "white background" need to be converted) comment(# to "white background, black foreground", etc...) -keyword(from) ident(pygments)operator(.)ident(formatter) keyword(import) ident(Formatter) +keyword(from) include(pygments.formatter) keyword(import) include(Formatter) ident(__all__) operator(=) operator([)string<delimiter(')content(Terminal256Formatter)delimiter(')>operator(]) @@ -4586,18 +4586,18 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(filter) keyword(import) ident(apply_filters)operator(,) ident(Filter) -keyword(from) ident(pygments)operator(.)ident(filters) keyword(import) ident(get_filter_by_name) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Error)operator(,) ident(Text)operator(,) ident(Other)operator(,) ident(_TokenType) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_int_opt)operator(,) ident(get_list_opt)operator(,) \ - ident(make_analysator) +keyword(from) include(pygments.filter) keyword(import) include(apply_filters)operator(,) include(Filter) +keyword(from) include(pygments.filters) keyword(import) include(get_filter_by_name) +keyword(from) include(pygments.token) keyword(import) include(Error)operator(,) include(Text)operator(,) include(Other)operator(,) include(_TokenType) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_int_opt)operator(,) include(get_list_opt)operator(,) \ + include(make_analysator) ident(__all__) operator(=) operator([)string<delimiter(')content(Lexer)delimiter(')>operator(,) string<delimiter(')content(RegexLexer)delimiter(')>operator(,) string<delimiter(')content(ExtendedRegexLexer)delimiter(')>operator(,) string<delimiter(')content(DelegatingLexer)delimiter(')>operator(,) @@ -4715,7 +4715,7 @@ keyword(class) class(Lexer)operator(()predefined(object)operator(\))operator(:) ident(text) operator(=) ident(text)operator(.)ident(decode)operator(()string<delimiter(')content(latin1)delimiter(')>operator(\)) keyword(elif) pre_constant(self)operator(.)ident(encoding) operator(==) string<delimiter(')content(chardet)delimiter(')>operator(:) keyword(try)operator(:) - keyword(import) ident(chardet) + keyword(import) include(chardet) keyword(except) exception(ImportError)operator(:) keyword(raise) exception(ImportError)operator(()string<delimiter(')content(To enable chardet encoding guessing, )delimiter(')> string<delimiter(')content(please install the chardet library )delimiter(')> @@ -5240,19 +5240,19 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys) -keyword(import) ident(fnmatch) -keyword(import) ident(types) -keyword(from) ident(os)operator(.)ident(path) keyword(import) ident(basename) +keyword(import) include(sys) +keyword(import) include(fnmatch) +keyword(import) include(types) +keyword(from) include(os.path) keyword(import) include(basename) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(_mapping) keyword(import) ident(LEXERS) -keyword(from) ident(pygments)operator(.)ident(plugin) keyword(import) ident(find_plugin_lexers) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(ClassNotFound)operator(,) predefined(bytes) +keyword(from) include(pygments.lexers._mapping) keyword(import) include(LEXERS) +keyword(from) include(pygments.plugin) keyword(import) include(find_plugin_lexers) +keyword(from) include(pygments.util) keyword(import) include(ClassNotFound)operator(,) include(bytes) ident(__all__) operator(=) operator([)string<delimiter(')content(get_lexer_by_name)delimiter(')>operator(,) string<delimiter(')content(get_lexer_for_filename)delimiter(')>operator(,) string<delimiter(')content(find_lexer_class)delimiter(')>operator(,) @@ -5455,7 +5455,7 @@ keyword(class) class(_automodule)operator(()ident(types)operator(.)ident(ModuleT keyword(raise) exception(AttributeError)operator(()ident(name)operator(\)) -keyword(import) ident(sys) +keyword(import) include(sys) ident(oldmod) operator(=) ident(sys)operator(.)ident(modules)operator([)string<delimiter(')content(pygments.lexers)delimiter(')>operator(]) ident(newmod) operator(=) ident(_automodule)operator(()string<delimiter(')content(pygments.lexers)delimiter(')>operator(\)) ident(newmod)operator(.)ident(__dict__)operator(.)ident(update)operator(()ident(oldmod)operator(.)ident(__dict__)operator(\)) @@ -5843,9 +5843,9 @@ ident(MODULES) operator(=) operator({)string<delimiter(')content(basic)delimiter string<delimiter(')content(table.sort)delimiter(')>operator(])operator(}) keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) - keyword(import) ident(re) - keyword(import) ident(urllib) - keyword(import) ident(pprint) + keyword(import) include(re) + keyword(import) include(urllib) + keyword(import) include(pprint) comment(# you can't generally find out what module a function belongs to if you) comment(# have only its name. Because of this, here are some callback functions) @@ -6127,8 +6127,8 @@ ident(LEXERS) operator(=) operator({) operator(}) keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) - keyword(import) ident(sys) - keyword(import) ident(os) + keyword(import) include(sys) + keyword(import) include(os) comment(# lookup lexers) ident(found_lexers) operator(=) operator([)operator(]) @@ -9493,9 +9493,9 @@ ident(MODULES) operator(=) operator({)string<delimiter(')content(.NET)delimiter( keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) - keyword(import) ident(pprint) - keyword(import) ident(re) - keyword(import) ident(urllib) + keyword(import) include(pprint) + keyword(import) include(re) + keyword(import) include(urllib) ident(_function_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(')content(<B)content(\\s)content(+CLASS="function")content(\\s)content(*>(.*?\))content(\\()content(\\\))content(</B)content(\\s)content(*>(?uism\))delimiter(')>operator(\)) keyword(def) method(get_php_functions)operator(()operator(\))operator(:) @@ -9568,18 +9568,18 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer)operator(,) ident(RegexLexer)operator(,) ident(ExtendedRegexLexer)operator(,) \ - ident(LexerContext)operator(,) ident(include)operator(,) ident(combined)operator(,) ident(do_insertions)operator(,) ident(bygroups)operator(,) ident(using) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Error)operator(,) ident(Text)operator(,) \ - ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) ident(Number)operator(,) ident(Generic)operator(,) ident(Punctuation) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_list_opt)operator(,) ident(shebang_matches) -keyword(from) ident(pygments) keyword(import) ident(unistring) keyword(as) ident(uni) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer)operator(,) include(RegexLexer)operator(,) include(ExtendedRegexLexer)operator(,) \ + include(LexerContext)operator(,) include(include)operator(,) include(combined)operator(,) include(do_insertions)operator(,) include(bygroups)operator(,) include(using) +keyword(from) include(pygments.token) keyword(import) include(Error)operator(,) include(Text)operator(,) \ + include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) include(Number)operator(,) include(Generic)operator(,) include(Punctuation) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_list_opt)operator(,) include(shebang_matches) +keyword(from) include(pygments) keyword(import) include(unistring) keyword(as) ident(uni) ident(__all__) operator(=) operator([)string<delimiter(')content(PythonLexer)delimiter(')>operator(,) string<delimiter(')content(PythonConsoleLexer)delimiter(')>operator(,) string<delimiter(')content(PythonTracebackLexer)delimiter(')>operator(,) @@ -9588,7 +9588,7 @@ ident(__all__) operator(=) operator([)string<delimiter(')content(PythonLexer)del string<delimiter(')content(Python3Lexer)delimiter(')>operator(,) string<delimiter(')content(Python3TracebackLexer)delimiter(')>operator(]) comment(# b/w compatibility) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(functional) keyword(import) ident(SchemeLexer) +keyword(from) include(pygments.lexers.functional) keyword(import) include(SchemeLexer) ident(line_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<delimiter(')content(.*?)char(\\n)delimiter(')>operator(\)) @@ -10639,7 +10639,7 @@ keyword(class) class(LuaLexer)operator(()ident(RegexLexer)operator(\))operator(: pre_constant(self)operator(.)ident(_functions) operator(=) predefined(set)operator(()operator(\)) keyword(if) pre_constant(self)operator(.)ident(func_name_highlighting)operator(:) - keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(_luabuiltins) keyword(import) ident(MODULES) + keyword(from) include(pygments.lexers._luabuiltins) keyword(import) include(MODULES) keyword(for) ident(mod)operator(,) ident(func) keyword(in) ident(MODULES)operator(.)ident(iteritems)operator(()operator(\))operator(:) keyword(if) ident(mod) keyword(not) keyword(in) pre_constant(self)operator(.)ident(disabled_modules)operator(:) pre_constant(self)operator(.)ident(_functions)operator(.)ident(update)operator(()ident(func)operator(\)) @@ -11046,15 +11046,15 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(RegexLexer)operator(,) ident(include)operator(,) ident(bygroups)operator(,) ident(using)operator(,) ident(DelegatingLexer) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(compiled) keyword(import) ident(DLexer)operator(,) ident(CppLexer)operator(,) ident(CLexer) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) operator(*) +keyword(from) include(pygments.lexer) keyword(import) include(RegexLexer)operator(,) include(include)operator(,) include(bygroups)operator(,) include(using)operator(,) include(DelegatingLexer) +keyword(from) include(pygments.lexers.compiled) keyword(import) include(DLexer)operator(,) include(CppLexer)operator(,) include(CLexer) +keyword(from) include(pygments.token) keyword(import) include(*) ident(__all__) operator(=) operator([)string<delimiter(')content(GasLexer)delimiter(')>operator(,) string<delimiter(')content(ObjdumpLexer)delimiter(')>operator(,)string<delimiter(')content(DObjdumpLexer)delimiter(')>operator(,) string<delimiter(')content(CppObjdumpLexer)delimiter(')>operator(,) string<delimiter(')content(CObjdumpLexer)delimiter(')>operator(,) string<delimiter(')content(LlvmLexer)delimiter(')>operator(,) string<delimiter(')content(NasmLexer)delimiter(')>operator(]) @@ -11379,22 +11379,22 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(scanner) keyword(import) ident(Scanner) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer)operator(,) ident(RegexLexer)operator(,) ident(include)operator(,) ident(bygroups)operator(,) ident(using)operator(,) \ - ident(this)operator(,) ident(combined) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_list_opt) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) \ - ident(Text)operator(,) ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) ident(Number)operator(,) ident(Punctuation)operator(,) \ - ident(Error) +keyword(from) include(pygments.scanner) keyword(import) include(Scanner) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer)operator(,) include(RegexLexer)operator(,) include(include)operator(,) include(bygroups)operator(,) include(using)operator(,) \ + include(this)operator(,) include(combined) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_list_opt) +keyword(from) include(pygments.token) keyword(import) \ + include(Text)operator(,) include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) include(Number)operator(,) include(Punctuation)operator(,) \ + include(Error) comment(# backwards compatibility) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(functional) keyword(import) ident(OcamlLexer) +keyword(from) include(pygments.lexers.functional) keyword(import) include(OcamlLexer) ident(__all__) operator(=) operator([)string<delimiter(')content(CLexer)delimiter(')>operator(,) string<delimiter(')content(CppLexer)delimiter(')>operator(,) string<delimiter(')content(DLexer)delimiter(')>operator(,) string<delimiter(')content(DelphiLexer)delimiter(')>operator(,) string<delimiter(')content(JavaLexer)delimiter(')>operator(,) string<delimiter(')content(ScalaLexer)delimiter(')>operator(,) string<delimiter(')content(DylanLexer)delimiter(')>operator(,) string<delimiter(')content(OcamlLexer)delimiter(')>operator(,) string<delimiter(')content(ObjectiveCLexer)delimiter(')>operator(,) string<delimiter(')content(FortranLexer)delimiter(')>operator(,) @@ -12951,15 +12951,15 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(RegexLexer)operator(,) ident(DelegatingLexer)operator(,) ident(bygroups)operator(,) ident(using)operator(,) ident(this) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Punctuation)operator(,) \ - ident(Text)operator(,) ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) ident(Number)operator(,) ident(Literal)operator(,) ident(Other) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_choice_opt) -keyword(from) ident(pygments) keyword(import) ident(unistring) keyword(as) ident(uni) +keyword(from) include(pygments.lexer) keyword(import) include(RegexLexer)operator(,) include(DelegatingLexer)operator(,) include(bygroups)operator(,) include(using)operator(,) include(this) +keyword(from) include(pygments.token) keyword(import) include(Punctuation)operator(,) \ + include(Text)operator(,) include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) include(Number)operator(,) include(Literal)operator(,) include(Other) +keyword(from) include(pygments.util) keyword(import) include(get_choice_opt) +keyword(from) include(pygments) keyword(import) include(unistring) keyword(as) ident(uni) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(web) keyword(import) ident(XmlLexer) +keyword(from) include(pygments.lexers.web) keyword(import) include(XmlLexer) ident(__all__) operator(=) operator([)string<delimiter(')content(CSharpLexer)delimiter(')>operator(,) string<delimiter(')content(BooLexer)delimiter(')>operator(,) string<delimiter(')content(VbNetLexer)delimiter(')>operator(,) string<delimiter(')content(CSharpAspxLexer)delimiter(')>operator(,) string<delimiter(')content(VbNetAspxLexer)delimiter(')>operator(]) @@ -13307,15 +13307,15 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer)operator(,) ident(RegexLexer)operator(,) ident(bygroups)operator(,) ident(include)operator(,) ident(do_insertions) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Text)operator(,) ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) \ - ident(String)operator(,) ident(Number)operator(,) ident(Punctuation)operator(,) ident(Literal)operator(,) ident(Generic) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer)operator(,) include(RegexLexer)operator(,) include(bygroups)operator(,) include(include)operator(,) include(do_insertions) +keyword(from) include(pygments.token) keyword(import) include(Text)operator(,) include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) \ + include(String)operator(,) include(Number)operator(,) include(Punctuation)operator(,) include(Literal)operator(,) include(Generic) ident(__all__) operator(=) operator([)string<delimiter(')content(SchemeLexer)delimiter(')>operator(,) string<delimiter(')content(CommonLispLexer)delimiter(')>operator(,) string<delimiter(')content(HaskellLexer)delimiter(')>operator(,) string<delimiter(')content(LiterateHaskellLexer)delimiter(')>operator(,) @@ -13475,9 +13475,9 @@ keyword(class) class(CommonLispLexer)operator(()ident(RegexLexer)operator(\))ope ident(symbol) operator(=) string<modifier(r)delimiter(')content(()content(\\|)content([^|]+)content(\\|)content(|(?:%s\)(?:%s\)*\))delimiter(')> operator(%) operator(()ident(nonmacro)operator(,) ident(constituent)operator(\)) keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(options)operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(_clbuiltins) keyword(import) ident(BUILTIN_FUNCTIONS)operator(,) \ - ident(SPECIAL_FORMS)operator(,) ident(MACROS)operator(,) ident(LAMBDA_LIST_KEYWORDS)operator(,) ident(DECLARATIONS)operator(,) \ - ident(BUILTIN_TYPES)operator(,) ident(BUILTIN_CLASSES) + keyword(from) include(pygments.lexers._clbuiltins) keyword(import) include(BUILTIN_FUNCTIONS)operator(,) \ + include(SPECIAL_FORMS)operator(,) include(MACROS)operator(,) include(LAMBDA_LIST_KEYWORDS)operator(,) include(DECLARATIONS)operator(,) \ + include(BUILTIN_TYPES)operator(,) include(BUILTIN_CLASSES) pre_constant(self)operator(.)ident(builtin_function) operator(=) ident(BUILTIN_FUNCTIONS) pre_constant(self)operator(.)ident(special_forms) operator(=) ident(SPECIAL_FORMS) pre_constant(self)operator(.)ident(macros) operator(=) ident(MACROS) @@ -13788,7 +13788,7 @@ keyword(class) class(LiterateHaskellLexer)operator(()ident(Lexer)operator(\))ope ident(insertions)operator(.)ident(append)operator(()operator(()predefined(len)operator(()ident(code)operator(\))operator(,) operator([)operator(()integer(0)operator(,) ident(Text)operator(,) ident(line)operator(\))operator(])operator(\))operator(\)) keyword(else)operator(:) comment(# latex-style) - keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(text) keyword(import) ident(TexLexer) + keyword(from) include(pygments.lexers.text) keyword(import) include(TexLexer) ident(lxlexer) operator(=) ident(TexLexer)operator(()operator(**)pre_constant(self)operator(.)ident(options)operator(\)) ident(codelines) operator(=) integer(0) @@ -14066,17 +14066,17 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer)operator(,) ident(RegexLexer)operator(,) ident(bygroups)operator(,) ident(include)operator(,) ident(do_insertions) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Comment)operator(,) ident(String)operator(,) ident(Punctuation)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) \ - ident(Operator)operator(,) ident(Number)operator(,) ident(Text)operator(,) ident(Generic) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer)operator(,) include(RegexLexer)operator(,) include(bygroups)operator(,) include(include)operator(,) include(do_insertions) +keyword(from) include(pygments.token) keyword(import) include(Comment)operator(,) include(String)operator(,) include(Punctuation)operator(,) include(Keyword)operator(,) include(Name)operator(,) \ + include(Operator)operator(,) include(Number)operator(,) include(Text)operator(,) include(Generic) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(agile) keyword(import) ident(PythonLexer) +keyword(from) include(pygments.lexers.agile) keyword(import) include(PythonLexer) ident(__all__) operator(=) operator([)string<delimiter(')content(MuPADLexer)delimiter(')>operator(,) string<delimiter(')content(MatlabLexer)delimiter(')>operator(,) string<delimiter(')content(MatlabSessionLexer)delimiter(')>operator(,) string<delimiter(')content(NumPyLexer)delimiter(')>operator(,) string<delimiter(')content(SLexer)delimiter(')>operator(]) @@ -14479,14 +14479,14 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer)operator(,) ident(RegexLexer)operator(,) ident(include)operator(,) ident(bygroups)operator(,) ident(using)operator(,) \ - ident(this)operator(,) ident(do_insertions) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Error)operator(,) ident(Punctuation)operator(,) \ - ident(Text)operator(,) ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) ident(Number)operator(,) ident(Generic) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(shebang_matches) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(web) keyword(import) ident(HtmlLexer) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer)operator(,) include(RegexLexer)operator(,) include(include)operator(,) include(bygroups)operator(,) include(using)operator(,) \ + include(this)operator(,) include(do_insertions) +keyword(from) include(pygments.token) keyword(import) include(Error)operator(,) include(Punctuation)operator(,) \ + include(Text)operator(,) include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) include(Number)operator(,) include(Generic) +keyword(from) include(pygments.util) keyword(import) include(shebang_matches) +keyword(from) include(pygments.lexers.web) keyword(import) include(HtmlLexer) ident(__all__) operator(=) operator([)string<delimiter(')content(SqlLexer)delimiter(')>operator(,) string<delimiter(')content(MySqlLexer)delimiter(')>operator(,) string<delimiter(')content(SqliteConsoleLexer)delimiter(')>operator(,) string<delimiter(')content(BrainfuckLexer)delimiter(')>operator(,) @@ -16502,20 +16502,20 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) - -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(RegexLexer)operator(,) ident(DelegatingLexer)operator(,) \ - ident(include)operator(,) ident(bygroups)operator(,) ident(using)operator(,) ident(this) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Error)operator(,) ident(Punctuation)operator(,) ident(Generic)operator(,) ident(Other)operator(,) \ - ident(Text)operator(,) ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) ident(Number)operator(,) ident(Whitespace) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(compiled) keyword(import) ident(JavaLexer)operator(,) ident(CLexer)operator(,) ident(CppLexer)operator(,) \ - ident(ObjectiveCLexer)operator(,) ident(DLexer) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(dotnet) keyword(import) ident(CSharpLexer) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(agile) keyword(import) ident(RubyLexer)operator(,) ident(PythonLexer)operator(,) ident(PerlLexer) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(web) keyword(import) ident(ActionScriptLexer) +keyword(import) include(re) + +keyword(from) include(pygments.lexer) keyword(import) include(RegexLexer)operator(,) include(DelegatingLexer)operator(,) \ + include(include)operator(,) include(bygroups)operator(,) include(using)operator(,) include(this) +keyword(from) include(pygments.token) keyword(import) include(Error)operator(,) include(Punctuation)operator(,) include(Generic)operator(,) include(Other)operator(,) \ + include(Text)operator(,) include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) include(Number)operator(,) include(Whitespace) +keyword(from) include(pygments.lexers.compiled) keyword(import) include(JavaLexer)operator(,) include(CLexer)operator(,) include(CppLexer)operator(,) \ + include(ObjectiveCLexer)operator(,) include(DLexer) +keyword(from) include(pygments.lexers.dotnet) keyword(import) include(CSharpLexer) +keyword(from) include(pygments.lexers.agile) keyword(import) include(RubyLexer)operator(,) include(PythonLexer)operator(,) include(PerlLexer) +keyword(from) include(pygments.lexers.web) keyword(import) include(ActionScriptLexer) comment(# Use TextLexer during development to just focus on one part of a delegating) comment(# lexer.) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(special) keyword(import) ident(TextLexer) +keyword(from) include(pygments.lexers.special) keyword(import) include(TextLexer) ident(__all__) operator(=) operator([)string<delimiter(')content(RagelLexer)delimiter(')>operator(,) string<delimiter(')content(RagelEmbeddedLexer)delimiter(')>operator(,) string<delimiter(')content(RagelCLexer)delimiter(')>operator(,) string<delimiter(')content(RagelDLexer)delimiter(')>operator(,) string<delimiter(')content(RagelCppLexer)delimiter(')>operator(,) string<delimiter(')content(RagelObjectiveCLexer)delimiter(')>operator(,) string<delimiter(')content(RagelRubyLexer)delimiter(')>operator(,) @@ -17173,12 +17173,12 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) -keyword(import) ident(cStringIO) +keyword(import) include(re) +keyword(import) include(cStringIO) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Token)operator(,) ident(Error)operator(,) ident(Text) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_choice_opt)operator(,) ident(b) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer) +keyword(from) include(pygments.token) keyword(import) include(Token)operator(,) include(Error)operator(,) include(Text) +keyword(from) include(pygments.util) keyword(import) include(get_choice_opt)operator(,) include(b) ident(__all__) operator(=) operator([)string<delimiter(')content(TextLexer)delimiter(')>operator(,) string<delimiter(')content(RawTokenLexer)delimiter(')>operator(]) @@ -17228,11 +17228,11 @@ keyword(class) class(RawTokenLexer)operator(()ident(Lexer)operator(\))operator(: comment(# raw token stream never has any non-ASCII characters) ident(text) operator(=) ident(text)operator(.)ident(encode)operator(()string<delimiter(')content(ascii)delimiter(')>operator(\)) keyword(if) pre_constant(self)operator(.)ident(compress) operator(==) string<delimiter(')content(gz)delimiter(')>operator(:) - keyword(import) ident(gzip) + keyword(import) include(gzip) ident(gzipfile) operator(=) ident(gzip)operator(.)ident(GzipFile)operator(()string<delimiter(')delimiter(')>operator(,) string<delimiter(')content(rb)delimiter(')>operator(,) integer(9)operator(,) ident(cStringIO)operator(.)ident(StringIO)operator(()ident(text)operator(\))operator(\)) ident(text) operator(=) ident(gzipfile)operator(.)ident(read)operator(()operator(\)) keyword(elif) pre_constant(self)operator(.)ident(compress) operator(==) string<delimiter(')content(bz2)delimiter(')>operator(:) - keyword(import) ident(bz2) + keyword(import) include(bz2) ident(text) operator(=) ident(bz2)operator(.)ident(decompress)operator(()ident(text)operator(\)) comment(# do not call Lexer.get_tokens(\) because we do not want Unicode) @@ -17273,21 +17273,21 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) - -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(web) keyword(import) \ - ident(PhpLexer)operator(,) ident(HtmlLexer)operator(,) ident(XmlLexer)operator(,) ident(JavascriptLexer)operator(,) ident(CssLexer) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(agile) keyword(import) ident(PythonLexer) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(compiled) keyword(import) ident(JavaLexer) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer)operator(,) ident(DelegatingLexer)operator(,) ident(RegexLexer)operator(,) ident(bygroups)operator(,) \ - ident(include)operator(,) ident(using)operator(,) ident(this) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Error)operator(,) ident(Punctuation)operator(,) \ - ident(Text)operator(,) ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) ident(Number)operator(,) ident(Other)operator(,) ident(Token) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(html_doctype_matches)operator(,) ident(looks_like_xml) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) + +keyword(from) include(pygments.lexers.web) keyword(import) \ + include(PhpLexer)operator(,) include(HtmlLexer)operator(,) include(XmlLexer)operator(,) include(JavascriptLexer)operator(,) include(CssLexer) +keyword(from) include(pygments.lexers.agile) keyword(import) include(PythonLexer) +keyword(from) include(pygments.lexers.compiled) keyword(import) include(JavaLexer) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer)operator(,) include(DelegatingLexer)operator(,) include(RegexLexer)operator(,) include(bygroups)operator(,) \ + include(include)operator(,) include(using)operator(,) include(this) +keyword(from) include(pygments.token) keyword(import) include(Error)operator(,) include(Punctuation)operator(,) \ + include(Text)operator(,) include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) include(Number)operator(,) include(Other)operator(,) include(Token) +keyword(from) include(pygments.util) keyword(import) include(html_doctype_matches)operator(,) include(looks_like_xml) ident(__all__) operator(=) operator([)string<delimiter(')content(HtmlPhpLexer)delimiter(')>operator(,) string<delimiter(')content(XmlPhpLexer)delimiter(')>operator(,) string<delimiter(')content(CssPhpLexer)delimiter(')>operator(,) string<delimiter(')content(JavascriptPhpLexer)delimiter(')>operator(,) string<delimiter(')content(ErbLexer)delimiter(')>operator(,) string<delimiter(')content(RhtmlLexer)delimiter(')>operator(,) @@ -17323,7 +17323,7 @@ keyword(class) class(ErbLexer)operator(()ident(Lexer)operator(\))operator(:) ident(_block_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(')content((<%%|%%>|<%=|<%#|<%-|<%|-%>|%>|^%[^%].*?$\))delimiter(')>operator(,) ident(re)operator(.)ident(M)operator(\)) keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(options)operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(agile) keyword(import) ident(RubyLexer) + keyword(from) include(pygments.lexers.agile) keyword(import) include(RubyLexer) pre_constant(self)operator(.)ident(ruby_lexer) operator(=) ident(RubyLexer)operator(()operator(**)ident(options)operator(\)) ident(Lexer)operator(.)ident(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(options)operator(\)) @@ -18576,19 +18576,19 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) -keyword(from) ident(bisect) keyword(import) ident(bisect) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) +keyword(from) include(bisect) keyword(import) include(bisect) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer)operator(,) ident(LexerContext)operator(,) ident(RegexLexer)operator(,) ident(ExtendedRegexLexer)operator(,) \ - ident(bygroups)operator(,) ident(include)operator(,) ident(using)operator(,) ident(this)operator(,) ident(do_insertions) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Punctuation)operator(,) ident(Text)operator(,) ident(Comment)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) \ - ident(Generic)operator(,) ident(Operator)operator(,) ident(Number)operator(,) ident(Whitespace)operator(,) ident(Literal) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt) -keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(other) keyword(import) ident(BashLexer) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer)operator(,) include(LexerContext)operator(,) include(RegexLexer)operator(,) include(ExtendedRegexLexer)operator(,) \ + include(bygroups)operator(,) include(include)operator(,) include(using)operator(,) include(this)operator(,) include(do_insertions) +keyword(from) include(pygments.token) keyword(import) include(Punctuation)operator(,) include(Text)operator(,) include(Comment)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) \ + include(Generic)operator(,) include(Operator)operator(,) include(Number)operator(,) include(Whitespace)operator(,) include(Literal) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt) +keyword(from) include(pygments.lexers.other) keyword(import) include(BashLexer) ident(__all__) operator(=) operator([)string<delimiter(')content(IniLexer)delimiter(')>operator(,) string<delimiter(')content(SourcesListLexer)delimiter(')>operator(,) string<delimiter(')content(BaseMakefileLexer)delimiter(')>operator(,) string<delimiter(')content(MakefileLexer)delimiter(')>operator(,) string<delimiter(')content(DiffLexer)delimiter(')>operator(,) string<delimiter(')content(IrcLogsLexer)delimiter(')>operator(,) string<delimiter(')content(TexLexer)delimiter(')>operator(,) @@ -19150,8 +19150,8 @@ keyword(class) class(RstLexer)operator(()ident(RegexLexer)operator(\))operator(: ident(flags) operator(=) ident(re)operator(.)ident(MULTILINE) keyword(def) method(_handle_sourcecode)operator(()pre_constant(self)operator(,) ident(match)operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_by_name) - keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(ClassNotFound) + keyword(from) include(pygments.lexers) keyword(import) include(get_lexer_by_name) + keyword(from) include(pygments.util) keyword(import) include(ClassNotFound) comment(# section header) keyword(yield) ident(match)operator(.)ident(start)operator(()integer(1)operator(\))operator(,) ident(Punctuation)operator(,) ident(match)operator(.)ident(group)operator(()integer(1)operator(\)) @@ -19315,7 +19315,7 @@ keyword(class) class(VimLexer)operator(()ident(RegexLexer)operator(\))operator(: operator(])operator(,) operator(}) keyword(def) method(__init__)operator(()pre_constant(self)operator(,) operator(**)ident(options)operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(_vimbuiltins) keyword(import) ident(command)operator(,) ident(option)operator(,) ident(auto) + keyword(from) include(pygments.lexers._vimbuiltins) keyword(import) include(command)operator(,) include(option)operator(,) include(auto) pre_constant(self)operator(.)ident(_cmd) operator(=) ident(command) pre_constant(self)operator(.)ident(_opt) operator(=) ident(option) pre_constant(self)operator(.)ident(_aut) operator(=) ident(auto) @@ -20072,17 +20072,17 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(RegexLexer)operator(,) ident(bygroups)operator(,) ident(using)operator(,) ident(include)operator(,) ident(this) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) \ - ident(Text)operator(,) ident(Comment)operator(,) ident(Operator)operator(,) ident(Keyword)operator(,) ident(Name)operator(,) ident(String)operator(,) ident(Number)operator(,) ident(Other)operator(,) ident(Punctuation) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(get_bool_opt)operator(,) ident(get_list_opt)operator(,) ident(looks_like_xml)operator(,) \ - ident(html_doctype_matches) +keyword(from) include(pygments.lexer) keyword(import) include(RegexLexer)operator(,) include(bygroups)operator(,) include(using)operator(,) include(include)operator(,) include(this) +keyword(from) include(pygments.token) keyword(import) \ + include(Text)operator(,) include(Comment)operator(,) include(Operator)operator(,) include(Keyword)operator(,) include(Name)operator(,) include(String)operator(,) include(Number)operator(,) include(Other)operator(,) include(Punctuation) +keyword(from) include(pygments.util) keyword(import) include(get_bool_opt)operator(,) include(get_list_opt)operator(,) include(looks_like_xml)operator(,) \ + include(html_doctype_matches) ident(__all__) operator(=) operator([)string<delimiter(')content(HtmlLexer)delimiter(')>operator(,) string<delimiter(')content(XmlLexer)delimiter(')>operator(,) string<delimiter(')content(JavascriptLexer)delimiter(')>operator(,) string<delimiter(')content(CssLexer)delimiter(')>operator(,) @@ -20612,7 +20612,7 @@ keyword(class) class(PhpLexer)operator(()ident(RegexLexer)operator(\))operator(: comment(# collect activated functions in a set) pre_constant(self)operator(.)ident(_functions) operator(=) predefined(set)operator(()operator(\)) keyword(if) pre_constant(self)operator(.)ident(funcnamehighlighting)operator(:) - keyword(from) ident(pygments)operator(.)ident(lexers)operator(.)ident(_phpbuiltins) keyword(import) ident(MODULES) + keyword(from) include(pygments.lexers._phpbuiltins) keyword(import) include(MODULES) keyword(for) ident(key)operator(,) ident(value) keyword(in) ident(MODULES)operator(.)ident(iteritems)operator(()operator(\))operator(:) keyword(if) ident(key) keyword(not) keyword(in) pre_constant(self)operator(.)ident(disabledmodules)operator(:) pre_constant(self)operator(.)ident(_functions)operator(.)ident(update)operator(()ident(value)operator(\)) @@ -20802,7 +20802,7 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> keyword(try)operator(:) - keyword(import) ident(pkg_resources) + keyword(import) include(pkg_resources) keyword(except) exception(ImportError)operator(:) ident(pkg_resources) operator(=) pre_constant(None) @@ -20855,7 +20855,7 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) +keyword(import) include(re) keyword(class) class(EndOfText)operator(()exception(RuntimeError)operator(\))operator(:) @@ -20953,7 +20953,7 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Token)operator(,) ident(STANDARD_TYPES) +keyword(from) include(pygments.token) keyword(import) include(Token)operator(,) include(STANDARD_TYPES) keyword(class) class(StyleMeta)operator(()predefined(type)operator(\))operator(:) @@ -21070,8 +21070,8 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(plugin) keyword(import) ident(find_plugin_styles) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(ClassNotFound) +keyword(from) include(pygments.plugin) keyword(import) include(find_plugin_styles) +keyword(from) include(pygments.util) keyword(import) include(ClassNotFound) comment(#: Maps style names to 'submodule::classname'.) @@ -21137,9 +21137,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(AutumnStyle)operator(()ident(Style)operator(\))operator(:) @@ -21202,9 +21202,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(BorlandStyle)operator(()ident(Style)operator(\))operator(:) @@ -21253,9 +21253,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Operator)operator(,) ident(Generic) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Operator)operator(,) include(Generic) keyword(class) class(BlackWhiteStyle)operator(()ident(Style)operator(\))operator(:) @@ -21302,9 +21302,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(ColorfulStyle)operator(()ident(Style)operator(\))operator(:) @@ -21383,9 +21383,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(DefaultStyle)operator(()ident(Style)operator(\))operator(:) @@ -21456,9 +21456,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(EmacsStyle)operator(()ident(Style)operator(\))operator(:) @@ -21528,9 +21528,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(FriendlyStyle)operator(()ident(Style)operator(\))operator(:) @@ -21600,9 +21600,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Token)operator(,) ident(Comment)operator(,) ident(Name)operator(,) ident(Keyword)operator(,) \ - ident(Generic)operator(,) ident(Number)operator(,) ident(String)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Token)operator(,) include(Comment)operator(,) include(Name)operator(,) include(Keyword)operator(,) \ + include(Generic)operator(,) include(Number)operator(,) include(String)operator(,) include(Whitespace) keyword(class) class(FruityStyle)operator(()ident(Style)operator(\))operator(:) string<delimiter(""")content( @@ -21646,9 +21646,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(ManniStyle)operator(()ident(Style)operator(\))operator(:) @@ -21718,9 +21718,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(MurphyStyle)operator(()ident(Style)operator(\))operator(:) @@ -21798,9 +21798,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Token)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Token)operator(,) include(Whitespace) keyword(class) class(NativeStyle)operator(()ident(Style)operator(\))operator(:) @@ -21865,9 +21865,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(PastieStyle)operator(()ident(Style)operator(\))operator(:) @@ -21940,9 +21940,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(PerldocStyle)operator(()ident(Style)operator(\))operator(:) @@ -22035,9 +22035,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace)operator(,) ident(Punctuation)operator(,) ident(Other)operator(,) ident(Literal) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace)operator(,) include(Punctuation)operator(,) include(Other)operator(,) include(Literal) keyword(class) class(TangoStyle)operator(()ident(Style)operator(\))operator(:) @@ -22148,9 +22148,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace) keyword(class) class(TracStyle)operator(()ident(Style)operator(\))operator(:) @@ -22211,9 +22211,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Number)operator(,) ident(Operator)operator(,) ident(Generic)operator(,) ident(Whitespace)operator(,) ident(Token) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Number)operator(,) include(Operator)operator(,) include(Generic)operator(,) include(Whitespace)operator(,) include(Token) keyword(class) class(VimStyle)operator(()ident(Style)operator(\))operator(:) @@ -22274,9 +22274,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(style) keyword(import) ident(Style) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Keyword)operator(,) ident(Name)operator(,) ident(Comment)operator(,) ident(String)operator(,) ident(Error)operator(,) \ - ident(Operator)operator(,) ident(Generic) +keyword(from) include(pygments.style) keyword(import) include(Style) +keyword(from) include(pygments.token) keyword(import) include(Keyword)operator(,) include(Name)operator(,) include(Comment)operator(,) include(String)operator(,) include(Error)operator(,) \ + include(Operator)operator(,) include(Generic) keyword(class) class(VisualStudioStyle)operator(()ident(Style)operator(\))operator(:) @@ -22314,7 +22314,7 @@ string<delimiter(""")content( keyword(try)operator(:) predefined(set) keyword(except) exception(NameError)operator(:) - keyword(from) ident(sets) keyword(import) ident(Set) keyword(as) predefined(set) + keyword(from) include(sets) keyword(import) include(Set) keyword(as) ident(set) keyword(class) class(_TokenType)operator(()predefined(tuple)operator(\))operator(:) @@ -22514,8 +22514,8 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(re) -keyword(import) ident(sys) +keyword(import) include(re) +keyword(import) include(sys) ident(split_path_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(')content([/)content(\\\\)content( ])delimiter(')>operator(\)) @@ -22709,11 +22709,11 @@ comment(# Python 2/3 compatibility) keyword(if) ident(sys)operator(.)ident(version_info) operator(<) operator(()integer(3)operator(,)integer(0)operator(\))operator(:) ident(b) operator(=) ident(bytes) operator(=) predefined(str) ident(u_prefix) operator(=) string<delimiter(')content(u)delimiter(')> - keyword(import) ident(StringIO)operator(,) ident(cStringIO) + keyword(import) include(StringIO)operator(,) include(cStringIO) ident(BytesIO) operator(=) ident(cStringIO)operator(.)ident(StringIO) ident(StringIO) operator(=) ident(StringIO)operator(.)ident(StringIO) keyword(else)operator(:) - keyword(import) ident(builtins) + keyword(import) include(builtins) ident(bytes) operator(=) ident(builtins)operator(.)ident(bytes) ident(u_prefix) operator(=) string<delimiter(')delimiter(')> keyword(def) method(b)operator(()ident(s)operator(\))operator(:) @@ -22723,7 +22723,7 @@ keyword(else)operator(:) keyword(return) ident(s) keyword(else)operator(:) keyword(raise) exception(TypeError)operator(()string<delimiter(")content(Invalid argument %r for b(\))delimiter(")> operator(%) operator(()ident(s)operator(,)operator(\))operator(\)) - keyword(import) ident(io) + keyword(import) include(io) ident(BytesIO) operator(=) ident(io)operator(.)ident(BytesIO) ident(StringIO) operator(=) ident(io)operator(.)ident(StringIO) comment(#!/usr/bin/env python) @@ -22739,10 +22739,10 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys)operator(,) ident(os)operator(,) ident(re) -keyword(import) ident(getopt) -keyword(import) ident(cStringIO) -keyword(from) ident(os)operator(.)ident(path) keyword(import) ident(join)operator(,) ident(splitext)operator(,) ident(abspath) +keyword(import) include(sys)operator(,) include(os)operator(,) include(re) +keyword(import) include(getopt) +keyword(import) include(cStringIO) +keyword(from) include(os.path) keyword(import) include(join)operator(,) include(splitext)operator(,) include(abspath) ident(checkers) operator(=) operator({)operator(}) @@ -22968,10 +22968,10 @@ keyword(def) method(main)operator(()ident(argv)operator(\))operator(:) keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) ident(sys)operator(.)ident(exit)operator(()ident(main)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(\)) -keyword(import) ident(sys) +keyword(import) include(sys) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_all_lexers)operator(,) ident(find_lexer_class) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(Lexer) +keyword(from) include(pygments.lexers) keyword(import) include(get_all_lexers)operator(,) include(find_lexer_class) +keyword(from) include(pygments.lexer) keyword(import) include(Lexer) keyword(def) method(main)operator(()operator(\))operator(:) ident(uses) operator(=) operator({)operator(}) @@ -23011,9 +23011,9 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys)operator(,) ident(os)operator(,) ident(re) -keyword(import) ident(getopt) -keyword(from) ident(os)operator(.)ident(path) keyword(import) ident(join)operator(,) ident(abspath)operator(,) ident(isdir)operator(,) ident(isfile) +keyword(import) include(sys)operator(,) include(os)operator(,) include(re) +keyword(import) include(getopt) +keyword(from) include(os.path) keyword(import) include(join)operator(,) include(abspath)operator(,) include(isdir)operator(,) include(isfile) ident(TAGS) operator(=) predefined(set)operator(()operator(()string<delimiter(')content(XXX)delimiter(')>operator(,) string<delimiter(')content(TODO)delimiter(')>operator(,) string<delimiter(')content(FIXME)delimiter(')>operator(,) string<delimiter(')content(HACK)delimiter(')>operator(\))operator(\)) @@ -23217,17 +23217,17 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys)operator(,) ident(os) +keyword(import) include(sys)operator(,) include(os) keyword(try)operator(:) - keyword(import) ident(pygments) + keyword(import) include(pygments) keyword(except) exception(ImportError)operator(:) comment(# try parent path) ident(sys)operator(.)ident(path)operator(.)ident(append)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(__file__)operator(\))operator(,) string<delimiter(")content(..)delimiter(")>operator(\))operator(\)) -keyword(from) ident(pygments) keyword(import) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_for_filename)operator(,) ident(get_lexer_by_name) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Error) +keyword(from) include(pygments) keyword(import) include(highlight) +keyword(from) include(pygments.lexers) keyword(import) include(get_lexer_for_filename)operator(,) include(get_lexer_by_name) +keyword(from) include(pygments.token) keyword(import) include(Error) keyword(def) method(main)operator(()ident(fn)operator(\))operator(:) keyword(try)operator(:) @@ -23262,8 +23262,8 @@ keyword(if) ident(__name__) operator(==) string<delimiter(")content(__main__)del keyword(for) ident(f) keyword(in) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(:) ident(ret) operator(+=) ident(main)operator(()ident(f)operator(\)) ident(sys)operator(.)ident(exit)operator(()predefined(bool)operator(()ident(ret)operator(\))operator(\)) -keyword(import) ident(re) -keyword(from) ident(pprint) keyword(import) ident(pprint) +keyword(import) include(re) +keyword(from) include(pprint) keyword(import) include(pprint) ident(r_line) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(")content(^(syn keyword vimCommand contained|syn keyword vimOption )delimiter(")> string<modifier(r)delimiter(")content(contained|syn keyword vimAutoEvent contained\))content(\\s)content(+(.*\))delimiter(")>operator(\)) @@ -23339,9 +23339,9 @@ string<delimiter(""")content(reindent [-d][-r][-v] [ path ... ])content( ident(__version__) operator(=) string<delimiter(")content(1)delimiter(")> -keyword(import) ident(tokenize) -keyword(import) ident(os) -keyword(import) ident(sys) +keyword(import) include(tokenize) +keyword(import) include(os) +keyword(import) include(sys) ident(verbose) operator(=) integer(0) ident(recurse) operator(=) integer(0) @@ -23361,7 +23361,7 @@ keyword(def) method(errprint)operator(()operator(*)ident(args)operator(\))operat ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()string<delimiter(")char(\\n)delimiter(")>operator(\)) keyword(def) method(main)operator(()operator(\))operator(:) - keyword(import) ident(getopt) + keyword(import) include(getopt) keyword(global) ident(verbose)operator(,) ident(recurse)operator(,) ident(dryrun)operator(,) ident(no_backup) keyword(try)operator(:) @@ -23604,10 +23604,10 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys) -keyword(import) ident(re) -keyword(from) ident(os) keyword(import) ident(path) -keyword(from) ident(cStringIO) keyword(import) ident(StringIO) +keyword(import) include(sys) +keyword(import) include(re) +keyword(from) include(os) keyword(import) include(path) +keyword(from) include(cStringIO) keyword(import) include(StringIO) ident(split_re) operator(=) ident(re)operator(.)ident(compile)operator(()string<modifier(r)delimiter(')content((?<!)content(\\\\)content(\))content(\\s)content(+)delimiter(')>operator(\)) @@ -24552,9 +24552,9 @@ string<delimiter(""")content( )delimiter(""")> keyword(try)operator(:) - keyword(from) ident(setuptools) keyword(import) ident(setup)operator(,) ident(find_packages) + keyword(from) include(setuptools) keyword(import) include(setup)operator(,) include(find_packages) keyword(except) exception(ImportError)operator(:) - keyword(from) ident(distutils)operator(.)ident(core) keyword(import) ident(setup) + keyword(from) include(distutils.core) keyword(import) include(setup) keyword(def) method(find_packages)operator(()operator(\))operator(:) keyword(return) operator([) string<delimiter(')content(pygments)delimiter(')>operator(,) @@ -24565,9 +24565,9 @@ keyword(except) exception(ImportError)operator(:) operator(]) keyword(try)operator(:) - keyword(from) ident(distutils)operator(.)ident(command)operator(.)ident(build_py) keyword(import) ident(build_py_2to3) keyword(as) ident(build_py) + keyword(from) include(distutils.command.build_py) keyword(import) include(build_py_2to3) keyword(as) ident(build_py) keyword(except) exception(ImportError)operator(:) - keyword(from) ident(distutils)operator(.)ident(command)operator(.)ident(build_py) keyword(import) ident(build_py) + keyword(from) include(distutils.command.build_py) keyword(import) include(build_py) ident(setup)operator(() ident(name) operator(=) string<delimiter(')content(Pygments)delimiter(')>operator(,) @@ -24609,15 +24609,15 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys)operator(,) ident(os) -keyword(import) ident(unittest) +keyword(import) include(sys)operator(,) include(os) +keyword(import) include(unittest) -keyword(from) ident(os)operator(.)ident(path) keyword(import) ident(dirname)operator(,) ident(basename)operator(,) ident(join)operator(,) ident(abspath) +keyword(from) include(os.path) keyword(import) include(dirname)operator(,) include(basename)operator(,) include(join)operator(,) include(abspath) -keyword(import) ident(pygments) +keyword(import) include(pygments) keyword(try)operator(:) - keyword(import) ident(coverage) + keyword(import) include(coverage) keyword(except) exception(ImportError)operator(:) ident(coverage) operator(=) pre_constant(None) @@ -24659,7 +24659,7 @@ keyword(class) class(QuietTestRunner)operator(()predefined(object)operator(\))op keyword(def) method(run_tests)operator(()ident(with_coverage)operator(=)pre_constant(False)operator(\))operator(:) comment(# needed to avoid confusion involving atexit handlers) - keyword(import) ident(logging) + keyword(import) include(logging) keyword(if) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(:) comment(# test only files given on cmdline) @@ -24747,19 +24747,19 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(sys)operator(,) ident(os) +keyword(import) include(sys)operator(,) include(os) keyword(if) ident(sys)operator(.)ident(version_info) operator(>=) operator(()integer(3)operator(,)operator(\))operator(:) comment(# copy test suite over to "build/lib" and convert it) keyword(print) operator(()string<delimiter(')content(Copying and converting sources to build/lib/test...)delimiter(')>operator(\)) - keyword(from) ident(distutils)operator(.)ident(util) keyword(import) ident(copydir_run_2to3) + keyword(from) include(distutils.util) keyword(import) include(copydir_run_2to3) ident(testroot) operator(=) ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(__file__)operator(\)) ident(newroot) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(testroot)operator(,) string<delimiter(')content(..)delimiter(')>operator(,) string<delimiter(')content(build/lib/test)delimiter(')>operator(\)) ident(copydir_run_2to3)operator(()ident(testroot)operator(,) ident(newroot)operator(\)) ident(os)operator(.)ident(chdir)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(newroot)operator(,) string<delimiter(')content(..)delimiter(')>operator(\))operator(\)) keyword(try)operator(:) - keyword(import) ident(nose) + keyword(import) include(nose) keyword(except) exception(ImportError)operator(:) keyword(print) operator(()string<delimiter(")content(nose is required to run the test suites)delimiter(")>operator(\)) ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\)) @@ -24770,7 +24770,7 @@ string<delimiter(""")content( )content(Support for Pygments tests)content( )delimiter(""")> -keyword(import) ident(os) +keyword(import) include(os) keyword(def) method(location)operator(()ident(mod_name)operator(\))operator(:) @@ -24789,17 +24789,17 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(os) -keyword(import) ident(unittest) -keyword(import) ident(random) +keyword(import) include(os) +keyword(import) include(unittest) +keyword(import) include(random) -keyword(from) ident(pygments) keyword(import) ident(lexers)operator(,) ident(formatters)operator(,) ident(filters)operator(,) ident(format) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(_TokenType)operator(,) ident(Text) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(RegexLexer) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(img) keyword(import) ident(FontNotFound) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(BytesIO)operator(,) ident(StringIO)operator(,) predefined(bytes)operator(,) ident(b) +keyword(from) include(pygments) keyword(import) include(lexers)operator(,) include(formatters)operator(,) include(filters)operator(,) include(format) +keyword(from) include(pygments.token) keyword(import) include(_TokenType)operator(,) include(Text) +keyword(from) include(pygments.lexer) keyword(import) include(RegexLexer) +keyword(from) include(pygments.formatters.img) keyword(import) include(FontNotFound) +keyword(from) include(pygments.util) keyword(import) include(BytesIO)operator(,) include(StringIO)operator(,) include(bytes)operator(,) include(b) -keyword(import) ident(support) +keyword(import) include(support) ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) @@ -24950,7 +24950,7 @@ keyword(class) class(FormattersTest)operator(()ident(unittest)operator(.)ident(T ident(inst)operator(.)ident(format)operator(()ident(ts)operator(,) ident(out)operator(\)) keyword(def) method(test_encodings)operator(()pre_constant(self)operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) + keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter) comment(# unicode output) ident(fmt) operator(=) ident(HtmlFormatter)operator(()operator(\)) @@ -24970,7 +24970,7 @@ keyword(class) class(FormattersTest)operator(()ident(unittest)operator(.)ident(T pre_constant(self)operator(.)ident(assert_)operator(()string<modifier(u)delimiter(")content(รค)delimiter(")>operator(.)ident(encode)operator(()string<delimiter(")content(utf8)delimiter(")>operator(\)) keyword(in) ident(format)operator(()ident(tokens)operator(,) ident(fmt)operator(\))operator(\)) keyword(def) method(test_styles)operator(()pre_constant(self)operator(\))operator(:) - keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) + keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter) ident(fmt) operator(=) ident(HtmlFormatter)operator(()ident(style)operator(=)string<delimiter(")content(pastie)delimiter(")>operator(\)) keyword(def) method(test_unicode_handling)operator(()pre_constant(self)operator(\))operator(:) @@ -25019,11 +25019,11 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(unittest) -keyword(import) ident(os) +keyword(import) include(unittest) +keyword(import) include(os) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Text)operator(,) ident(Number) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(CLexer) +keyword(from) include(pygments.token) keyword(import) include(Text)operator(,) include(Number) +keyword(from) include(pygments.lexers) keyword(import) include(CLexer) keyword(class) class(CLexerTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) @@ -25056,14 +25056,14 @@ string<delimiter(""")content( comment(# Test the command line interface) -keyword(import) ident(sys)operator(,) ident(os) -keyword(import) ident(unittest) -keyword(import) ident(StringIO) +keyword(import) include(sys)operator(,) include(os) +keyword(import) include(unittest) +keyword(import) include(StringIO) -keyword(from) ident(pygments) keyword(import) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(cmdline) keyword(import) ident(main) keyword(as) ident(cmdline_main) +keyword(from) include(pygments) keyword(import) include(highlight) +keyword(from) include(pygments.cmdline) keyword(import) include(main) keyword(as) ident(cmdline_main) -keyword(import) ident(support) +keyword(import) include(support) ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) @@ -25134,8 +25134,8 @@ keyword(class) class(CmdLineTest)operator(()ident(unittest)operator(.)ident(Test keyword(def) method(test_normal)operator(()pre_constant(self)operator(\))operator(:) comment(# test that cmdline gives the same output as library api) - keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(PythonLexer) - keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) + keyword(from) include(pygments.lexers) keyword(import) include(PythonLexer) + keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter) ident(filename) operator(=) ident(TESTFILE) ident(code) operator(=) predefined(open)operator(()ident(filename)operator(,) string<delimiter(')content(rb)delimiter(')>operator(\))operator(.)ident(read)operator(()operator(\)) @@ -25159,13 +25159,13 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(os) -keyword(import) ident(unittest) +keyword(import) include(os) +keyword(import) include(unittest) -keyword(from) ident(pygments) keyword(import) ident(highlight) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_for_filename)operator(,) ident(get_lexer_by_name) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Error) -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(ClassNotFound)operator(,) ident(b) +keyword(from) include(pygments) keyword(import) include(highlight) +keyword(from) include(pygments.lexers) keyword(import) include(get_lexer_for_filename)operator(,) include(get_lexer_by_name) +keyword(from) include(pygments.token) keyword(import) include(Error) +keyword(from) include(pygments.util) keyword(import) include(ClassNotFound)operator(,) include(b) comment(# generate methods) @@ -25214,18 +25214,18 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(os) -keyword(import) ident(re) -keyword(import) ident(unittest) -keyword(import) ident(StringIO) -keyword(import) ident(tempfile) -keyword(from) ident(os)operator(.)ident(path) keyword(import) ident(join)operator(,) ident(dirname)operator(,) ident(isfile)operator(,) ident(abspath) +keyword(import) include(os) +keyword(import) include(re) +keyword(import) include(unittest) +keyword(import) include(StringIO) +keyword(import) include(tempfile) +keyword(from) include(os.path) keyword(import) include(join)operator(,) include(dirname)operator(,) include(isfile)operator(,) include(abspath) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(PythonLexer) -keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter)operator(,) ident(NullFormatter) -keyword(from) ident(pygments)operator(.)ident(formatters)operator(.)ident(html) keyword(import) ident(escape_html) +keyword(from) include(pygments.lexers) keyword(import) include(PythonLexer) +keyword(from) include(pygments.formatters) keyword(import) include(HtmlFormatter)operator(,) include(NullFormatter) +keyword(from) include(pygments.formatters.html) keyword(import) include(escape_html) -keyword(import) ident(support) +keyword(import) include(support) ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) @@ -25291,7 +25291,7 @@ keyword(class) class(HtmlFormatterTest)operator(()ident(unittest)operator(.)iden ident(catname) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(TESTDIR)operator(,) string<delimiter(')content(dtds)delimiter(')>operator(,) string<delimiter(')content(HTML4.soc)delimiter(')>operator(\)) keyword(try)operator(:) keyword(try)operator(:) - keyword(import) ident(subprocess) + keyword(import) include(subprocess) ident(ret) operator(=) ident(subprocess)operator(.)ident(Popen)operator(()operator([)string<delimiter(')content(nsgmls)delimiter(')>operator(,) string<delimiter(')content(-s)delimiter(')>operator(,) string<delimiter(')content(-c)delimiter(')>operator(,) ident(catname)operator(,) ident(pathname)operator(])operator(,) ident(stdout)operator(=)ident(subprocess)operator(.)ident(PIPE)operator(\))operator(.)ident(wait)operator(()operator(\)) keyword(except) exception(ImportError)operator(:) @@ -25338,14 +25338,14 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(os) -keyword(import) ident(unittest) -keyword(import) ident(tempfile) +keyword(import) include(os) +keyword(import) include(unittest) +keyword(import) include(tempfile) -keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(LatexFormatter) -keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(PythonLexer) +keyword(from) include(pygments.formatters) keyword(import) include(LatexFormatter) +keyword(from) include(pygments.lexers) keyword(import) include(PythonLexer) -keyword(import) ident(support) +keyword(import) include(support) ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) @@ -25365,7 +25365,7 @@ keyword(class) class(LatexFormatterTest)operator(()ident(unittest)operator(.)ide ident(tfile)operator(.)ident(close)operator(()operator(\)) keyword(try)operator(:) keyword(try)operator(:) - keyword(import) ident(subprocess) + keyword(import) include(subprocess) ident(ret) operator(=) ident(subprocess)operator(.)ident(Popen)operator(()operator([)string<delimiter(')content(latex)delimiter(')>operator(,) string<delimiter(')content(-interaction=nonstopmode)delimiter(')>operator(,) ident(pathname)operator(])operator(,) ident(stdout)operator(=)ident(subprocess)operator(.)ident(PIPE)operator(\))operator(.)ident(wait)operator(()operator(\)) @@ -25391,10 +25391,10 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(unittest) +keyword(import) include(unittest) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Text) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(RegexLexer) +keyword(from) include(pygments.token) keyword(import) include(Text) +keyword(from) include(pygments.lexer) keyword(import) include(RegexLexer) keyword(class) class(TestLexer)operator(()ident(RegexLexer)operator(\))operator(:) string<delimiter(""")content(Test tuple state transitions including #pop.)delimiter(""")> @@ -25428,11 +25428,11 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(unittest) -keyword(import) ident(StringIO) -keyword(import) ident(sys) +keyword(import) include(unittest) +keyword(import) include(StringIO) +keyword(import) include(sys) -keyword(from) ident(pygments) keyword(import) ident(token) +keyword(from) include(pygments) keyword(import) include(token) keyword(class) class(TokenTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) @@ -25472,9 +25472,9 @@ keyword(class) class(TokenTest)operator(()ident(unittest)operator(.)ident(TestCa keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) ident(unittest)operator(.)ident(main)operator(()operator(\)) -keyword(import) ident(unittest) -keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(using)operator(,) ident(bygroups)operator(,) ident(this)operator(,) ident(RegexLexer) -keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(String)operator(,) ident(Text)operator(,) ident(Keyword) +keyword(import) include(unittest) +keyword(from) include(pygments.lexer) keyword(import) include(using)operator(,) include(bygroups)operator(,) include(this)operator(,) include(RegexLexer) +keyword(from) include(pygments.token) keyword(import) include(String)operator(,) include(Text)operator(,) include(Keyword) keyword(class) class(TestLexer)operator(()ident(RegexLexer)operator(\))operator(:) ident(tokens) operator(=) operator({) @@ -25512,10 +25512,10 @@ string<delimiter(""")content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(import) ident(unittest) -keyword(import) ident(os) +keyword(import) include(unittest) +keyword(import) include(os) -keyword(from) ident(pygments) keyword(import) ident(util) +keyword(from) include(pygments) keyword(import) include(util) keyword(class) class(UtilTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) diff --git a/test/scanners/python/unistring.expected.raydebug b/test/scanners/python/unistring.expected.raydebug index 2a88b8e..89c89b8 100644 --- a/test/scanners/python/unistring.expected.raydebug +++ b/test/scanners/python/unistring.expected.raydebug @@ -11,7 +11,7 @@ string<delimiter(""")content( )content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( )content( :license: BSD, see LICENSE for details.)content( )delimiter(""")> -keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(u_prefix) +keyword(from) include(pygments.util) keyword(import) include(u_prefix) ident(Cc) operator(=) string<modifier(u)delimiter(')char(\\x00)char(\\x01)char(\\x02)char(\\x03)char(\\x04)char(\\x05)char(\\x06)char(\\x07)char(\\x08)char(\\t)char(\\n)char(\\x0b)char(\\x0c)char(\\r)char(\\x0e)char(\\x0f)char(\\x10)char(\\x11)char(\\x12)char(\\x13)char(\\x14)char(\\x15)char(\\x16)char(\\x17)char(\\x18)char(\\x19)char(\\x1a)char(\\x1b)char(\\x1c)char(\\x1d)char(\\x1e)char(\\x1f)char(\\x7f)char(\\x80)char(\\x81)char(\\x82)char(\\x83)char(\\x84)char(\\x85)char(\\x86)char(\\x87)char(\\x88)char(\\x89)char(\\x8a)char(\\x8b)char(\\x8c)char(\\x8d)char(\\x8e)char(\\x8f)char(\\x90)char(\\x91)char(\\x92)char(\\x93)char(\\x94)char(\\x95)char(\\x96)char(\\x97)char(\\x98)char(\\x99)char(\\x9a)char(\\x9b)char(\\x9c)char(\\x9d)char(\\x9e)char(\\x9f)delimiter(')> @@ -92,7 +92,7 @@ keyword(def) method(allexcept)operator(()operator(*)ident(args)operator(\))opera keyword(return) string<modifier(u)delimiter(')delimiter(')>operator(.)ident(join)operator(()operator([)predefined(globals)operator(()operator(\))operator([)ident(cat)operator(]) keyword(for) ident(cat) keyword(in) ident(newcats)operator(])operator(\)) keyword(if) ident(__name__) operator(==) string<delimiter(')content(__main__)delimiter(')>operator(:) - keyword(import) ident(unicodedata) + keyword(import) include(unicodedata) ident(categories) operator(=) operator({)operator(}) |