From 04e1ddf7e29af75c9b90da3153c77de6166d0ec7 Mon Sep 17 00:00:00 2001 From: murphy Date: Mon, 20 Apr 2009 21:10:33 +0000 Subject: Added test outputs for Python. --- test/scanners/python/pygments.expected.raydebug | 25595 ++++++++++++++++++++++ 1 file changed, 25595 insertions(+) create mode 100644 test/scanners/python/pygments.expected.raydebug (limited to 'test/scanners/python/pygments.expected.raydebug') diff --git a/test/scanners/python/pygments.expected.raydebug b/test/scanners/python/pygments.expected.raydebug new file mode 100644 index 0000000..9a1a9d2 --- /dev/null +++ b/test/scanners/python/pygments.expected.raydebug @@ -0,0 +1,25595 @@ +comment(#!/usr/bin/env python) +comment(# -*- coding: utf-8 -*-) +string + +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(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) ident(jinja) keyword(import) ident(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) + + +ident(LEXERDOC) operator(=) string + +keyword(def) ident(generate_lexer_docs)operator(()operator(\))operator(:) + keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(LEXERS) + + ident(out) operator(=) operator([)operator(]) + + ident(modules) operator(=) operator({)operator(}) + ident(moduledocstrings) operator(=) operator({)operator(}) + keyword(for) ident(classname)operator(,) ident(data) keyword(in) predefined(sorted)operator(()ident(LEXERS)operator(.)ident(iteritems)operator(()operator(\))operator(,) ident(key)operator(=)keyword(lambda) ident(x)operator(:) ident(x)operator([)integer(0)operator(])operator(\))operator(:) + ident(module) operator(=) ident(data)operator([)integer(0)operator(]) + ident(mod) operator(=) predefined(__import__)operator(()ident(module)operator(,) pre_constant(None)operator(,) pre_constant(None)operator(,) operator([)ident(classname)operator(])operator(\)) + ident(cls) operator(=) predefined(getattr)operator(()ident(mod)operator(,) ident(classname)operator(\)) + keyword(if) keyword(not) ident(cls)operator(.)ident(__doc__)operator(:) + keyword(print) string operator(%) ident(classname) + ident(modules)operator(.)ident(setdefault)operator(()ident(module)operator(,) operator([)operator(])operator(\))operator(.)ident(append)operator(()operator(() + ident(classname)operator(,) + ident(cls)operator(.)ident(__doc__)operator(,) + stringoperator(.)ident(join)operator(()ident(data)operator([)integer(2)operator(])operator(\)) keyword(or) stringoperator(,) + stringoperator(.)ident(join)operator(()ident(data)operator([)integer(3)operator(])operator(\))operator(.)ident(replace)operator(()stringoperator(,) stringoperator(\)) keyword(or) stringoperator(,) + stringoperator(.)ident(join)operator(()ident(data)operator([)integer(4)operator(])operator(\)) keyword(or) stringoperator(\))operator(\)) + keyword(if) ident(module) keyword(not) keyword(in) ident(moduledocstrings)operator(:) + ident(moduledocstrings)operator([)ident(module)operator(]) operator(=) ident(mod)operator(.)ident(__doc__) + + keyword(for) ident(module)operator(,) ident(lexers) keyword(in) predefined(sorted)operator(()ident(modules)operator(.)ident(iteritems)operator(()operator(\))operator(,) ident(key)operator(=)keyword(lambda) ident(x)operator(:) ident(x)operator([)integer(0)operator(])operator(\))operator(:) + ident(heading) operator(=) ident(moduledocstrings)operator([)ident(module)operator(])operator(.)ident(splitlines)operator(()operator(\))operator([)integer(4)operator(])operator(.)ident(strip)operator(()operator(\))operator(.)ident(rstrip)operator(()stringoperator(\)) + ident(out)operator(.)ident(append)operator(()string operator(+) ident(heading) operator(+) string operator(+) stringoperator(*)predefined(len)operator(()ident(heading)operator(\)) operator(+) stringoperator(\)) + keyword(for) ident(data) keyword(in) ident(lexers)operator(:) + ident(out)operator(.)ident(append)operator(()ident(LEXERDOC) operator(%) ident(data)operator(\)) + keyword(return) stringoperator(.)ident(join)operator(()ident(out)operator(\)) + +keyword(def) ident(generate_formatter_docs)operator(()operator(\))operator(:) + keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(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(,) + ident(key)operator(=)keyword(lambda) ident(x)operator(:) ident(x)operator([)integer(0)operator(])operator(.)ident(__name__)operator(\))operator(:) + ident(heading) operator(=) ident(cls)operator(.)ident(__name__) + ident(out)operator(.)ident(append)operator(()string operator(+) ident(heading) operator(+) string operator(+) stringoperator(*)operator(()integer(2)operator(+)predefined(len)operator(()ident(heading)operator(\))operator(\)) operator(+) stringoperator(\)) + ident(out)operator(.)ident(append)operator(()ident(cls)operator(.)ident(__doc__)operator(\)) + ident(out)operator(.)ident(append)operator(()string operator(%) operator(()stringoperator(.)ident(join)operator(()ident(data)operator([)integer(1)operator(])operator(\)) keyword(or) stringoperator(,) stringoperator(.)ident(join)operator(()ident(data)operator([)integer(2)operator(])operator(\))operator(.)ident(replace)operator(()stringoperator(,) stringoperator(\)) keyword(or) stringoperator(\))operator(\)) + keyword(return) stringoperator(.)ident(join)operator(()ident(out)operator(\)) + +keyword(def) ident(generate_filter_docs)operator(()operator(\))operator(:) + keyword(from) ident(pygments)operator(.)ident(filters) keyword(import) ident(FILTERS) + + ident(out) operator(=) operator([)operator(]) + keyword(for) ident(name)operator(,) ident(cls) keyword(in) ident(FILTERS)operator(.)ident(iteritems)operator(()operator(\))operator(:) + ident(out)operator(.)ident(append)operator(()string operator(%) operator(()ident(cls)operator(.)ident(__name__)operator(,) ident(cls)operator(.)ident(__doc__)operator(,) ident(name)operator(\))operator(\)) + keyword(return) stringoperator(.)ident(join)operator(()ident(out)operator(\)) + +keyword(def) ident(generate_changelog)operator(()operator(\))operator(:) + ident(fn) operator(=) ident(os)operator(.)ident(path)operator(.)ident(abspath)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(__file__)operator(\))operator(,) stringoperator(,) + stringoperator(\))operator(\)) + ident(f) operator(=) predefined(file)operator(()ident(fn)operator(\)) + ident(result) operator(=) operator([)operator(]) + ident(in_header) operator(=) pre_constant(False) + ident(header) operator(=) pre_constant(True) + keyword(for) ident(line) keyword(in) ident(f)operator(:) + keyword(if) ident(header)operator(:) + keyword(if) keyword(not) ident(in_header) keyword(and) ident(line)operator(.)ident(strip)operator(()operator(\))operator(:) + ident(in_header) operator(=) pre_constant(True) + keyword(elif) ident(in_header) keyword(and) keyword(not) ident(line)operator(.)ident(strip)operator(()operator(\))operator(:) + ident(header) operator(=) pre_constant(False) + keyword(else)operator(:) + ident(result)operator(.)ident(append)operator(()ident(line)operator(.)ident(rstrip)operator(()operator(\))operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + keyword(return) stringoperator(.)ident(join)operator(()ident(result)operator(\)) + +keyword(def) ident(generate_authors)operator(()operator(\))operator(:) + ident(fn) operator(=) ident(os)operator(.)ident(path)operator(.)ident(abspath)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(__file__)operator(\))operator(,) stringoperator(,) + stringoperator(\))operator(\)) + ident(f) operator(=) predefined(file)operator(()ident(fn)operator(\)) + ident(r) operator(=) ident(f)operator(.)ident(read)operator(()operator(\))operator(.)ident(rstrip)operator(()operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + keyword(return) ident(r) + +ident(LEXERDOCS) operator(=) ident(generate_lexer_docs)operator(()operator(\)) +ident(FORMATTERDOCS) operator(=) ident(generate_formatter_docs)operator(()operator(\)) +ident(FILTERDOCS) operator(=) ident(generate_filter_docs)operator(()operator(\)) +ident(CHANGELOG) operator(=) ident(generate_changelog)operator(()operator(\)) +ident(AUTHORS) operator(=) ident(generate_authors)operator(()operator(\)) + + +ident(PYGMENTS_FORMATTER) operator(=) ident(HtmlFormatter)operator(()ident(style)operator(=)stringoperator(,) ident(cssclass)operator(=)stringoperator(\)) + +ident(USAGE) operator(=) string [ ...])content( +)content( +)content(Generate either python or html files out of the documentation.)content( +)content( +)content(Mode can either be python or html.)char(\\ +)delimiter(''')> operator(%) ident(sys)operator(.)ident(argv)operator([)integer(0)operator(]) + +ident(TEMPLATE) operator(=) string)content( +)content()content( +)content()content( +)content( {{ title }} — Pygments)content( +)content( )content( +)content( )content( +)content()content( +)content()content( +)content(
)content( +)content(

Pygments

)content( +)content(

{{ title }}

)content( +)content( {% if file_id != "index" %})content( +)content( « Back To Index)content( +)content( {% endif %})content( +)content( {% if toc %})content( +)content(
)content( +)content(

Contents

)content( +)content(
    )content( +)content( {% for key, value in toc %})content( +)content(
  • {{ value }}
  • )content( +)content( {% endfor %})content( +)content(
)content( +)content(
)content( +)content( {% endif %})content( +)content( {{ body }})content( +)content(
)content( +)content()content( +)content()content( +)content()char(\\ +)delimiter(''')> + +ident(STYLESHEET) operator(=) string, it's generated by ReST for `x` */)content( +)content( font-size: 13px;)content( +)content( font-family: Bitstream Vera Sans Mono,monospace;)content( +)content( font-weight: bold;)content( +)content( font-style: normal;)content( +)content(})content( +)content( +)content(#backlink {)content( +)content( float: right;)content( +)content( font-size: 11px;)content( +)content( color: #888;)content( +)content(})content( +)content( +)content(div.toc {)content( +)content( margin: 0 0 10px 0;)content( +)content(})content( +)content( +)content(div.toc h2 {)content( +)content( font-size: 20px;)content( +)content(})content( +)delimiter(''')> comment(#') + + +keyword(def) ident(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(:) + keyword(try)operator(:) + ident(lexer) operator(=) ident(get_lexer_by_name)operator(()ident(arguments)operator([)integer(0)operator(])operator(\)) + keyword(except) exception(ValueError)operator(:) + comment(# no lexer found) + ident(lexer) operator(=) ident(get_lexer_by_name)operator(()stringoperator(\)) + ident(parsed) operator(=) ident(highlight)operator(()stringoperator(.)ident(join)operator(()ident(content)operator(\))operator(,) ident(lexer)operator(,) ident(PYGMENTS_FORMATTER)operator(\)) + keyword(return) operator([)ident(nodes)operator(.)ident(raw)operator(()stringoperator(,) ident(parsed)operator(,) ident(format)operator(=)stringoperator(\))operator(]) +ident(pygments_directive)operator(.)ident(arguments) operator(=) operator(()integer(1)operator(,) integer(0)operator(,) integer(1)operator(\)) +ident(pygments_directive)operator(.)ident(content) operator(=) integer(1) +ident(directives)operator(.)ident(register_directive)operator(()stringoperator(,) ident(pygments_directive)operator(\)) + + +keyword(def) ident(create_translator)operator(()ident(link_style)operator(\))operator(:) + keyword(class) ident(Translator)operator(()ident(html4css1)operator(.)ident(HTMLTranslator)operator(\))operator(:) + keyword(def) ident(visit_reference)operator(()pre_constant(self)operator(,) ident(node)operator(\))operator(:) + ident(refuri) operator(=) ident(node)operator(.)ident(get)operator(()stringoperator(\)) + keyword(if) ident(refuri) keyword(is) keyword(not) pre_constant(None) keyword(and) string keyword(not) keyword(in) ident(refuri) keyword(and) ident(refuri)operator(.)ident(endswith)operator(()stringoperator(\))operator(:) + ident(node)operator([)stringoperator(]) operator(=) ident(link_style)operator(()ident(refuri)operator([)operator(:)operator(-)integer(4)operator(])operator(\)) + ident(html4css1)operator(.)ident(HTMLTranslator)operator(.)ident(visit_reference)operator(()pre_constant(self)operator(,) ident(node)operator(\)) + keyword(return) ident(Translator) + + +keyword(class) ident(DocumentationWriter)operator(()ident(html4css1)operator(.)ident(Writer)operator(\))operator(:) + + keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(link_style)operator(\))operator(:) + ident(html4css1)operator(.)ident(Writer)operator(.)ident(__init__)operator(()pre_constant(self)operator(\)) + pre_constant(self)operator(.)ident(translator_class) operator(=) ident(create_translator)operator(()ident(link_style)operator(\)) + + keyword(def) ident(translate)operator(()pre_constant(self)operator(\))operator(:) + ident(html4css1)operator(.)ident(Writer)operator(.)ident(translate)operator(()pre_constant(self)operator(\)) + comment(# generate table of contents) + ident(contents) operator(=) pre_constant(self)operator(.)ident(build_contents)operator(()pre_constant(self)operator(.)ident(document)operator(\)) + ident(contents_doc) operator(=) pre_constant(self)operator(.)ident(document)operator(.)ident(copy)operator(()operator(\)) + ident(contents_doc)operator(.)ident(children) operator(=) ident(contents) + ident(contents_visitor) operator(=) pre_constant(self)operator(.)ident(translator_class)operator(()ident(contents_doc)operator(\)) + ident(contents_doc)operator(.)ident(walkabout)operator(()ident(contents_visitor)operator(\)) + pre_constant(self)operator(.)ident(parts)operator([)stringoperator(]) operator(=) pre_constant(self)operator(.)ident(_generated_toc) + + keyword(def) ident(build_contents)operator(()pre_constant(self)operator(,) ident(node)operator(,) ident(level)operator(=)integer(0)operator(\))operator(:) + ident(sections) operator(=) operator([)operator(]) + ident(i) operator(=) predefined(len)operator(()ident(node)operator(\)) operator(-) integer(1) + keyword(while) ident(i) operator(>=) integer(0) keyword(and) predefined(isinstance)operator(()ident(node)operator([)ident(i)operator(])operator(,) ident(nodes)operator(.)ident(section)operator(\))operator(:) + ident(sections)operator(.)ident(append)operator(()ident(node)operator([)ident(i)operator(])operator(\)) + ident(i) operator(-=) integer(1) + ident(sections)operator(.)ident(reverse)operator(()operator(\)) + ident(toc) operator(=) operator([)operator(]) + keyword(for) ident(section) keyword(in) ident(sections)operator(:) + keyword(try)operator(:) + ident(reference) operator(=) ident(nodes)operator(.)ident(reference)operator(()stringoperator(,) stringoperator(,) ident(refid)operator(=)ident(section)operator([)stringoperator(])operator([)integer(0)operator(])operator(,) operator(*)ident(section)operator([)integer(0)operator(])operator(\)) + keyword(except) exception(IndexError)operator(:) + keyword(continue) + ident(ref_id) operator(=) ident(reference)operator([)stringoperator(]) + ident(text) operator(=) ident(escape)operator(()ident(reference)operator(.)ident(astext)operator(()operator(\))operator(.)ident(encode)operator(()stringoperator(\))operator(\)) + ident(toc)operator(.)ident(append)operator(()operator(()ident(ref_id)operator(,) ident(text)operator(\))operator(\)) + + pre_constant(self)operator(.)ident(_generated_toc) operator(=) operator([)operator(()string operator(%) ident(href)operator(,) ident(caption)operator(\)) keyword(for) ident(href)operator(,) ident(caption) keyword(in) ident(toc)operator(]) + comment(# no further processing) + keyword(return) operator([)operator(]) + + +keyword(def) ident(generate_documentation)operator(()ident(data)operator(,) ident(link_style)operator(\))operator(:) + ident(writer) operator(=) ident(DocumentationWriter)operator(()ident(link_style)operator(\)) + ident(data) operator(=) ident(data)operator(.)ident(replace)operator(()stringoperator(,) ident(LEXERDOCS)operator(\))operator(.)\ + ident(replace)operator(()stringoperator(,) ident(FORMATTERDOCS)operator(\))operator(.)\ + ident(replace)operator(()stringoperator(,) ident(FILTERDOCS)operator(\))operator(.)\ + ident(replace)operator(()stringoperator(,) ident(CHANGELOG)operator(\))operator(.)\ + ident(replace)operator(()stringoperator(,) ident(AUTHORS)operator(\)) + ident(parts) operator(=) ident(publish_parts)operator(() + ident(data)operator(,) + ident(writer)operator(=)ident(writer)operator(,) + ident(settings_overrides)operator(=)operator({) + stringoperator(:) integer(3)operator(,) + stringoperator(:) integer(50)operator(,) + operator(}) + operator(\)) + keyword(return) operator({) + stringoperator(:) ident(parts)operator([)stringoperator(])operator(.)ident(encode)operator(()stringoperator(\))operator(,) + stringoperator(:) ident(parts)operator([)stringoperator(])operator(.)ident(encode)operator(()stringoperator(\))operator(,) + stringoperator(:) ident(parts)operator([)stringoperator(]) + operator(}) + + +keyword(def) ident(handle_python)operator(()ident(filename)operator(,) ident(fp)operator(,) ident(dst)operator(\))operator(:) + ident(now) operator(=) ident(datetime)operator(.)ident(now)operator(()operator(\)) + ident(title) operator(=) ident(os)operator(.)ident(path)operator(.)ident(basename)operator(()ident(filename)operator(\))operator([)operator(:)operator(-)integer(4)operator(]) + ident(content) operator(=) ident(fp)operator(.)ident(read)operator(()operator(\)) + keyword(def) ident(urlize)operator(()ident(href)operator(\))operator(:) + comment(# create links for the pygments webpage) + keyword(if) ident(href) operator(==) stringoperator(:) + keyword(return) string + keyword(else)operator(:) + keyword(return) string operator(%) ident(href) + ident(parts) operator(=) ident(generate_documentation)operator(()ident(content)operator(,) ident(urlize)operator(\)) + ident(result) operator(=) predefined(file)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(dst)operator(,) ident(title) operator(+) stringoperator(\))operator(,) stringoperator(\)) + ident(result)operator(.)ident(write)operator(()stringoperator(\)) + ident(result)operator(.)ident(write)operator(()string operator(%) ident(title)operator(\)) + ident(result)operator(.)ident(write)operator(()string operator(%) operator(()string operator(*) operator(()integer(24) operator(+) predefined(len)operator(()ident(title)operator(\))operator(\))operator(\))operator(\)) + ident(result)operator(.)ident(write)operator(()string operator(%) ident(now)operator(\)) + ident(result)operator(.)ident(write)operator(()stringoperator(\)) + ident(result)operator(.)ident(write)operator(()string operator(%) ident(now)operator(\)) + ident(result)operator(.)ident(write)operator(()string operator(%) ident(parts)operator([)stringoperator(])operator(\)) + ident(result)operator(.)ident(write)operator(()string operator(%) ident(parts)operator([)stringoperator(])operator(\)) + ident(result)operator(.)ident(write)operator(()string operator(%) ident(parts)operator([)stringoperator(])operator(\)) + ident(result)operator(.)ident(close)operator(()operator(\)) + + +keyword(def) ident(handle_html)operator(()ident(filename)operator(,) ident(fp)operator(,) ident(dst)operator(\))operator(:) + ident(now) operator(=) ident(datetime)operator(.)ident(now)operator(()operator(\)) + ident(title) operator(=) ident(os)operator(.)ident(path)operator(.)ident(basename)operator(()ident(filename)operator(\))operator([)operator(:)operator(-)integer(4)operator(]) + ident(content) operator(=) ident(fp)operator(.)ident(read)operator(()operator(\)) + ident(c) operator(=) ident(generate_documentation)operator(()ident(content)operator(,) operator(()keyword(lambda) ident(x)operator(:) string operator(%) ident(x)operator(\))operator(\)) + ident(result) operator(=) predefined(file)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(dst)operator(,) ident(title) operator(+) stringoperator(\))operator(,) stringoperator(\)) + ident(c)operator([)stringoperator(]) operator(=) ident(STYLESHEET) operator(+) ident(PYGMENTS_FORMATTER)operator(.)ident(get_style_defs)operator(()stringoperator(\)) + ident(c)operator([)stringoperator(]) operator(=) ident(now) + ident(c)operator([)stringoperator(]) operator(=) ident(title) + ident(t) operator(=) ident(from_string)operator(()ident(TEMPLATE)operator(\)) + ident(result)operator(.)ident(write)operator(()ident(t)operator(.)ident(render)operator(()ident(c)operator(\))operator(.)ident(encode)operator(()stringoperator(\))operator(\)) + ident(result)operator(.)ident(close)operator(()operator(\)) + + +keyword(def) ident(run)operator(()ident(handle_file)operator(,) ident(dst)operator(,) ident(sources)operator(=)operator(()operator(\))operator(\))operator(:) + ident(path) operator(=) ident(os)operator(.)ident(path)operator(.)ident(abspath)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(__file__)operator(\))operator(,) stringoperator(\))operator(\)) + keyword(if) keyword(not) ident(sources)operator(:) + ident(sources) operator(=) operator([)ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(path)operator(,) ident(fn)operator(\)) keyword(for) ident(fn) keyword(in) ident(os)operator(.)ident(listdir)operator(()ident(path)operator(\))operator(]) + keyword(for) ident(fn) keyword(in) ident(sources)operator(:) + keyword(if) keyword(not) ident(os)operator(.)ident(path)operator(.)ident(isfile)operator(()ident(fn)operator(\))operator(:) + keyword(continue) + keyword(print) string operator(%) ident(fn) + ident(f) operator(=) predefined(open)operator(()ident(fn)operator(\)) + keyword(try)operator(:) + ident(handle_file)operator(()ident(fn)operator(,) ident(f)operator(,) ident(dst)operator(\)) + keyword(finally)operator(:) + ident(f)operator(.)ident(close)operator(()operator(\)) + + +keyword(def) ident(main)operator(()ident(mode)operator(,) ident(dst)operator(=)stringoperator(,) operator(*)ident(sources)operator(\))operator(:) + keyword(try)operator(:) + ident(handler) operator(=) operator({) + stringoperator(:) ident(handle_html)operator(,) + stringoperator(:) ident(handle_python) + operator(})operator([)ident(mode)operator(]) + keyword(except) exception(KeyError)operator(:) + keyword(print) string operator(%) ident(mode) + ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\)) + ident(run)operator(()ident(handler)operator(,) ident(os)operator(.)ident(path)operator(.)ident(realpath)operator(()ident(dst)operator(\))operator(,) ident(sources)operator(\)) + + +keyword(if) ident(__name__) operator(==) stringoperator(:) + keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\)) operator(==) integer(1)operator(:) + keyword(print) ident(USAGE) + keyword(else)operator(:) + ident(main)operator(()operator(*)ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(\)) +comment(# -*- coding: utf-8 -*-) +string -f html > pygments.css``)content( +)content( to create a stylesheet to be added to the website.)content( +)content( +)content( You can then highlight source code in your markdown markup::)content( +)content( +)content( [sourcecode:lexer])content( +)content( some code)content( +)content( [/sourcecode])content( +)content( +)content( .. _Markdown: http://www.freewisdom.org/projects/python-markdown/)content( +)content( +)content( :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.)content( +)content( :license: BSD, see LICENSE for details.)content( +)delimiter(""")> + +comment(# Options) +comment(# ~~~~~~~) + +comment(# Set to True if you want inline CSS styles instead of classes) +ident(INLINESTYLES) operator(=) pre_constant(False) + + +keyword(import) ident(re) + +keyword(from) ident(markdown) keyword(import) ident(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(class) ident(CodeBlockPreprocessor)operator(()ident(TextPreprocessor)operator(\))operator(:) + + ident(pattern) operator(=) ident(re)operator(.)ident(compile)operator(() + stringoperator(,) ident(re)operator(.)ident(S)operator(\)) + + ident(formatter) operator(=) ident(HtmlFormatter)operator(()ident(noclasses)operator(=)ident(INLINESTYLES)operator(\)) + + keyword(def) ident(run)operator(()pre_constant(self)operator(,) ident(lines)operator(\))operator(:) + keyword(def) ident(repl)operator(()ident(m)operator(\))operator(:) + keyword(try)operator(:) + ident(lexer) operator(=) ident(get_lexer_by_name)operator(()ident(m)operator(.)ident(group)operator(()integer(1)operator(\))operator(\)) + keyword(except) exception(ValueError)operator(:) + ident(lexer) operator(=) ident(TextLexer)operator(()operator(\)) + ident(code) operator(=) ident(highlight)operator(()ident(m)operator(.)ident(group)operator(()integer(2)operator(\))operator(,) ident(lexer)operator(,) pre_constant(self)operator(.)ident(formatter)operator(\)) + ident(code) operator(=) ident(code)operator(.)ident(replace)operator(()stringoperator(,) stringoperator(\))operator(.)ident(replace)operator(()stringoperator(,) string)delimiter(')>operator(\)) + keyword(return) string%s)char(\\n)char(\\n)delimiter(')> operator(%) ident(code) + keyword(return) pre_constant(self)operator(.)ident(pattern)operator(.)ident(sub)operator(() + ident(repl)operator(,) ident(lines)operator(\))comment(# -*- coding: utf-8 -*-) +string + +comment(# Options) +comment(# ~~~~~~~) + +comment(# Set to True if you want to highlight attachments, in addition to) +comment(# {{{ }}} blocks.) +ident(ATTACHMENTS) operator(=) pre_constant(True) + +comment(# Set to True if you want inline CSS styles instead of classes) +ident(INLINESTYLES) operator(=) pre_constant(False) + + +keyword(import) ident(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) + + +comment(# wrap lines in s so that the Moin-generated line numbers work) +keyword(class) ident(MoinHtmlFormatter)operator(()ident(HtmlFormatter)operator(\))operator(:) + keyword(def) ident(wrap)operator(()pre_constant(self)operator(,) ident(source)operator(,) ident(outfile)operator(\))operator(:) + keyword(for) ident(line) keyword(in) ident(source)operator(:) + keyword(yield) integer(1)operator(,) string)delimiter(')> operator(+) ident(line)operator([)integer(1)operator(]) operator(+) string)delimiter(')> + +ident(htmlformatter) operator(=) ident(MoinHtmlFormatter)operator(()ident(noclasses)operator(=)ident(INLINESTYLES)operator(\)) +ident(textlexer) operator(=) ident(TextLexer)operator(()operator(\)) +ident(codeid) operator(=) operator([)integer(0)operator(]) + + +keyword(class) ident(Parser)operator(:) + string + keyword(if) ident(ATTACHMENTS)operator(:) + ident(extensions) operator(=) string + keyword(else)operator(:) + ident(extensions) operator(=) operator([)operator(]) + + ident(Dependencies) operator(=) operator([)operator(]) + + keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(raw)operator(,) ident(request)operator(,) operator(**)ident(kw)operator(\))operator(:) + pre_constant(self)operator(.)ident(raw) operator(=) ident(raw) + pre_constant(self)operator(.)ident(req) operator(=) ident(request) + keyword(if) string keyword(in) ident(kw)operator(:) + comment(# called from a {{{ }}} block) + keyword(try)operator(:) + pre_constant(self)operator(.)ident(lexer) operator(=) ident(get_lexer_by_name)operator(()ident(kw)operator([)stringoperator(])operator(.)ident(strip)operator(()operator(\))operator(\)) + keyword(except) ident(ClassNotFound)operator(:) + pre_constant(self)operator(.)ident(lexer) operator(=) ident(textlexer) + keyword(return) + keyword(if) string keyword(in) ident(kw)operator(:) + comment(# called for an attachment) + ident(filename) operator(=) ident(kw)operator([)stringoperator(]) + keyword(else)operator(:) + comment(# called for an attachment by an older moin) + comment(# HACK: find out the filename by peeking into the execution) + comment(# frame which might not always work) + keyword(try)operator(:) + ident(frame) operator(=) ident(sys)operator(.)ident(_getframe)operator(()integer(1)operator(\)) + ident(filename) operator(=) ident(frame)operator(.)ident(f_locals)operator([)stringoperator(]) + keyword(except)operator(:) + ident(filename) operator(=) string + keyword(try)operator(:) + pre_constant(self)operator(.)ident(lexer) operator(=) ident(get_lexer_for_filename)operator(()ident(filename)operator(\)) + keyword(except) ident(ClassNotFound)operator(:) + pre_constant(self)operator(.)ident(lexer) operator(=) ident(textlexer) + + keyword(def) ident(format)operator(()pre_constant(self)operator(,) ident(formatter)operator(\))operator(:) + ident(codeid)operator([)integer(0)operator(]) operator(+=) integer(1) + predefined(id) operator(=) string operator(%) ident(codeid)operator([)integer(0)operator(]) + ident(w) operator(=) pre_constant(self)operator(.)ident(req)operator(.)ident(write) + ident(w)operator(()ident(formatter)operator(.)ident(code_area)operator(()integer(1)operator(,) predefined(id)operator(,) ident(start)operator(=)integer(1)operator(,) ident(step)operator(=)integer(1)operator(\))operator(\)) + ident(w)operator(()ident(formatter)operator(.)ident(rawHTML)operator(()ident(highlight)operator(()pre_constant(self)operator(.)ident(raw)operator(,) pre_constant(self)operator(.)ident(lexer)operator(,) ident(htmlformatter)operator(\))operator(\))operator(\)) + ident(w)operator(()ident(formatter)operator(.)ident(code_area)operator(()integer(0)operator(,) predefined(id)operator(\))operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +comment(# Options) +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) + +comment(# The default formatter) +ident(DEFAULT) operator(=) ident(HtmlFormatter)operator(()ident(noclasses)operator(=)ident(INLINESTYLES)operator(\)) + +comment(# Add name -> formatter pairs for every variant you want to use) +ident(VARIANTS) operator(=) operator({) + comment(# 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True\),) +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) ident(pygments) keyword(import) ident(highlight) +keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(get_lexer_by_name)operator(,) ident(TextLexer) + +keyword(def) ident(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(:) + keyword(try)operator(:) + ident(lexer) operator(=) ident(get_lexer_by_name)operator(()ident(arguments)operator([)integer(0)operator(])operator(\)) + keyword(except) exception(ValueError)operator(:) + comment(# no lexer found - use the text one instead of an exception) + ident(lexer) operator(=) ident(TextLexer)operator(()operator(\)) + comment(# take an arbitrary option if more than one is given) + ident(formatter) operator(=) ident(options) keyword(and) ident(VARIANTS)operator([)ident(options)operator(.)ident(keys)operator(()operator(\))operator([)integer(0)operator(])operator(]) keyword(or) ident(DEFAULT) + ident(parsed) operator(=) ident(highlight)operator(()stringoperator(.)ident(join)operator(()ident(content)operator(\))operator(,) ident(lexer)operator(,) ident(formatter)operator(\)) + keyword(return) operator([)ident(nodes)operator(.)ident(raw)operator(()stringoperator(,) ident(parsed)operator(,) ident(format)operator(=)stringoperator(\))operator(]) + +ident(pygments_directive)operator(.)ident(arguments) operator(=) operator(()integer(1)operator(,) integer(0)operator(,) integer(1)operator(\)) +ident(pygments_directive)operator(.)ident(content) operator(=) integer(1) +ident(pygments_directive)operator(.)ident(options) operator(=) predefined(dict)operator(()operator([)operator(()ident(key)operator(,) ident(directives)operator(.)ident(flag)operator(\)) keyword(for) ident(key) keyword(in) ident(VARIANTS)operator(])operator(\)) + +ident(directives)operator(.)ident(register_directive)operator(()stringoperator(,) ident(pygments_directive)operator(\)) +comment(#!python) +string +keyword(import) ident(sys) +ident(DEFAULT_VERSION) operator(=) string +ident(DEFAULT_URL) operator(=) string operator(%) ident(sys)operator(.)ident(version)operator([)operator(:)integer(3)operator(]) + +ident(md5_data) operator(=) operator({) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) +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(def) ident(_validate_md5)operator(()ident(egg_name)operator(,) ident(data)operator(\))operator(:) + keyword(if) ident(egg_name) keyword(in) ident(md5_data)operator(:) + ident(digest) operator(=) ident(md5)operator(()ident(data)operator(\))operator(.)ident(hexdigest)operator(()operator(\)) + keyword(if) ident(digest) operator(!=) ident(md5_data)operator([)ident(egg_name)operator(])operator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) operator(() + string + operator(%) ident(egg_name) + operator(\)) + ident(sys)operator(.)ident(exit)operator(()integer(2)operator(\)) + keyword(return) ident(data) + +keyword(def) ident(use_setuptools)operator(() + ident(version)operator(=)ident(DEFAULT_VERSION)operator(,) ident(download_base)operator(=)ident(DEFAULT_URL)operator(,) ident(to_dir)operator(=)ident(os)operator(.)ident(curdir)operator(,) + ident(download_delay)operator(=)integer(15) +operator(\))operator(:) + string + ident(was_imported) operator(=) string keyword(in) ident(sys)operator(.)ident(modules) keyword(or) string keyword(in) ident(sys)operator(.)ident(modules) + keyword(def) ident(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(try)operator(:) + keyword(import) ident(pkg_resources) + keyword(except) exception(ImportError)operator(:) + keyword(return) ident(do_download)operator(()operator(\)) + keyword(try)operator(:) + ident(pkg_resources)operator(.)ident(require)operator(()string=)delimiter(")>operator(+)ident(version)operator(\))operator(;) keyword(return) + keyword(except) ident(pkg_resources)operator(.)ident(VersionConflict)operator(,) ident(e)operator(:) + keyword(if) ident(was_imported)operator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) operator(() + string=%s\) is not available, and)char(\\n)delimiter(")> + string + string + string + operator(\)) operator(%) operator(()ident(version)operator(,) ident(e)operator(.)ident(args)operator([)integer(0)operator(])operator(\)) + ident(sys)operator(.)ident(exit)operator(()integer(2)operator(\)) + keyword(else)operator(:) + keyword(del) ident(pkg_resources)operator(,) ident(sys)operator(.)ident(modules)operator([)stringoperator(]) comment(# reload ok) + keyword(return) ident(do_download)operator(()operator(\)) + keyword(except) ident(pkg_resources)operator(.)ident(DistributionNotFound)operator(:) + keyword(return) ident(do_download)operator(()operator(\)) + +keyword(def) ident(download_setuptools)operator(() + ident(version)operator(=)ident(DEFAULT_VERSION)operator(,) ident(download_base)operator(=)ident(DEFAULT_URL)operator(,) ident(to_dir)operator(=)ident(os)operator(.)ident(curdir)operator(,) + ident(delay) operator(=) integer(15) +operator(\))operator(:) + string + keyword(import) ident(urllib2)operator(,) ident(shutil) + ident(egg_name) operator(=) string 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(if) ident(delay)operator(:) + ident(log)operator(.)ident(warn)operator(()stringoperator(,) + 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(\)) + ident(log)operator(.)ident(warn)operator(()stringoperator(,) 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) + comment(# if the download is interrupted.) + ident(data) operator(=) ident(_validate_md5)operator(()ident(egg_name)operator(,) ident(src)operator(.)ident(read)operator(()operator(\))operator(\)) + ident(dst) operator(=) predefined(open)operator(()ident(saveto)operator(,)stringoperator(\))operator(;) ident(dst)operator(.)ident(write)operator(()ident(data)operator(\)) + keyword(finally)operator(:) + keyword(if) ident(src)operator(:) ident(src)operator(.)ident(close)operator(()operator(\)) + keyword(if) ident(dst)operator(:) ident(dst)operator(.)ident(close)operator(()operator(\)) + keyword(return) ident(os)operator(.)ident(path)operator(.)ident(realpath)operator(()ident(saveto)operator(\)) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +keyword(def) ident(main)operator(()ident(argv)operator(,) ident(version)operator(=)ident(DEFAULT_VERSION)operator(\))operator(:) + string + keyword(try)operator(:) + keyword(import) ident(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(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(:) + ident(os)operator(.)ident(unlink)operator(()ident(egg)operator(\)) + keyword(else)operator(:) + keyword(if) ident(setuptools)operator(.)ident(__version__) operator(==) stringoperator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) operator(() + string + string + operator(\)) + ident(sys)operator(.)ident(exit)operator(()integer(2)operator(\)) + + ident(req) operator(=) string=)delimiter(")>operator(+)ident(version) + keyword(import) ident(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(except) exception(ImportError)operator(:) + keyword(from) ident(easy_install) keyword(import) ident(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) + ident(main)operator(()ident(argv)operator(\)) + keyword(else)operator(:) + keyword(print) stringoperator(,)ident(version)operator(,)string + keyword(print) string + +keyword(def) ident(update_md5)operator(()ident(filenames)operator(\))operator(:) + string + + keyword(import) ident(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(\)) + ident(f) operator(=) predefined(open)operator(()ident(name)operator(,)stringoperator(\)) + ident(md5_data)operator([)ident(base)operator(]) operator(=) ident(md5)operator(()ident(f)operator(.)ident(read)operator(()operator(\))operator(\))operator(.)ident(hexdigest)operator(()operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + + ident(data) operator(=) operator([)string operator(%) ident(it) keyword(for) ident(it) keyword(in) ident(md5_data)operator(.)ident(items)operator(()operator(\))operator(]) + ident(data)operator(.)ident(sort)operator(()operator(\)) + ident(repl) operator(=) stringoperator(.)ident(join)operator(()ident(data)operator(\)) + + keyword(import) ident(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(,) stringoperator(\))operator(;) ident(src) operator(=) ident(f)operator(.)ident(read)operator(()operator(\))operator(;) ident(f)operator(.)ident(close)operator(()operator(\)) + + ident(match) operator(=) ident(re)operator(.)ident(search)operator(()stringoperator(,) ident(src)operator(\)) + keyword(if) keyword(not) ident(match)operator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) string + ident(sys)operator(.)ident(exit)operator(()integer(2)operator(\)) + + ident(src) operator(=) ident(src)operator([)operator(:)ident(match)operator(.)ident(start)operator(()integer(1)operator(\))operator(]) operator(+) ident(repl) operator(+) ident(src)operator([)ident(match)operator(.)ident(end)operator(()integer(1)operator(\))operator(:)operator(]) + ident(f) operator(=) predefined(open)operator(()ident(srcfile)operator(,)stringoperator(\)) + ident(f)operator(.)ident(write)operator(()ident(src)operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + + +keyword(if) ident(__name__)operator(==)stringoperator(:) + keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(>)integer(2) keyword(and) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator(==)stringoperator(:) + ident(update_md5)operator(()ident(sys)operator(.)ident(argv)operator([)integer(2)operator(:)operator(])operator(\)) + keyword(else)operator(:) + ident(main)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(\)) + + + + + + +comment(# -*- coding: utf-8 -*-) +string + +ident(__version__) operator(=) string +ident(__docformat__) operator(=) string + +ident(__all__) operator(=) operator([)stringoperator(,) stringoperator(,) stringoperator(]) + + +keyword(import) ident(sys)operator(,) ident(os) + +keyword(from) ident(pygments)operator(.)ident(util) keyword(import) ident(StringIO)operator(,) ident(BytesIO) + + +keyword(def) ident(lex)operator(()ident(code)operator(,) ident(lexer)operator(\))operator(:) + string + keyword(try)operator(:) + keyword(return) ident(lexer)operator(.)ident(get_tokens)operator(()ident(code)operator(\)) + keyword(except) exception(TypeError)operator(,) ident(err)operator(:) + keyword(if) predefined(isinstance)operator(()ident(err)operator(.)ident(args)operator([)integer(0)operator(])operator(,) predefined(str)operator(\)) keyword(and) \ + string keyword(in) ident(err)operator(.)ident(args)operator([)integer(0)operator(])operator(:) + keyword(raise) exception(TypeError)operator(()string + stringoperator(\)) + keyword(raise) + + +keyword(def) ident(format)operator(()ident(tokens)operator(,) ident(formatter)operator(,) ident(outfile)operator(=)pre_constant(None)operator(\))operator(:) + string + keyword(try)operator(:) + keyword(if) keyword(not) ident(outfile)operator(:) + comment(#print formatter, 'using', formatter.encoding) + ident(realoutfile) operator(=) ident(formatter)operator(.)ident(encoding) keyword(and) ident(BytesIO)operator(()operator(\)) keyword(or) ident(StringIO)operator(()operator(\)) + ident(formatter)operator(.)ident(format)operator(()ident(tokens)operator(,) ident(realoutfile)operator(\)) + keyword(return) ident(realoutfile)operator(.)ident(getvalue)operator(()operator(\)) + keyword(else)operator(:) + ident(formatter)operator(.)ident(format)operator(()ident(tokens)operator(,) ident(outfile)operator(\)) + keyword(except) exception(TypeError)operator(,) ident(err)operator(:) + keyword(if) predefined(isinstance)operator(()ident(err)operator(.)ident(args)operator([)integer(0)operator(])operator(,) predefined(str)operator(\)) keyword(and) \ + string keyword(in) ident(err)operator(.)ident(args)operator([)integer(0)operator(])operator(:) + keyword(raise) exception(TypeError)operator(()string + stringoperator(\)) + keyword(raise) + + +keyword(def) ident(highlight)operator(()ident(code)operator(,) ident(lexer)operator(,) ident(formatter)operator(,) ident(outfile)operator(=)pre_constant(None)operator(\))operator(:) + string + keyword(return) ident(format)operator(()ident(lex)operator(()ident(code)operator(,) ident(lexer)operator(\))operator(,) ident(formatter)operator(,) ident(outfile)operator(\)) + + +keyword(if) ident(__name__) operator(==) stringoperator(:) + keyword(from) ident(pygments)operator(.)ident(cmdline) keyword(import) ident(main) + ident(sys)operator(.)ident(exit)operator(()ident(main)operator(()ident(sys)operator(.)ident(argv)operator(\))operator(\)) +comment(# -*- coding: utf-8 -*-) +string +keyword(import) ident(sys) +keyword(import) ident(getopt) +keyword(from) ident(textwrap) keyword(import) ident(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) + + +ident(USAGE) operator(=) string | -g] [-F [:]] [-f ])content( +)content( [-O ] [-P ] [-o ] [])content( +)content( +)content( %s -S )content( +)content()content( +)content()content( +)content(

%(title\)s

)content( +)content( +)delimiter(''')> + +ident(DOC_HEADER_EXTERNALCSS) operator(=) string)content( +)content( +)content()content( +)content()content( +)content( %(title\)s)content( +)content( )content( +)content( )content( +)content()content( +)content()content( +)content(

%(title\)s

)content( +)content( +)delimiter(''')> + +ident(DOC_FOOTER) operator(=) string)content( +)content()content( +)delimiter(''')> + + +keyword(class) ident(HtmlFormatter)operator(()ident(Formatter)operator(\))operator(:) + string`` tags within a ``
`` tag, wrapped)content(
+)content(    in a ``
`` tag. The ``
``'s CSS class can be set by the `cssclass`)content( +)content( option.)content( +)content( +)content( If the `linenos` option is set to ``"table"``, the ``
`` is)content(
+)content(    additionally wrapped inside a ```` which has one row and two)content(
+)content(    cells: one containing the line numbers and one containing the code.)content(
+)content(    Example:)content(
+)content(
+)content(    .. sourcecode:: html)content(
+)content(
+)content(        
)content( +)content(
)content( +)content( )content( +)content( )content( +)content(
)content( +)content(
1)content(
+)content(            2
)content( +)content(
)content( +)content(
def foo(bar\):)content(
+)content(              pass)content(
+)content(            
)content( +)content(
)content( +)content( +)content( (whitespace added to improve clarity\).)content( +)content( +)content( Wrapping can be disabled using the `nowrap` option.)content( +)content( +)content( A list of lines can be specified using the `hl_lines` option to make these)content( +)content( lines highlighted (as of Pygments 0.11\).)content( +)content( +)content( With the `full` option, a complete HTML 4 document is output, including)content( +)content( the style definitions inside a ``)content( +)content()content( +)content()content( +)content(

Code tags report for %s

)content( +)content()content( +)content()content( +)content(%s)content( +)content(
LineTagWhoDescription
)content( +)content()content( +)content()content( +)delimiter(''')> + + ident(TABLE) operator(=) stringFile: %s)char(\\n)delimiter(')> + + ident(TR) operator(=) operator(()string%%(lno\)d)delimiter(')> + string%%(tag\)s)delimiter(')> + string%%(who\)s%%(what\)s)delimiter(')>operator(\)) + + ident(f) operator(=) predefined(file)operator(()ident(output)operator(,) stringoperator(\)) + ident(table) operator(=) stringoperator(.)ident(join)operator(()ident(TABLE) operator(%) ident(fname) operator(+) + stringoperator(.)ident(join)operator(()ident(TR) operator(%) operator(()ident(no) operator(%) integer(2)operator(,)operator(\)) operator(%) ident(entry) + keyword(for) ident(no)operator(,) ident(entry) keyword(in) predefined(enumerate)operator(()ident(store)operator([)ident(fname)operator(])operator(\))operator(\)) + keyword(for) ident(fname) keyword(in) predefined(sorted)operator(()ident(store)operator(\))operator(\)) + ident(f)operator(.)ident(write)operator(()ident(HTML) operator(%) operator(()stringoperator(.)ident(join)operator(()predefined(map)operator(()ident(abspath)operator(,) ident(args)operator(\))operator(\))operator(,) ident(table)operator(\))operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + + keyword(print) string operator(%) ident(output) + keyword(return) integer(0) + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(sys)operator(.)ident(exit)operator(()ident(main)operator(()operator(\))operator(\)) +comment(#!/usr/bin/python) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(sys)operator(,) ident(os) + +keyword(try)operator(:) + keyword(import) ident(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(,) stringoperator(\))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(def) ident(main)operator(()ident(fn)operator(\))operator(:) + keyword(try)operator(:) + ident(lx) operator(=) ident(get_lexer_for_filename)operator(()ident(fn)operator(\)) + keyword(except) exception(ValueError)operator(:) + keyword(try)operator(:) + ident(name)operator(,) ident(rest) operator(=) ident(fn)operator(.)ident(split)operator(()stringoperator(,) integer(1)operator(\)) + ident(lx) operator(=) ident(get_lexer_by_name)operator(()ident(name)operator(\)) + keyword(except) exception(ValueError)operator(:) + keyword(raise) exception(AssertionError)operator(()string operator(%) ident(fn)operator(\)) + ident(text) operator(=) predefined(file)operator(()ident(fn)operator(,) stringoperator(\))operator(.)ident(read)operator(()operator(\)) + ident(text) operator(=) ident(text)operator(.)ident(strip)operator(()stringoperator(\)) operator(+) string + ident(text) operator(=) ident(text)operator(.)ident(decode)operator(()stringoperator(\)) + ident(ntext) operator(=) operator([)operator(]) + keyword(for) predefined(type)operator(,) ident(val) keyword(in) ident(lx)operator(.)ident(get_tokens)operator(()ident(text)operator(\))operator(:) + keyword(if) predefined(type) operator(==) ident(Error)operator(:) + keyword(print) stringoperator(,) ident(fn) + keyword(print) stringoperator(.)ident(join)operator(()operator([)string operator(+) predefined(repr)operator(()ident(x)operator(\)) keyword(for) ident(x) keyword(in) ident(ntext)operator([)operator(-)ident(num)operator(:)operator(])operator(])operator(\)) + keyword(print) error(`)ident(val)error(`) operator(+) string + keyword(return) integer(1) + ident(ntext)operator(.)ident(append)operator(()operator(()predefined(type)operator(,)ident(val)operator(\))operator(\)) + keyword(return) integer(0) + + +ident(num) operator(=) integer(10) + +keyword(if) ident(__name__) operator(==) stringoperator(:) + keyword(if) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator([)operator(:)integer(2)operator(]) operator(==) stringoperator(:) + ident(num) operator(=) predefined(int)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(])operator([)integer(2)operator(:)operator(])operator(\)) + keyword(del) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(]) + ident(ret) operator(=) integer(0) + 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) + +ident(r_line) operator(=) ident(re)operator(.)ident(compile)operator(()string + stringoperator(\)) +ident(r_item) operator(=) ident(re)operator(.)ident(compile)operator(()stringoperator(\)) + +keyword(def) ident(getkw)operator(()predefined(input)operator(,) ident(output)operator(\))operator(:) + ident(out) operator(=) predefined(file)operator(()ident(output)operator(,) stringoperator(\)) + + ident(output_info) operator(=) operator({)stringoperator(:) operator([)operator(])operator(,) stringoperator(:) operator([)operator(])operator(,) stringoperator(:) operator([)operator(])operator(}) + keyword(for) ident(line) keyword(in) predefined(file)operator(()predefined(input)operator(\))operator(:) + ident(m) operator(=) ident(r_line)operator(.)ident(match)operator(()ident(line)operator(\)) + keyword(if) ident(m)operator(:) + comment(# Decide which output gets mapped to d) + keyword(if) string keyword(in) ident(m)operator(.)ident(group)operator(()integer(1)operator(\))operator(:) + ident(d) operator(=) ident(output_info)operator([)stringoperator(]) + keyword(elif) string keyword(in) ident(m)operator(.)ident(group)operator(()integer(1)operator(\))operator(:) + ident(d) operator(=) ident(output_info)operator([)stringoperator(]) + keyword(else)operator(:) + ident(d) operator(=) ident(output_info)operator([)stringoperator(]) + + comment(# Extract all the shortened versions) + keyword(for) ident(i) keyword(in) ident(r_item)operator(.)ident(finditer)operator(()ident(m)operator(.)ident(group)operator(()integer(2)operator(\))operator(\))operator(:) + ident(d)operator(.)ident(append)operator(()operator(()ident(i)operator(.)ident(group)operator(()integer(1)operator(\))operator(,) string operator(%) operator(()ident(i)operator(.)ident(group)operator(()integer(1)operator(\))operator(,) ident(i)operator(.)ident(group)operator(()integer(2)operator(\)) keyword(or) stringoperator(\))operator(\))operator(\)) + ident(d)operator(.)ident(sort)operator(()operator(\)) + + keyword(for) ident(a)operator(,) ident(b) keyword(in) ident(output_info)operator(.)ident(items)operator(()operator(\))operator(:) + keyword(print) operator(>>)ident(out)operator(,) string operator(%) operator(()ident(a)operator(,) ident(b)operator(\)) + +keyword(def) ident(is_keyword)operator(()ident(w)operator(,) ident(keywords)operator(\))operator(:) + keyword(for) ident(i) keyword(in) predefined(range)operator(()predefined(len)operator(()ident(w)operator(\))operator(,) integer(0)operator(,) operator(-)integer(1)operator(\))operator(:) + keyword(if) ident(w)operator([)operator(:)ident(i)operator(]) keyword(in) ident(keywords)operator(:) + keyword(return) ident(signals)operator([)ident(w)operator([)operator(:)ident(i)operator(])operator(])operator([)operator(:)predefined(len)operator(()ident(w)operator(\))operator(]) operator(==) ident(w) + keyword(return) pre_constant(False) + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(getkw)operator(()stringoperator(,) stringoperator(\)) +comment(#! /usr/bin/env python) + +comment(# Released to the public domain, by Tim Peters, 03 October 2000.) +comment(# -B option added by Georg Brandl, 2006.) + +string + +ident(__version__) operator(=) string + +keyword(import) ident(tokenize) +keyword(import) ident(os) +keyword(import) ident(sys) + +ident(verbose) operator(=) integer(0) +ident(recurse) operator(=) integer(0) +ident(dryrun) operator(=) integer(0) +ident(no_backup) operator(=) integer(0) + +keyword(def) ident(usage)operator(()ident(msg)operator(=)pre_constant(None)operator(\))operator(:) + keyword(if) ident(msg) keyword(is) keyword(not) pre_constant(None)operator(:) + keyword(print) operator(>>) ident(sys)operator(.)ident(stderr)operator(,) ident(msg) + keyword(print) operator(>>) ident(sys)operator(.)ident(stderr)operator(,) ident(__doc__) + +keyword(def) ident(errprint)operator(()operator(*)ident(args)operator(\))operator(:) + ident(sep) operator(=) string + keyword(for) ident(arg) keyword(in) ident(args)operator(:) + ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()ident(sep) operator(+) predefined(str)operator(()ident(arg)operator(\))operator(\)) + ident(sep) operator(=) string + ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()stringoperator(\)) + +keyword(def) ident(main)operator(()operator(\))operator(:) + keyword(import) ident(getopt) + keyword(global) ident(verbose)operator(,) ident(recurse)operator(,) ident(dryrun)operator(,) ident(no_backup) + + keyword(try)operator(:) + ident(opts)operator(,) ident(args) operator(=) ident(getopt)operator(.)ident(getopt)operator(()ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(,) stringoperator(,) + operator([)stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) + stringoperator(])operator(\)) + keyword(except) ident(getopt)operator(.)ident(error)operator(,) ident(msg)operator(:) + ident(usage)operator(()ident(msg)operator(\)) + keyword(return) + keyword(for) ident(o)operator(,) ident(a) keyword(in) ident(opts)operator(:) + keyword(if) ident(o) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + ident(dryrun) operator(+=) integer(1) + keyword(elif) ident(o) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + ident(recurse) operator(+=) integer(1) + keyword(elif) ident(o) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + ident(verbose) operator(+=) integer(1) + keyword(elif) ident(o) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + ident(no_backup) operator(+=) integer(1) + keyword(elif) ident(o) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + ident(usage)operator(()operator(\)) + keyword(return) + keyword(if) keyword(not) ident(args)operator(:) + ident(r) operator(=) ident(Reindenter)operator(()ident(sys)operator(.)ident(stdin)operator(\)) + ident(r)operator(.)ident(run)operator(()operator(\)) + ident(r)operator(.)ident(write)operator(()ident(sys)operator(.)ident(stdout)operator(\)) + keyword(return) + keyword(for) ident(arg) keyword(in) ident(args)operator(:) + ident(check)operator(()ident(arg)operator(\)) + +keyword(def) ident(check)operator(()predefined(file)operator(\))operator(:) + keyword(if) ident(os)operator(.)ident(path)operator(.)ident(isdir)operator(()predefined(file)operator(\)) keyword(and) keyword(not) ident(os)operator(.)ident(path)operator(.)ident(islink)operator(()predefined(file)operator(\))operator(:) + keyword(if) ident(verbose)operator(:) + keyword(print) stringoperator(,) predefined(file) + ident(names) operator(=) ident(os)operator(.)ident(listdir)operator(()predefined(file)operator(\)) + keyword(for) ident(name) keyword(in) ident(names)operator(:) + ident(fullname) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()predefined(file)operator(,) ident(name)operator(\)) + keyword(if) operator(()operator(()ident(recurse) keyword(and) ident(os)operator(.)ident(path)operator(.)ident(isdir)operator(()ident(fullname)operator(\)) keyword(and) + keyword(not) ident(os)operator(.)ident(path)operator(.)ident(islink)operator(()ident(fullname)operator(\))operator(\)) + keyword(or) ident(name)operator(.)ident(lower)operator(()operator(\))operator(.)ident(endswith)operator(()stringoperator(\))operator(\))operator(:) + ident(check)operator(()ident(fullname)operator(\)) + keyword(return) + + keyword(if) ident(verbose)operator(:) + keyword(print) stringoperator(,) predefined(file)operator(,) stringoperator(,) + keyword(try)operator(:) + ident(f) operator(=) predefined(open)operator(()predefined(file)operator(\)) + keyword(except) exception(IOError)operator(,) ident(msg)operator(:) + ident(errprint)operator(()string operator(%) operator(()predefined(file)operator(,) predefined(str)operator(()ident(msg)operator(\))operator(\))operator(\)) + keyword(return) + + ident(r) operator(=) ident(Reindenter)operator(()ident(f)operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + keyword(if) ident(r)operator(.)ident(run)operator(()operator(\))operator(:) + keyword(if) ident(verbose)operator(:) + keyword(print) string + keyword(if) ident(dryrun)operator(:) + keyword(print) string + keyword(else)operator(:) + keyword(print) stringoperator(,) predefined(file)operator(,) operator(()ident(dryrun) keyword(and) string not really\))delimiter(")> keyword(or) stringoperator(\)) + keyword(if) keyword(not) ident(dryrun)operator(:) + keyword(if) keyword(not) ident(no_backup)operator(:) + ident(bak) operator(=) predefined(file) operator(+) string + keyword(if) ident(os)operator(.)ident(path)operator(.)ident(exists)operator(()ident(bak)operator(\))operator(:) + ident(os)operator(.)ident(remove)operator(()ident(bak)operator(\)) + ident(os)operator(.)ident(rename)operator(()predefined(file)operator(,) ident(bak)operator(\)) + keyword(if) ident(verbose)operator(:) + keyword(print) stringoperator(,) predefined(file)operator(,) stringoperator(,) ident(bak) + ident(f) operator(=) predefined(open)operator(()predefined(file)operator(,) stringoperator(\)) + ident(r)operator(.)ident(write)operator(()ident(f)operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + keyword(if) ident(verbose)operator(:) + keyword(print) stringoperator(,) predefined(file) + keyword(else)operator(:) + keyword(if) ident(verbose)operator(:) + keyword(print) string + + +keyword(class) ident(Reindenter)operator(:) + + keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(f)operator(\))operator(:) + pre_constant(self)operator(.)ident(find_stmt) operator(=) integer(1) comment(# next token begins a fresh stmt?) + pre_constant(self)operator(.)ident(level) operator(=) integer(0) comment(# current indent level) + + comment(# Raw file lines.) + pre_constant(self)operator(.)ident(raw) operator(=) ident(f)operator(.)ident(readlines)operator(()operator(\)) + + comment(# File lines, rstripped & tab-expanded. Dummy at start is so) + comment(# that we can use tokenize's 1-based line numbering easily.) + comment(# Note that a line is all-blank iff it's "\\n".) + pre_constant(self)operator(.)ident(lines) operator(=) operator([)ident(line)operator(.)ident(rstrip)operator(()stringoperator(\))operator(.)ident(expandtabs)operator(()operator(\)) operator(+) string + keyword(for) ident(line) keyword(in) pre_constant(self)operator(.)ident(raw)operator(]) + pre_constant(self)operator(.)ident(lines)operator(.)ident(insert)operator(()integer(0)operator(,) pre_constant(None)operator(\)) + pre_constant(self)operator(.)ident(index) operator(=) integer(1) comment(# index into self.lines of next line) + + comment(# List of (lineno, indentlevel\) pairs, one for each stmt and) + comment(# comment line. indentlevel is -1 for comment lines, as a) + comment(# signal that tokenize doesn't know what to do about them;) + comment(# indeed, they're our headache!) + pre_constant(self)operator(.)ident(stats) operator(=) operator([)operator(]) + + keyword(def) ident(run)operator(()pre_constant(self)operator(\))operator(:) + ident(tokenize)operator(.)ident(tokenize)operator(()pre_constant(self)operator(.)ident(getline)operator(,) pre_constant(self)operator(.)ident(tokeneater)operator(\)) + comment(# Remove trailing empty lines.) + ident(lines) operator(=) pre_constant(self)operator(.)ident(lines) + keyword(while) ident(lines) keyword(and) ident(lines)operator([)operator(-)integer(1)operator(]) operator(==) stringoperator(:) + ident(lines)operator(.)ident(pop)operator(()operator(\)) + comment(# Sentinel.) + ident(stats) operator(=) pre_constant(self)operator(.)ident(stats) + ident(stats)operator(.)ident(append)operator(()operator(()predefined(len)operator(()ident(lines)operator(\))operator(,) integer(0)operator(\))operator(\)) + comment(# Map count of leading spaces to # we want.) + ident(have2want) operator(=) operator({)operator(}) + comment(# Program after transformation.) + ident(after) operator(=) pre_constant(self)operator(.)ident(after) operator(=) operator([)operator(]) + comment(# Copy over initial empty lines -- there's nothing to do until) + comment(# we see a line with *something* on it.) + ident(i) operator(=) ident(stats)operator([)integer(0)operator(])operator([)integer(0)operator(]) + ident(after)operator(.)ident(extend)operator(()ident(lines)operator([)integer(1)operator(:)ident(i)operator(])operator(\)) + keyword(for) ident(i) keyword(in) predefined(range)operator(()predefined(len)operator(()ident(stats)operator(\))operator(-)integer(1)operator(\))operator(:) + ident(thisstmt)operator(,) ident(thislevel) operator(=) ident(stats)operator([)ident(i)operator(]) + ident(nextstmt) operator(=) ident(stats)operator([)ident(i)operator(+)integer(1)operator(])operator([)integer(0)operator(]) + ident(have) operator(=) ident(getlspace)operator(()ident(lines)operator([)ident(thisstmt)operator(])operator(\)) + ident(want) operator(=) ident(thislevel) operator(*) integer(4) + keyword(if) ident(want) operator(<) integer(0)operator(:) + comment(# A comment line.) + keyword(if) ident(have)operator(:) + comment(# An indented comment line. If we saw the same) + comment(# indentation before, reuse what it most recently) + comment(# mapped to.) + ident(want) operator(=) ident(have2want)operator(.)ident(get)operator(()ident(have)operator(,) operator(-)integer(1)operator(\)) + keyword(if) ident(want) operator(<) integer(0)operator(:) + comment(# Then it probably belongs to the next real stmt.) + keyword(for) ident(j) keyword(in) predefined(xrange)operator(()ident(i)operator(+)integer(1)operator(,) predefined(len)operator(()ident(stats)operator(\))operator(-)integer(1)operator(\))operator(:) + ident(jline)operator(,) ident(jlevel) operator(=) ident(stats)operator([)ident(j)operator(]) + keyword(if) ident(jlevel) operator(>=) integer(0)operator(:) + keyword(if) ident(have) operator(==) ident(getlspace)operator(()ident(lines)operator([)ident(jline)operator(])operator(\))operator(:) + ident(want) operator(=) ident(jlevel) operator(*) integer(4) + keyword(break) + keyword(if) ident(want) operator(<) integer(0)operator(:) comment(# Maybe it's a hanging) + comment(# comment like this one,) + comment(# in which case we should shift it like its base) + comment(# line got shifted.) + keyword(for) ident(j) keyword(in) predefined(xrange)operator(()ident(i)operator(-)integer(1)operator(,) operator(-)integer(1)operator(,) operator(-)integer(1)operator(\))operator(:) + ident(jline)operator(,) ident(jlevel) operator(=) ident(stats)operator([)ident(j)operator(]) + keyword(if) ident(jlevel) operator(>=) integer(0)operator(:) + ident(want) operator(=) ident(have) operator(+) ident(getlspace)operator(()ident(after)operator([)ident(jline)operator(-)integer(1)operator(])operator(\)) operator(-) \ + ident(getlspace)operator(()ident(lines)operator([)ident(jline)operator(])operator(\)) + keyword(break) + keyword(if) ident(want) operator(<) integer(0)operator(:) + comment(# Still no luck -- leave it alone.) + ident(want) operator(=) ident(have) + keyword(else)operator(:) + ident(want) operator(=) integer(0) + keyword(assert) ident(want) operator(>=) integer(0) + ident(have2want)operator([)ident(have)operator(]) operator(=) ident(want) + ident(diff) operator(=) ident(want) operator(-) ident(have) + keyword(if) ident(diff) operator(==) integer(0) keyword(or) ident(have) operator(==) integer(0)operator(:) + ident(after)operator(.)ident(extend)operator(()ident(lines)operator([)ident(thisstmt)operator(:)ident(nextstmt)operator(])operator(\)) + keyword(else)operator(:) + keyword(for) ident(line) keyword(in) ident(lines)operator([)ident(thisstmt)operator(:)ident(nextstmt)operator(])operator(:) + keyword(if) ident(diff) operator(>) integer(0)operator(:) + keyword(if) ident(line) operator(==) stringoperator(:) + ident(after)operator(.)ident(append)operator(()ident(line)operator(\)) + keyword(else)operator(:) + ident(after)operator(.)ident(append)operator(()string operator(*) ident(diff) operator(+) ident(line)operator(\)) + keyword(else)operator(:) + ident(remove) operator(=) predefined(min)operator(()ident(getlspace)operator(()ident(line)operator(\))operator(,) operator(-)ident(diff)operator(\)) + ident(after)operator(.)ident(append)operator(()ident(line)operator([)ident(remove)operator(:)operator(])operator(\)) + keyword(return) pre_constant(self)operator(.)ident(raw) operator(!=) pre_constant(self)operator(.)ident(after) + + keyword(def) ident(write)operator(()pre_constant(self)operator(,) ident(f)operator(\))operator(:) + ident(f)operator(.)ident(writelines)operator(()pre_constant(self)operator(.)ident(after)operator(\)) + + comment(# Line-getter for tokenize.) + keyword(def) ident(getline)operator(()pre_constant(self)operator(\))operator(:) + keyword(if) pre_constant(self)operator(.)ident(index) operator(>=) predefined(len)operator(()pre_constant(self)operator(.)ident(lines)operator(\))operator(:) + ident(line) operator(=) string + keyword(else)operator(:) + ident(line) operator(=) pre_constant(self)operator(.)ident(lines)operator([)pre_constant(self)operator(.)ident(index)operator(]) + pre_constant(self)operator(.)ident(index) operator(+=) integer(1) + keyword(return) ident(line) + + comment(# Line-eater for tokenize.) + keyword(def) ident(tokeneater)operator(()pre_constant(self)operator(,) predefined(type)operator(,) ident(token)operator(,) operator(()ident(sline)operator(,) ident(scol)operator(\))operator(,) ident(end)operator(,) ident(line)operator(,) + ident(INDENT)operator(=)ident(tokenize)operator(.)ident(INDENT)operator(,) + ident(DEDENT)operator(=)ident(tokenize)operator(.)ident(DEDENT)operator(,) + ident(NEWLINE)operator(=)ident(tokenize)operator(.)ident(NEWLINE)operator(,) + ident(COMMENT)operator(=)ident(tokenize)operator(.)ident(COMMENT)operator(,) + ident(NL)operator(=)ident(tokenize)operator(.)ident(NL)operator(\))operator(:) + + keyword(if) predefined(type) operator(==) ident(NEWLINE)operator(:) + comment(# A program statement, or ENDMARKER, will eventually follow,) + comment(# after some (possibly empty\) run of tokens of the form) + comment(# (NL | COMMENT\)* (INDENT | DEDENT+\)?) + pre_constant(self)operator(.)ident(find_stmt) operator(=) integer(1) + + keyword(elif) predefined(type) operator(==) ident(INDENT)operator(:) + pre_constant(self)operator(.)ident(find_stmt) operator(=) integer(1) + pre_constant(self)operator(.)ident(level) operator(+=) integer(1) + + keyword(elif) predefined(type) operator(==) ident(DEDENT)operator(:) + pre_constant(self)operator(.)ident(find_stmt) operator(=) integer(1) + pre_constant(self)operator(.)ident(level) operator(-=) integer(1) + + keyword(elif) predefined(type) operator(==) ident(COMMENT)operator(:) + keyword(if) pre_constant(self)operator(.)ident(find_stmt)operator(:) + pre_constant(self)operator(.)ident(stats)operator(.)ident(append)operator(()operator(()ident(sline)operator(,) operator(-)integer(1)operator(\))operator(\)) + comment(# but we're still looking for a new stmt, so leave) + comment(# find_stmt alone) + + keyword(elif) predefined(type) operator(==) ident(NL)operator(:) + keyword(pass) + + keyword(elif) pre_constant(self)operator(.)ident(find_stmt)operator(:) + comment(# This is the first "real token" following a NEWLINE, so it) + comment(# must be the first token of the next program statement, or an) + comment(# ENDMARKER.) + pre_constant(self)operator(.)ident(find_stmt) operator(=) integer(0) + keyword(if) ident(line)operator(:) comment(# not endmarker) + pre_constant(self)operator(.)ident(stats)operator(.)ident(append)operator(()operator(()ident(sline)operator(,) pre_constant(self)operator(.)ident(level)operator(\))operator(\)) + +comment(# Count number of leading blanks.) +keyword(def) ident(getlspace)operator(()ident(line)operator(\))operator(:) + ident(i)operator(,) ident(n) operator(=) integer(0)operator(,) predefined(len)operator(()ident(line)operator(\)) + keyword(while) ident(i) operator(<) ident(n) keyword(and) ident(line)operator([)ident(i)operator(]) operator(==) stringoperator(:) + ident(i) operator(+=) integer(1) + keyword(return) ident(i) + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(main)operator(()operator(\)) +comment(#!/usr/bin/env python) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(sys) +keyword(import) ident(re) +keyword(from) ident(os) keyword(import) ident(path) +keyword(from) ident(cStringIO) keyword(import) ident(StringIO) + +ident(split_re) operator(=) ident(re)operator(.)ident(compile)operator(()stringoperator(\)) + +ident(SCRIPT_NAME) operator(=) string +ident(SCRIPT_VERSION) operator(=) string + + +ident(COLORS) operator(=) operator({) + comment(# Numeric Colors) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + comment(# Named Colors) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) string +operator(}) + +ident(TOKENS) operator(=) operator({) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) operator(()stringoperator(,) stringoperator(\))operator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) operator(()stringoperator(,) stringoperator(\))operator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) operator(()stringoperator(,) stringoperator(\))operator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) stringoperator(,) + stringoperator(:) string +operator(}) + +ident(TOKEN_TYPES) operator(=) predefined(set)operator(()operator(\)) +keyword(for) ident(token) keyword(in) ident(TOKENS)operator(.)ident(itervalues)operator(()operator(\))operator(:) + keyword(if) keyword(not) predefined(isinstance)operator(()ident(token)operator(,) predefined(tuple)operator(\))operator(:) + ident(token) operator(=) operator(()ident(token)operator(,)operator(\)) + keyword(for) ident(token) keyword(in) ident(token)operator(:) + keyword(if) ident(token)operator(:) + ident(TOKEN_TYPES)operator(.)ident(add)operator(()ident(token)operator(.)ident(split)operator(()stringoperator(\))operator([)integer(0)operator(])operator(\)) + + +keyword(def) ident(get_vim_color)operator(()ident(color)operator(\))operator(:) + keyword(if) ident(color)operator(.)ident(startswith)operator(()stringoperator(\))operator(:) + keyword(if) predefined(len)operator(()ident(color)operator(\)) operator(==) integer(7)operator(:) + keyword(return) ident(color) + keyword(else)operator(:) + keyword(return) string operator(%) stringoperator(.)ident(join)operator(()ident(color)operator(\))operator([)integer(1)operator(:)operator(]) + keyword(return) ident(COLORS)operator(.)ident(get)operator(()ident(color)operator(.)ident(lower)operator(()operator(\))operator(\)) + + +keyword(def) ident(find_colors)operator(()ident(code)operator(\))operator(:) + ident(colors) operator(=) operator({)stringoperator(:) operator({)operator(})operator(}) + ident(bg_color) operator(=) pre_constant(None) + keyword(def) predefined(set)operator(()ident(attrib)operator(,) ident(value)operator(\))operator(:) + keyword(if) ident(token) keyword(not) keyword(in) ident(colors)operator(:) + ident(colors)operator([)ident(token)operator(]) operator(=) operator({)operator(}) + keyword(if) ident(key)operator(.)ident(startswith)operator(()stringoperator(\)) keyword(or) ident(attrib) keyword(not) keyword(in) ident(colors)operator([)ident(token)operator(])operator(:) + ident(colors)operator([)ident(token)operator(])operator([)ident(attrib)operator(]) operator(=) ident(value) + + keyword(for) ident(line) keyword(in) ident(code)operator(.)ident(splitlines)operator(()operator(\))operator(:) + keyword(if) ident(line)operator(.)ident(startswith)operator(()stringoperator(\))operator(:) + keyword(continue) + ident(parts) operator(=) ident(split_re)operator(.)ident(split)operator(()ident(line)operator(.)ident(strip)operator(()operator(\))operator(\)) + keyword(if) predefined(len)operator(()ident(parts)operator(\)) operator(==) integer(2) keyword(and) ident(parts)operator([)integer(0)operator(]) operator(==) stringoperator(:) + ident(p) operator(=) ident(parts)operator([)integer(1)operator(])operator(.)ident(split)operator(()operator(\)) + keyword(if) ident(p)operator([)integer(0)operator(]) operator(==) string keyword(and) ident(p)operator([)integer(1)operator(]) operator(==) stringoperator(:) + ident(token) operator(=) string + ident(bg_color) operator(=) string + keyword(elif) predefined(len)operator(()ident(parts)operator(\)) operator(>) integer(2) keyword(and) \ + predefined(len)operator(()ident(parts)operator([)integer(0)operator(])operator(\)) operator(>=) integer(2) keyword(and) \ + stringoperator(.)ident(startswith)operator(()ident(parts)operator([)integer(0)operator(])operator(\))operator(:) + ident(token) operator(=) ident(parts)operator([)integer(1)operator(])operator(.)ident(lower)operator(()operator(\)) + keyword(if) ident(token) keyword(not) keyword(in) ident(TOKENS)operator(:) + keyword(continue) + keyword(for) ident(item) keyword(in) ident(parts)operator([)integer(2)operator(:)operator(])operator(:) + ident(p) operator(=) ident(item)operator(.)ident(split)operator(()stringoperator(,) integer(1)operator(\)) + keyword(if) keyword(not) predefined(len)operator(()ident(p)operator(\)) operator(==) integer(2)operator(:) + keyword(continue) + ident(key)operator(,) ident(value) operator(=) ident(p) + keyword(if) ident(key) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + ident(color) operator(=) ident(get_vim_color)operator(()ident(value)operator(\)) + keyword(if) ident(color)operator(:) + predefined(set)operator(()stringoperator(,) ident(color)operator(\)) + keyword(elif) ident(key) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + ident(color) operator(=) ident(get_vim_color)operator(()ident(value)operator(\)) + keyword(if) ident(color)operator(:) + predefined(set)operator(()stringoperator(,) ident(color)operator(\)) + keyword(elif) ident(key) keyword(in) operator(()stringoperator(,) stringoperator(,) stringoperator(\))operator(:) + ident(items) operator(=) ident(value)operator(.)ident(split)operator(()stringoperator(\)) + keyword(for) ident(item) keyword(in) ident(items)operator(:) + ident(item) operator(=) ident(item)operator(.)ident(lower)operator(()operator(\)) + keyword(if) ident(item) operator(==) stringoperator(:) + predefined(set)operator(()stringoperator(,) pre_constant(True)operator(\)) + keyword(elif) ident(item) operator(==) stringoperator(:) + predefined(set)operator(()stringoperator(,) pre_constant(True)operator(\)) + keyword(elif) ident(item) operator(==) stringoperator(:) + predefined(set)operator(()stringoperator(,) pre_constant(True)operator(\)) + keyword(elif) ident(item) operator(==) stringoperator(:) + predefined(set)operator(()stringoperator(,) pre_constant(True)operator(\)) + + keyword(if) ident(bg_color) keyword(is) keyword(not) pre_constant(None) keyword(and) keyword(not) ident(colors)operator([)stringoperator(])operator(.)ident(get)operator(()stringoperator(\))operator(:) + ident(colors)operator([)stringoperator(])operator([)stringoperator(]) operator(=) ident(bg_color) + + ident(color_map) operator(=) operator({)operator(}) + keyword(for) ident(token)operator(,) ident(styles) keyword(in) ident(colors)operator(.)ident(iteritems)operator(()operator(\))operator(:) + keyword(if) ident(token) keyword(in) ident(TOKENS)operator(:) + ident(tmp) operator(=) operator([)operator(]) + keyword(if) ident(styles)operator(.)ident(get)operator(()stringoperator(\))operator(:) + ident(tmp)operator(.)ident(append)operator(()stringoperator(\)) + keyword(if) string keyword(in) ident(styles)operator(:) + ident(tmp)operator(.)ident(append)operator(()ident(styles)operator([)stringoperator(])operator(\)) + keyword(if) string keyword(in) ident(styles)operator(:) + ident(tmp)operator(.)ident(append)operator(()string operator(+) ident(styles)operator([)stringoperator(])operator(\)) + keyword(if) ident(styles)operator(.)ident(get)operator(()stringoperator(\))operator(:) + ident(tmp)operator(.)ident(append)operator(()stringoperator(\)) + keyword(if) ident(styles)operator(.)ident(get)operator(()stringoperator(\))operator(:) + ident(tmp)operator(.)ident(append)operator(()stringoperator(\)) + keyword(if) ident(styles)operator(.)ident(get)operator(()stringoperator(\))operator(:) + ident(tmp)operator(.)ident(append)operator(()stringoperator(\)) + ident(tokens) operator(=) ident(TOKENS)operator([)ident(token)operator(]) + keyword(if) keyword(not) predefined(isinstance)operator(()ident(tokens)operator(,) predefined(tuple)operator(\))operator(:) + ident(tokens) operator(=) operator(()ident(tokens)operator(,)operator(\)) + keyword(for) ident(token) keyword(in) ident(tokens)operator(:) + ident(color_map)operator([)ident(token)operator(]) operator(=) stringoperator(.)ident(join)operator(()ident(tmp)operator(\)) + + ident(default_token) operator(=) ident(color_map)operator(.)ident(pop)operator(()stringoperator(\)) + keyword(return) ident(default_token)operator(,) ident(color_map) + + +keyword(class) ident(StyleWriter)operator(()predefined(object)operator(\))operator(:) + + keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(code)operator(,) ident(name)operator(\))operator(:) + pre_constant(self)operator(.)ident(code) operator(=) ident(code) + pre_constant(self)operator(.)ident(name) operator(=) ident(name)operator(.)ident(lower)operator(()operator(\)) + + keyword(def) ident(write_header)operator(()pre_constant(self)operator(,) ident(out)operator(\))operator(:) + ident(out)operator(.)ident(write)operator(()stringoperator(\)) + ident(out)operator(.)ident(write)operator(()string operator(%) pre_constant(self)operator(.)ident(name)operator(.)ident(title)operator(()operator(\))operator(\)) + ident(out)operator(.)ident(write)operator(()string operator(%) operator(()string operator(*) operator(()predefined(len)operator(()pre_constant(self)operator(.)ident(name)operator(\)) operator(+) integer(12)operator(\))operator(\))operator(\)) + ident(out)operator(.)ident(write)operator(()string operator(%) ident(SCRIPT_NAME)operator(\)) + ident(out)operator(.)ident(write)operator(()stringoperator(\)) + ident(out)operator(.)ident(write)operator(()string operator(%) stringoperator(.)ident(join)operator(()ident(TOKEN_TYPES)operator(\))operator(\)) + ident(out)operator(.)ident(write)operator(()string operator(%) pre_constant(self)operator(.)ident(name)operator(.)ident(title)operator(()operator(\))operator(\)) + + keyword(def) ident(write)operator(()pre_constant(self)operator(,) ident(out)operator(\))operator(:) + pre_constant(self)operator(.)ident(write_header)operator(()ident(out)operator(\)) + ident(default_token)operator(,) ident(tokens) operator(=) ident(find_colors)operator(()pre_constant(self)operator(.)ident(code)operator(\)) + ident(tokens) operator(=) ident(tokens)operator(.)ident(items)operator(()operator(\)) + ident(tokens)operator(.)ident(sort)operator(()keyword(lambda) ident(a)operator(,) ident(b)operator(:) predefined(cmp)operator(()predefined(len)operator(()ident(a)operator([)integer(0)operator(])operator(\))operator(,) predefined(len)operator(()ident(a)operator([)integer(1)operator(])operator(\))operator(\))operator(\)) + ident(bg_color) operator(=) operator([)ident(x)operator([)integer(3)operator(:)operator(]) keyword(for) ident(x) keyword(in) ident(default_token)operator(.)ident(split)operator(()operator(\)) keyword(if) ident(x)operator(.)ident(startswith)operator(()stringoperator(\))operator(]) + keyword(if) ident(bg_color)operator(:) + ident(out)operator(.)ident(write)operator(()string operator(%) ident(bg_color)operator([)integer(0)operator(])operator(\)) + ident(out)operator(.)ident(write)operator(()stringoperator(\)) + ident(out)operator(.)ident(write)operator(()string operator(%) operator(()stringoperator(,) ident(default_token)operator(\))operator(\)) + keyword(for) ident(token)operator(,) ident(definition) keyword(in) ident(tokens)operator(:) + keyword(if) ident(definition)operator(:) + ident(out)operator(.)ident(write)operator(()string operator(%) operator(()ident(token) operator(+) stringoperator(,) ident(definition)operator(\))operator(\)) + ident(out)operator(.)ident(write)operator(()stringoperator(\)) + + keyword(def) ident(__repr__)operator(()pre_constant(self)operator(\))operator(:) + ident(out) operator(=) ident(StringIO)operator(()operator(\)) + pre_constant(self)operator(.)ident(write_style)operator(()ident(out)operator(\)) + keyword(return) ident(out)operator(.)ident(getvalue)operator(()operator(\)) + + +keyword(def) ident(convert)operator(()ident(filename)operator(,) ident(stream)operator(=)pre_constant(None)operator(\))operator(:) + ident(name) operator(=) ident(path)operator(.)ident(basename)operator(()ident(filename)operator(\)) + keyword(if) ident(name)operator(.)ident(endswith)operator(()stringoperator(\))operator(:) + ident(name) operator(=) ident(name)operator([)operator(:)operator(-)integer(4)operator(]) + ident(f) operator(=) predefined(file)operator(()ident(filename)operator(\)) + ident(code) operator(=) ident(f)operator(.)ident(read)operator(()operator(\)) + ident(f)operator(.)ident(close)operator(()operator(\)) + ident(writer) operator(=) ident(StyleWriter)operator(()ident(code)operator(,) ident(name)operator(\)) + keyword(if) ident(stream) keyword(is) keyword(not) pre_constant(None)operator(:) + ident(out) operator(=) ident(stream) + keyword(else)operator(:) + ident(out) operator(=) ident(StringIO)operator(()operator(\)) + ident(writer)operator(.)ident(write)operator(()ident(out)operator(\)) + keyword(if) ident(stream) keyword(is) pre_constant(None)operator(:) + keyword(return) ident(out)operator(.)ident(getvalue)operator(()operator(\)) + + +keyword(def) ident(main)operator(()operator(\))operator(:) + keyword(if) predefined(len)operator(()ident(sys)operator(.)ident(argv)operator(\)) operator(!=) integer(2) keyword(or) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(]) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + keyword(print) string)delimiter(')> operator(%) ident(sys)operator(.)ident(argv)operator([)integer(0)operator(]) + keyword(return) integer(2) + keyword(if) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(]) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + keyword(print) string operator(%) operator(()ident(SCRIPT_NAME)operator(,) ident(SCRIPT_VERSION)operator(\)) + keyword(return) + ident(filename) operator(=) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(]) + keyword(if) keyword(not) operator(()ident(path)operator(.)ident(exists)operator(()ident(filename)operator(\)) keyword(and) ident(path)operator(.)ident(isfile)operator(()ident(filename)operator(\))operator(\))operator(:) + keyword(print) string operator(%) ident(filename) + keyword(return) integer(1) + ident(convert)operator(()ident(filename)operator(,) ident(sys)operator(.)ident(stdout)operator(\)) + ident(sys)operator(.)ident(stdout)operator(.)ident(write)operator(()stringoperator(\)) + + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(sys)operator(.)ident(exit)operator(()ident(main)operator(()operator(\)) keyword(or) integer(0)operator(\)) +comment(#!/usr/bin/env python) +comment(# -*- coding: utf-8 -*-) +string + +keyword(try)operator(:) + keyword(from) ident(setuptools) keyword(import) ident(setup)operator(,) ident(find_packages) +keyword(except) exception(ImportError)operator(:) + keyword(from) ident(distutils)operator(.)ident(core) keyword(import) ident(setup) + keyword(def) ident(find_packages)operator(()operator(\))operator(:) + keyword(return) operator([) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + 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(except) exception(ImportError)operator(:) + keyword(from) ident(distutils)operator(.)ident(command)operator(.)ident(build_py) keyword(import) ident(build_py) + +ident(setup)operator(() + ident(name) operator(=) stringoperator(,) + ident(version) operator(=) stringoperator(,) + ident(url) operator(=) stringoperator(,) + ident(license) operator(=) stringoperator(,) + ident(author) operator(=) stringoperator(,) + ident(author_email) operator(=) stringoperator(,) + ident(description) operator(=) stringoperator(,) + ident(long_description) operator(=) ident(__doc__)operator(,) + ident(keywords) operator(=) stringoperator(,) + ident(packages) operator(=) ident(find_packages)operator(()operator(\))operator(,) + ident(scripts) operator(=) operator([)stringoperator(])operator(,) + ident(platforms) operator(=) stringoperator(,) + ident(zip_safe) operator(=) pre_constant(False)operator(,) + ident(include_package_data) operator(=) pre_constant(True)operator(,) + ident(classifiers) operator(=) operator([) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + stringoperator(,) + operator(])operator(,) + ident(cmdclass) operator(=) operator({)stringoperator(:) ident(build_py)operator(})operator(,) +operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(sys)operator(,) ident(os) +keyword(import) ident(unittest) + +keyword(from) ident(os)operator(.)ident(path) keyword(import) ident(dirname)operator(,) ident(basename)operator(,) ident(join)operator(,) ident(abspath) + +keyword(import) ident(pygments) + +keyword(try)operator(:) + keyword(import) ident(coverage) +keyword(except) exception(ImportError)operator(:) + ident(coverage) operator(=) pre_constant(None) + +ident(testdir) operator(=) ident(abspath)operator(()ident(dirname)operator(()ident(__file__)operator(\))operator(\)) + +ident(failed) operator(=) operator([)operator(]) +ident(total_test_count) operator(=) integer(0) +ident(error_test_count) operator(=) integer(0) + + +keyword(def) ident(err)operator(()predefined(file)operator(,) ident(what)operator(,) ident(exc)operator(\))operator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) predefined(file)operator(,) string operator(%) ident(what)operator(,) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) ident(exc) + ident(failed)operator(.)ident(append)operator(()predefined(file)operator([)operator(:)operator(-)integer(3)operator(])operator(\)) + + +keyword(class) ident(QuietTestRunner)operator(()predefined(object)operator(\))operator(:) + string + + keyword(def) ident(__init__)operator(()pre_constant(self)operator(,) ident(testname)operator(,) ident(stream)operator(=)ident(sys)operator(.)ident(stderr)operator(\))operator(:) + pre_constant(self)operator(.)ident(testname) operator(=) ident(testname) + pre_constant(self)operator(.)ident(stream) operator(=) ident(unittest)operator(.)ident(_WritelnDecorator)operator(()ident(stream)operator(\)) + + keyword(def) ident(run)operator(()pre_constant(self)operator(,) ident(test)operator(\))operator(:) + keyword(global) ident(total_test_count) + keyword(global) ident(error_test_count) + ident(result) operator(=) ident(unittest)operator(.)ident(_TextTestResult)operator(()pre_constant(self)operator(.)ident(stream)operator(,) pre_constant(True)operator(,) integer(1)operator(\)) + ident(test)operator(()ident(result)operator(\)) + keyword(if) keyword(not) ident(result)operator(.)ident(wasSuccessful)operator(()operator(\))operator(:) + pre_constant(self)operator(.)ident(stream)operator(.)ident(write)operator(()stringoperator(\)) + ident(result)operator(.)ident(printErrors)operator(()operator(\)) + ident(failed)operator(.)ident(append)operator(()pre_constant(self)operator(.)ident(testname)operator(\)) + keyword(else)operator(:) + pre_constant(self)operator(.)ident(stream)operator(.)ident(write)operator(()stringoperator(\)) + ident(total_test_count) operator(+=) ident(result)operator(.)ident(testsRun) + ident(error_test_count) operator(+=) predefined(len)operator(()ident(result)operator(.)ident(errors)operator(\)) operator(+) predefined(len)operator(()ident(result)operator(.)ident(failures)operator(\)) + keyword(return) ident(result) + + +keyword(def) ident(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(if) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(])operator(:) + comment(# test only files given on cmdline) + ident(files) operator(=) operator([)ident(entry) operator(+) string keyword(for) ident(entry) keyword(in) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)operator(]) keyword(if) ident(entry)operator(.)ident(startswith)operator(()stringoperator(\))operator(]) + keyword(else)operator(:) + ident(files) operator(=) operator([)ident(entry) keyword(for) ident(entry) keyword(in) ident(os)operator(.)ident(listdir)operator(()ident(testdir)operator(\)) + keyword(if) operator(()ident(entry)operator(.)ident(startswith)operator(()stringoperator(\)) keyword(and) ident(entry)operator(.)ident(endswith)operator(()stringoperator(\))operator(\))operator(]) + ident(files)operator(.)ident(sort)operator(()operator(\)) + + ident(WIDTH) operator(=) integer(85) + + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) \ + operator(()string operator(%) + operator(()ident(pygments)operator(.)ident(__version__)operator(,) + ident(with_coverage) keyword(and) string keyword(or) stringoperator(\))operator(\))operator(.)ident(center)operator(()ident(WIDTH)operator(\)) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) operator(()string operator(%) ident(sys)operator(.)ident(version)operator(.)ident(split)operator(()operator(\))operator([)integer(0)operator(])operator(\))operator(.)ident(center)operator(()ident(WIDTH)operator(\)) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) stringoperator(*)ident(WIDTH) + + keyword(if) ident(with_coverage)operator(:) + ident(coverage)operator(.)ident(erase)operator(()operator(\)) + ident(coverage)operator(.)ident(start)operator(()operator(\)) + + keyword(for) ident(testfile) keyword(in) ident(files)operator(:) + ident(globs) operator(=) operator({)stringoperator(:) ident(join)operator(()ident(testdir)operator(,) ident(testfile)operator(\))operator(}) + keyword(try)operator(:) + predefined(execfile)operator(()ident(join)operator(()ident(testdir)operator(,) ident(testfile)operator(\))operator(,) ident(globs)operator(\)) + keyword(except) exception(Exception)operator(,) ident(exc)operator(:) + keyword(raise) + ident(err)operator(()ident(testfile)operator(,) stringoperator(,) ident(exc)operator(\)) + keyword(continue) + ident(sys)operator(.)ident(stderr)operator(.)ident(write)operator(()ident(testfile)operator([)operator(:)operator(-)integer(3)operator(]) operator(+) stringoperator(\)) + keyword(try)operator(:) + ident(runner) operator(=) ident(QuietTestRunner)operator(()ident(testfile)operator([)operator(:)operator(-)integer(3)operator(])operator(\)) + comment(# make a test suite of all TestCases in the file) + ident(tests) operator(=) operator([)operator(]) + keyword(for) ident(name)operator(,) ident(thing) keyword(in) ident(globs)operator(.)ident(iteritems)operator(()operator(\))operator(:) + keyword(if) ident(name)operator(.)ident(endswith)operator(()stringoperator(\))operator(:) + ident(tests)operator(.)ident(append)operator(()operator(()ident(name)operator(,) ident(unittest)operator(.)ident(makeSuite)operator(()ident(thing)operator(\))operator(\))operator(\)) + ident(tests)operator(.)ident(sort)operator(()operator(\)) + ident(suite) operator(=) ident(unittest)operator(.)ident(TestSuite)operator(()operator(\)) + ident(suite)operator(.)ident(addTests)operator(()operator([)ident(x)operator([)integer(1)operator(]) keyword(for) ident(x) keyword(in) ident(tests)operator(])operator(\)) + ident(runner)operator(.)ident(run)operator(()ident(suite)operator(\)) + keyword(except) exception(Exception)operator(,) ident(exc)operator(:) + ident(err)operator(()ident(testfile)operator(,) stringoperator(,) ident(exc)operator(\)) + + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) stringoperator(*)ident(WIDTH) + keyword(if) ident(failed)operator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) string operator(%) \ + operator(()ident(error_test_count)operator(,) ident(total_test_count)operator(\)) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) stringoperator(,) stringoperator(.)ident(join)operator(()ident(failed)operator(\)) + ident(ret) operator(=) integer(1) + keyword(else)operator(:) + keyword(if) ident(total_test_count) operator(==) integer(1)operator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) string + keyword(else)operator(:) + keyword(print) operator(>>)ident(sys)operator(.)ident(stderr)operator(,) string operator(%) ident(total_test_count) + ident(ret) operator(=) integer(0) + + keyword(if) ident(with_coverage)operator(:) + ident(coverage)operator(.)ident(stop)operator(()operator(\)) + ident(modules) operator(=) operator([)ident(mod) keyword(for) ident(name)operator(,) ident(mod) keyword(in) ident(sys)operator(.)ident(modules)operator(.)ident(iteritems)operator(()operator(\)) + keyword(if) ident(name)operator(.)ident(startswith)operator(()stringoperator(\)) keyword(and) ident(mod)operator(]) + ident(coverage)operator(.)ident(report)operator(()ident(modules)operator(\)) + + keyword(return) ident(ret) + + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(with_coverage) operator(=) pre_constant(False) + keyword(if) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(:)integer(2)operator(]) operator(==) operator([)stringoperator(])operator(:) + ident(with_coverage) operator(=) predefined(bool)operator(()ident(coverage)operator(\)) + keyword(del) ident(sys)operator(.)ident(argv)operator([)integer(1)operator(]) + ident(sys)operator(.)ident(exit)operator(()ident(run_tests)operator(()ident(with_coverage)operator(\))operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(sys)operator(,) ident(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(()stringoperator(\)) + keyword(from) ident(distutils)operator(.)ident(util) keyword(import) ident(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(,) stringoperator(,) stringoperator(\)) + 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(,) stringoperator(\))operator(\)) + +keyword(try)operator(:) + keyword(import) ident(nose) +keyword(except) exception(ImportError)operator(:) + keyword(print) operator(()stringoperator(\)) + ident(sys)operator(.)ident(exit)operator(()integer(1)operator(\)) + +ident(nose)operator(.)ident(main)operator(()operator(\)) +comment(# coding: utf-8) +string + +keyword(import) ident(os) + + +keyword(def) ident(location)operator(()ident(mod_name)operator(\))operator(:) + string + ident(source) operator(=) ident(mod_name)operator(.)ident(endswith)operator(()stringoperator(\)) keyword(and) ident(mod_name)operator([)operator(:)operator(-)integer(1)operator(]) keyword(or) ident(mod_name) + ident(source) operator(=) ident(os)operator(.)ident(path)operator(.)ident(abspath)operator(()ident(source)operator(\)) + keyword(return) ident(source)operator(,) ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(source)operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(os) +keyword(import) ident(unittest) +keyword(import) ident(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(import) ident(support) + +ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) + +ident(test_content) operator(=) operator([)predefined(chr)operator(()ident(i)operator(\)) keyword(for) ident(i) keyword(in) predefined(xrange)operator(()integer(33)operator(,) integer(128)operator(\))operator(]) operator(*) integer(5) +ident(random)operator(.)ident(shuffle)operator(()ident(test_content)operator(\)) +ident(test_content) operator(=) stringoperator(.)ident(join)operator(()ident(test_content)operator(\)) operator(+) string + +keyword(class) ident(LexersTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(test_import_all)operator(()pre_constant(self)operator(\))operator(:) + comment(# instantiate every lexer, to see if the token type defs are correct) + keyword(for) ident(x) keyword(in) ident(lexers)operator(.)ident(LEXERS)operator(.)ident(keys)operator(()operator(\))operator(:) + ident(c) operator(=) predefined(getattr)operator(()ident(lexers)operator(,) ident(x)operator(\))operator(()operator(\)) + + keyword(def) ident(test_lexer_classes)operator(()pre_constant(self)operator(\))operator(:) + ident(a) operator(=) pre_constant(self)operator(.)ident(assert_) + ident(ae) operator(=) pre_constant(self)operator(.)ident(assertEquals) + comment(# test that every lexer class has the correct public API) + keyword(for) ident(lexer) keyword(in) ident(lexers)operator(.)ident(_iter_lexerclasses)operator(()operator(\))operator(:) + ident(a)operator(()predefined(type)operator(()ident(lexer)operator(.)ident(name)operator(\)) keyword(is) predefined(str)operator(\)) + keyword(for) ident(attr) keyword(in) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(:) + ident(a)operator(()predefined(hasattr)operator(()ident(lexer)operator(,) ident(attr)operator(\))operator(\)) + ident(a)operator(()predefined(type)operator(()predefined(getattr)operator(()ident(lexer)operator(,) ident(attr)operator(\))operator(\)) keyword(is) predefined(list)operator(,) string operator(%) + operator(()ident(lexer)operator(,) ident(attr)operator(\))operator(\)) + ident(result) operator(=) ident(lexer)operator(.)ident(analyse_text)operator(()stringoperator(\)) + ident(a)operator(()predefined(isinstance)operator(()ident(result)operator(,) predefined(float)operator(\)) keyword(and) float(0)float(.0) operator(<=) ident(result) operator(<=) float(1)float(.0)operator(\)) + + ident(inst) operator(=) ident(lexer)operator(()ident(opt1)operator(=)stringoperator(,) ident(opt2)operator(=)stringoperator(\)) + keyword(if) predefined(issubclass)operator(()ident(lexer)operator(,) ident(RegexLexer)operator(\))operator(:) + keyword(if) keyword(not) predefined(hasattr)operator(()ident(lexer)operator(,) stringoperator(\))operator(:) + comment(# if there's no "_tokens", the lexer has to be one with) + comment(# multiple tokendef variants) + ident(a)operator(()ident(lexer)operator(.)ident(token_variants)operator(\)) + keyword(for) ident(variant) keyword(in) ident(lexer)operator(.)ident(tokens)operator(:) + ident(a)operator(()string keyword(in) ident(lexer)operator(.)ident(tokens)operator([)ident(variant)operator(])operator(\)) + keyword(else)operator(:) + ident(a)operator(()string keyword(in) ident(lexer)operator(.)ident(_tokens)operator(,) string operator(%) ident(lexer)operator(\)) + + ident(tokens) operator(=) predefined(list)operator(()ident(inst)operator(.)ident(get_tokens)operator(()ident(test_content)operator(\))operator(\)) + ident(txt) operator(=) string + keyword(for) ident(token) keyword(in) ident(tokens)operator(:) + ident(a)operator(()predefined(isinstance)operator(()ident(token)operator(,) predefined(tuple)operator(\))operator(\)) + ident(a)operator(()predefined(isinstance)operator(()ident(token)operator([)integer(0)operator(])operator(,) ident(_TokenType)operator(\))operator(\)) + keyword(if) predefined(isinstance)operator(()ident(token)operator([)integer(1)operator(])operator(,) predefined(str)operator(\))operator(:) + keyword(print) predefined(repr)operator(()ident(token)operator([)integer(1)operator(])operator(\)) + ident(a)operator(()predefined(isinstance)operator(()ident(token)operator([)integer(1)operator(])operator(,) predefined(unicode)operator(\))operator(\)) + ident(txt) operator(+=) ident(token)operator([)integer(1)operator(]) + ident(ae)operator(()ident(txt)operator(,) ident(test_content)operator(,) string operator(%) + operator(()ident(lexer)operator(.)ident(name)operator(,) ident(test_content)operator(,) ident(txt)operator(\))operator(\)) + + keyword(def) ident(test_get_lexers)operator(()pre_constant(self)operator(\))operator(:) + ident(a) operator(=) pre_constant(self)operator(.)ident(assert_) + ident(ae) operator(=) pre_constant(self)operator(.)ident(assertEquals) + comment(# test that the lexers functions work) + + keyword(for) ident(func)operator(,) ident(args) keyword(in) operator([)operator(()ident(lexers)operator(.)ident(get_lexer_by_name)operator(,) operator(()stringoperator(,)operator(\))operator(\))operator(,) + operator(()ident(lexers)operator(.)ident(get_lexer_for_filename)operator(,) operator(()stringoperator(,)operator(\))operator(\))operator(,) + operator(()ident(lexers)operator(.)ident(get_lexer_for_mimetype)operator(,) operator(()stringoperator(,)operator(\))operator(\))operator(,) + operator(()ident(lexers)operator(.)ident(guess_lexer)operator(,) operator(()stringoperator(,)operator(\))operator(\))operator(,) + operator(()ident(lexers)operator(.)ident(guess_lexer_for_filename)operator(,) operator(()stringoperator(,) string)delimiter(")>operator(\))operator(\)) + operator(])operator(:) + ident(x) operator(=) ident(func)operator(()ident(opt)operator(=)stringoperator(,) operator(*)ident(args)operator(\)) + ident(a)operator(()predefined(isinstance)operator(()ident(x)operator(,) ident(lexers)operator(.)ident(PythonLexer)operator(\))operator(\)) + ident(ae)operator(()ident(x)operator(.)ident(options)operator([)stringoperator(])operator(,) stringoperator(\)) + + +keyword(class) ident(FiltersTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(test_basic)operator(()pre_constant(self)operator(\))operator(:) + ident(filter_args) operator(=) operator({) + stringoperator(:) operator({)stringoperator(:) pre_constant(True)operator(,) stringoperator(:) pre_constant(True)operator(,) stringoperator(:) pre_constant(True)operator(})operator(,) + stringoperator(:) operator({)stringoperator(:) operator([)stringoperator(,) stringoperator(,) stringoperator(])operator(})operator(,) + operator(}) + keyword(for) ident(x) keyword(in) ident(filters)operator(.)ident(FILTERS)operator(.)ident(keys)operator(()operator(\))operator(:) + ident(lx) operator(=) ident(lexers)operator(.)ident(PythonLexer)operator(()operator(\)) + ident(lx)operator(.)ident(add_filter)operator(()ident(x)operator(,) operator(**)ident(filter_args)operator(.)ident(get)operator(()ident(x)operator(,) operator({)operator(})operator(\))operator(\)) + ident(text) operator(=) predefined(open)operator(()ident(TESTFILE)operator(,) stringoperator(\))operator(.)ident(read)operator(()operator(\))operator(.)ident(decode)operator(()stringoperator(\)) + ident(tokens) operator(=) predefined(list)operator(()ident(lx)operator(.)ident(get_tokens)operator(()ident(text)operator(\))operator(\)) + ident(roundtext) operator(=) stringoperator(.)ident(join)operator(()operator([)ident(t)operator([)integer(1)operator(]) keyword(for) ident(t) keyword(in) ident(tokens)operator(])operator(\)) + keyword(if) ident(x) keyword(not) keyword(in) operator(()stringoperator(,) stringoperator(\))operator(:) + comment(# these filters change the text) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(roundtext)operator(,) ident(text)operator(,) + string operator(%) ident(x)operator(\)) + + keyword(def) ident(test_raiseonerror)operator(()pre_constant(self)operator(\))operator(:) + ident(lx) operator(=) ident(lexers)operator(.)ident(PythonLexer)operator(()operator(\)) + ident(lx)operator(.)ident(add_filter)operator(()stringoperator(,) ident(excclass)operator(=)exception(RuntimeError)operator(\)) + pre_constant(self)operator(.)ident(assertRaises)operator(()exception(RuntimeError)operator(,) predefined(list)operator(,) ident(lx)operator(.)ident(get_tokens)operator(()stringoperator(\))operator(\)) + + keyword(def) ident(test_whitespace)operator(()pre_constant(self)operator(\))operator(:) + ident(lx) operator(=) ident(lexers)operator(.)ident(PythonLexer)operator(()operator(\)) + ident(lx)operator(.)ident(add_filter)operator(()stringoperator(,) ident(spaces)operator(=)stringoperator(\)) + ident(text) operator(=) predefined(open)operator(()ident(TESTFILE)operator(,) stringoperator(\))operator(.)ident(read)operator(()operator(\))operator(.)ident(decode)operator(()stringoperator(\)) + ident(lxtext) operator(=) stringoperator(.)ident(join)operator(()operator([)ident(t)operator([)integer(1)operator(]) keyword(for) ident(t) keyword(in) predefined(list)operator(()ident(lx)operator(.)ident(get_tokens)operator(()ident(text)operator(\))operator(\))operator(])operator(\)) + pre_constant(self)operator(.)ident(failIf)operator(()string keyword(in) ident(lxtext)operator(\)) + + keyword(def) ident(test_keywordcase)operator(()pre_constant(self)operator(\))operator(:) + ident(lx) operator(=) ident(lexers)operator(.)ident(PythonLexer)operator(()operator(\)) + ident(lx)operator(.)ident(add_filter)operator(()stringoperator(,) ident(case)operator(=)stringoperator(\)) + ident(text) operator(=) predefined(open)operator(()ident(TESTFILE)operator(,) stringoperator(\))operator(.)ident(read)operator(()operator(\))operator(.)ident(decode)operator(()stringoperator(\)) + ident(lxtext) operator(=) stringoperator(.)ident(join)operator(()operator([)ident(t)operator([)integer(1)operator(]) keyword(for) ident(t) keyword(in) predefined(list)operator(()ident(lx)operator(.)ident(get_tokens)operator(()ident(text)operator(\))operator(\))operator(])operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(lxtext) keyword(and) string keyword(in) ident(lxtext)operator(\)) + + keyword(def) ident(test_codetag)operator(()pre_constant(self)operator(\))operator(:) + ident(lx) operator(=) ident(lexers)operator(.)ident(PythonLexer)operator(()operator(\)) + ident(lx)operator(.)ident(add_filter)operator(()stringoperator(\)) + ident(text) operator(=) string + ident(tokens) operator(=) predefined(list)operator(()ident(lx)operator(.)ident(get_tokens)operator(()ident(text)operator(\))operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()stringoperator(,) ident(tokens)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()stringoperator(,) ident(tokens)operator([)integer(1)operator(])operator([)integer(1)operator(])operator(\)) + + keyword(def) ident(test_codetag_boundary)operator(()pre_constant(self)operator(\))operator(:) + comment(# http://dev.pocoo.org/projects/pygments/ticket/368) + ident(lx) operator(=) ident(lexers)operator(.)ident(PythonLexer)operator(()operator(\)) + ident(lx)operator(.)ident(add_filter)operator(()stringoperator(\)) + ident(text) operator(=) string + ident(tokens) operator(=) predefined(list)operator(()ident(lx)operator(.)ident(get_tokens)operator(()ident(text)operator(\))operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()stringoperator(,) ident(tokens)operator([)integer(0)operator(])operator([)integer(1)operator(])operator(\)) + + +keyword(class) ident(FormattersTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(test_public_api)operator(()pre_constant(self)operator(\))operator(:) + ident(a) operator(=) pre_constant(self)operator(.)ident(assert_) + ident(ae) operator(=) pre_constant(self)operator(.)ident(assertEquals) + ident(ts) operator(=) predefined(list)operator(()ident(lexers)operator(.)ident(PythonLexer)operator(()operator(\))operator(.)ident(get_tokens)operator(()stringoperator(\))operator(\)) + ident(out) operator(=) ident(StringIO)operator(()operator(\)) + comment(# test that every formatter class has the correct public API) + keyword(for) ident(formatter)operator(,) ident(info) keyword(in) ident(formatters)operator(.)ident(FORMATTERS)operator(.)ident(iteritems)operator(()operator(\))operator(:) + ident(a)operator(()predefined(len)operator(()ident(info)operator(\)) operator(==) integer(4)operator(\)) + ident(a)operator(()ident(info)operator([)integer(0)operator(])operator(,) stringoperator(\)) comment(# name) + ident(a)operator(()ident(info)operator([)integer(1)operator(])operator(,) stringoperator(\)) comment(# aliases) + ident(a)operator(()ident(info)operator([)integer(3)operator(])operator(,) stringoperator(\)) comment(# doc) + + keyword(if) ident(formatter)operator(.)ident(name) operator(==) stringoperator(:) + comment(# will not work with Unicode output file) + keyword(continue) + + keyword(try)operator(:) + ident(inst) operator(=) ident(formatter)operator(()ident(opt1)operator(=)stringoperator(\)) + keyword(except) operator(()exception(ImportError)operator(,) ident(FontNotFound)operator(\))operator(:) + keyword(continue) + keyword(try)operator(:) + ident(inst)operator(.)ident(get_style_defs)operator(()operator(\)) + keyword(except) exception(NotImplementedError)operator(:) + comment(# may be raised by formatters for which it doesn't make sense) + keyword(pass) + ident(inst)operator(.)ident(format)operator(()ident(ts)operator(,) ident(out)operator(\)) + + keyword(def) ident(test_encodings)operator(()pre_constant(self)operator(\))operator(:) + keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) + + comment(# unicode output) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()operator(\)) + ident(tokens) operator(=) operator([)operator(()ident(Text)operator(,) stringoperator(\))operator(]) + ident(out) operator(=) ident(format)operator(()ident(tokens)operator(,) ident(fmt)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()predefined(type)operator(()ident(out)operator(\)) keyword(is) predefined(unicode)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(out)operator(\)) + + comment(# encoding option) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()ident(encoding)operator(=)stringoperator(\)) + ident(tokens) operator(=) operator([)operator(()ident(Text)operator(,) stringoperator(\))operator(]) + pre_constant(self)operator(.)ident(assert_)operator(()stringoperator(.)ident(encode)operator(()stringoperator(\)) keyword(in) ident(format)operator(()ident(tokens)operator(,) ident(fmt)operator(\))operator(\)) + + comment(# encoding and outencoding option) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()ident(encoding)operator(=)stringoperator(,) ident(outencoding)operator(=)stringoperator(\)) + ident(tokens) operator(=) operator([)operator(()ident(Text)operator(,) stringoperator(\))operator(]) + pre_constant(self)operator(.)ident(assert_)operator(()stringoperator(.)ident(encode)operator(()stringoperator(\)) keyword(in) ident(format)operator(()ident(tokens)operator(,) ident(fmt)operator(\))operator(\)) + + keyword(def) ident(test_styles)operator(()pre_constant(self)operator(\))operator(:) + keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(HtmlFormatter) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()ident(style)operator(=)stringoperator(\)) + + keyword(def) ident(test_unicode_handling)operator(()pre_constant(self)operator(\))operator(:) + comment(# test that the formatter supports encoding and Unicode) + ident(tokens) operator(=) predefined(list)operator(()ident(lexers)operator(.)ident(PythonLexer)operator(()ident(encoding)operator(=)stringoperator(\))operator(.) + ident(get_tokens)operator(()stringoperator(\))operator(\)) + keyword(for) ident(formatter)operator(,) ident(info) keyword(in) ident(formatters)operator(.)ident(FORMATTERS)operator(.)ident(iteritems)operator(()operator(\))operator(:) + keyword(try)operator(:) + ident(inst) operator(=) ident(formatter)operator(()ident(encoding)operator(=)pre_constant(None)operator(\)) + keyword(except) operator(()exception(ImportError)operator(,) ident(FontNotFound)operator(\))operator(:) + comment(# some dependency or font not installed) + keyword(continue) + + keyword(if) ident(formatter)operator(.)ident(name) operator(!=) stringoperator(:) + ident(out) operator(=) ident(format)operator(()ident(tokens)operator(,) ident(inst)operator(\)) + keyword(if) ident(formatter)operator(.)ident(unicodeoutput)operator(:) + pre_constant(self)operator(.)ident(assert_)operator(()predefined(type)operator(()ident(out)operator(\)) keyword(is) predefined(unicode)operator(\)) + + ident(inst) operator(=) ident(formatter)operator(()ident(encoding)operator(=)stringoperator(\)) + ident(out) operator(=) ident(format)operator(()ident(tokens)operator(,) ident(inst)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()predefined(type)operator(()ident(out)operator(\)) keyword(is) predefined(bytes)operator(,) string operator(%) operator(()ident(formatter)operator(,) ident(out)operator(\))operator(\)) + comment(# Cannot test for encoding, since formatters may have to escape) + comment(# non-ASCII characters.) + keyword(else)operator(:) + ident(inst) operator(=) ident(formatter)operator(()operator(\)) + ident(out) operator(=) ident(format)operator(()ident(tokens)operator(,) ident(inst)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()predefined(type)operator(()ident(out)operator(\)) keyword(is) predefined(bytes)operator(,) string operator(%) operator(()ident(formatter)operator(,) ident(out)operator(\))operator(\)) + + keyword(def) ident(test_get_formatters)operator(()pre_constant(self)operator(\))operator(:) + ident(a) operator(=) pre_constant(self)operator(.)ident(assert_) + ident(ae) operator(=) pre_constant(self)operator(.)ident(assertEquals) + comment(# test that the formatters functions work) + ident(x) operator(=) ident(formatters)operator(.)ident(get_formatter_by_name)operator(()stringoperator(,) ident(opt)operator(=)stringoperator(\)) + ident(a)operator(()predefined(isinstance)operator(()ident(x)operator(,) ident(formatters)operator(.)ident(HtmlFormatter)operator(\))operator(\)) + ident(ae)operator(()ident(x)operator(.)ident(options)operator([)stringoperator(])operator(,) stringoperator(\)) + + ident(x) operator(=) ident(formatters)operator(.)ident(get_formatter_for_filename)operator(()stringoperator(,) ident(opt)operator(=)stringoperator(\)) + ident(a)operator(()predefined(isinstance)operator(()ident(x)operator(,) ident(formatters)operator(.)ident(HtmlFormatter)operator(\))operator(\)) + ident(ae)operator(()ident(x)operator(.)ident(options)operator([)stringoperator(])operator(,) stringoperator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(unittest) +keyword(import) ident(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(class) ident(CLexerTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(setUp)operator(()pre_constant(self)operator(\))operator(:) + pre_constant(self)operator(.)ident(lexer) operator(=) ident(CLexer)operator(()operator(\)) + + keyword(def) ident(testNumbers)operator(()pre_constant(self)operator(\))operator(:) + ident(code) operator(=) string + ident(wanted) operator(=) operator([)operator(]) + keyword(for) ident(item) keyword(in) predefined(zip)operator(()operator([)ident(Number)operator(.)ident(Integer)operator(,) ident(Number)operator(.)ident(Float)operator(,) ident(Number)operator(.)ident(Float)operator(,) + ident(Number)operator(.)ident(Float)operator(,) ident(Number)operator(.)ident(Oct)operator(,) ident(Number)operator(.)ident(Hex)operator(,) + ident(Number)operator(.)ident(Float)operator(,) ident(Number)operator(.)ident(Float)operator(])operator(,) ident(code)operator(.)ident(split)operator(()operator(\))operator(\))operator(:) + ident(wanted)operator(.)ident(append)operator(()ident(item)operator(\)) + ident(wanted)operator(.)ident(append)operator(()operator(()ident(Text)operator(,) stringoperator(\))operator(\)) + ident(wanted) operator(=) operator([)operator(()ident(Text)operator(,) stringoperator(\))operator(]) operator(+) ident(wanted)operator([)operator(:)operator(-)integer(1)operator(]) operator(+) operator([)operator(()ident(Text)operator(,) stringoperator(\))operator(]) + pre_constant(self)operator(.)ident(assertEqual)operator(()predefined(list)operator(()pre_constant(self)operator(.)ident(lexer)operator(.)ident(get_tokens)operator(()ident(code)operator(\))operator(\))operator(,) ident(wanted)operator(\)) + + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(unittest)operator(.)ident(main)operator(()operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +comment(# Test the command line interface) + +keyword(import) ident(sys)operator(,) ident(os) +keyword(import) ident(unittest) +keyword(import) ident(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(import) ident(support) + +ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) + + +keyword(def) ident(run_cmdline)operator(()operator(*)ident(args)operator(\))operator(:) + ident(saved_stdout) operator(=) ident(sys)operator(.)ident(stdout) + ident(saved_stderr) operator(=) ident(sys)operator(.)ident(stderr) + ident(new_stdout) operator(=) ident(sys)operator(.)ident(stdout) operator(=) ident(StringIO)operator(.)ident(StringIO)operator(()operator(\)) + ident(new_stderr) operator(=) ident(sys)operator(.)ident(stderr) operator(=) ident(StringIO)operator(.)ident(StringIO)operator(()operator(\)) + keyword(try)operator(:) + ident(ret) operator(=) ident(cmdline_main)operator(()operator([)stringoperator(]) operator(+) predefined(list)operator(()ident(args)operator(\))operator(\)) + keyword(finally)operator(:) + ident(sys)operator(.)ident(stdout) operator(=) ident(saved_stdout) + ident(sys)operator(.)ident(stderr) operator(=) ident(saved_stderr) + keyword(return) operator(()ident(ret)operator(,) ident(new_stdout)operator(.)ident(getvalue)operator(()operator(\))operator(,) ident(new_stderr)operator(.)ident(getvalue)operator(()operator(\))operator(\)) + + +keyword(class) ident(CmdLineTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(test_L_opt)operator(()pre_constant(self)operator(\))operator(:) + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()stringoperator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(o) keyword(and) string keyword(in) ident(o) keyword(and) + string keyword(in) ident(o) keyword(and) string keyword(in) ident(o)operator(\)) + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()stringoperator(,) stringoperator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(o) keyword(and) string keyword(not) keyword(in) ident(o)operator(\)) + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()stringoperator(,) stringoperator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + + keyword(def) ident(test_O_opt)operator(()pre_constant(self)operator(\))operator(:) + ident(filename) operator(=) ident(TESTFILE) + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()stringoperator(,) + stringoperator(,) ident(filename)operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(o)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(o)operator(\)) + + keyword(def) ident(test_P_opt)operator(()pre_constant(self)operator(\))operator(:) + ident(filename) operator(=) ident(TESTFILE) + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()stringoperator(,) stringoperator(,) + stringoperator(,) ident(filename)operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()stringfoo, bar=baz=,)delimiter(")> keyword(in) ident(o)operator(\)) + + keyword(def) ident(test_F_opt)operator(()pre_constant(self)operator(\))operator(:) + ident(filename) operator(=) ident(TESTFILE) + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()string + stringoperator(,) + stringoperator(,) ident(filename)operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()stringoperator(,) stringoperator(,) stringoperator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(o)operator(\)) + + keyword(def) ident(test_S_opt)operator(()pre_constant(self)operator(\))operator(:) + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(,) stringoperator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + + keyword(def) ident(test_invalid_opts)operator(()pre_constant(self)operator(\))operator(:) + keyword(for) ident(opts) keyword(in) operator([)operator(()stringoperator(,) stringoperator(\))operator(,) operator(()stringoperator(,) stringoperator(\))operator(,) operator(()stringoperator(,) stringoperator(\))operator(,) + operator(()stringoperator(,)operator(\))operator(,) operator(()stringoperator(,) stringoperator(\))operator(,) operator(()stringoperator(,)operator(\))operator(,) + operator(()stringoperator(,) stringoperator(\))operator(,)operator(])operator(:) + pre_constant(self)operator(.)ident(assert_)operator(()ident(run_cmdline)operator(()operator(*)ident(opts)operator(\))operator([)integer(0)operator(]) operator(==) integer(2)operator(\)) + + keyword(def) ident(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) + ident(filename) operator(=) ident(TESTFILE) + ident(code) operator(=) predefined(open)operator(()ident(filename)operator(,) stringoperator(\))operator(.)ident(read)operator(()operator(\)) + + ident(output) operator(=) ident(highlight)operator(()ident(code)operator(,) ident(PythonLexer)operator(()operator(\))operator(,) ident(HtmlFormatter)operator(()operator(\))operator(\)) + + ident(c)operator(,) ident(o)operator(,) ident(e) operator(=) ident(run_cmdline)operator(()stringoperator(,) stringoperator(,) ident(filename)operator(\)) + + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(o)operator(,) ident(output)operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(e)operator(,) stringoperator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(c)operator(,) integer(0)operator(\)) + + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(unittest)operator(.)ident(main)operator(()operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(os) +keyword(import) ident(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) + + +comment(# generate methods) +keyword(def) ident(test_example_files)operator(()operator(\))operator(:) + ident(testdir) operator(=) ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(__file__)operator(\)) + keyword(for) ident(fn) keyword(in) ident(os)operator(.)ident(listdir)operator(()ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(testdir)operator(,) stringoperator(\))operator(\))operator(:) + ident(absfn) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(testdir)operator(,) stringoperator(,) ident(fn)operator(\)) + keyword(if) keyword(not) ident(os)operator(.)ident(path)operator(.)ident(isfile)operator(()ident(absfn)operator(\))operator(:) + keyword(continue) + + keyword(try)operator(:) + ident(lx) operator(=) ident(get_lexer_for_filename)operator(()ident(absfn)operator(\)) + keyword(except) ident(ClassNotFound)operator(:) + keyword(if) string keyword(not) keyword(in) ident(fn)operator(:) + keyword(raise) exception(AssertionError)operator(()string + string_filename )delimiter(')> + string + operator(%) ident(fn)operator(\)) + keyword(try)operator(:) + ident(name)operator(,) ident(rest) operator(=) ident(fn)operator(.)ident(split)operator(()stringoperator(,) integer(1)operator(\)) + ident(lx) operator(=) ident(get_lexer_by_name)operator(()ident(name)operator(\)) + keyword(except) ident(ClassNotFound)operator(:) + keyword(raise) exception(AssertionError)operator(()string operator(%) ident(fn)operator(\)) + keyword(yield) ident(check_lexer)operator(,) ident(lx)operator(,) ident(absfn) + +keyword(def) ident(check_lexer)operator(()ident(lx)operator(,) ident(absfn)operator(\))operator(:) + ident(text) operator(=) predefined(open)operator(()ident(absfn)operator(,) stringoperator(\))operator(.)ident(read)operator(()operator(\)) + ident(text) operator(=) ident(text)operator(.)ident(strip)operator(()ident(b)operator(()stringoperator(\))operator(\)) operator(+) ident(b)operator(()stringoperator(\)) + keyword(try)operator(:) + ident(text) operator(=) ident(text)operator(.)ident(decode)operator(()stringoperator(\)) + keyword(except) exception(UnicodeError)operator(:) + ident(text) operator(=) ident(text)operator(.)ident(decode)operator(()stringoperator(\)) + ident(ntext) operator(=) operator([)operator(]) + keyword(for) predefined(type)operator(,) ident(val) keyword(in) ident(lx)operator(.)ident(get_tokens)operator(()ident(text)operator(\))operator(:) + ident(ntext)operator(.)ident(append)operator(()ident(val)operator(\)) + keyword(assert) predefined(type) operator(!=) ident(Error)operator(,) string operator(%) \ + operator(()ident(lx)operator(,) ident(absfn)operator(\)) + keyword(if) stringoperator(.)ident(join)operator(()ident(ntext)operator(\)) operator(!=) ident(text)operator(:) + keyword(raise) exception(AssertionError)operator(()string operator(+) ident(absfn)operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +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(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(import) ident(support) + +ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) + +ident(tokensource) operator(=) predefined(list)operator(()ident(PythonLexer)operator(()ident(encoding)operator(=)stringoperator(\))operator(.)ident(get_tokens)operator(()predefined(open)operator(()ident(TESTFILE)operator(\))operator(.)ident(read)operator(()operator(\))operator(\))operator(\)) + +keyword(class) ident(HtmlFormatterTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + keyword(def) ident(test_correct_output)operator(()pre_constant(self)operator(\))operator(:) + ident(hfmt) operator(=) ident(HtmlFormatter)operator(()ident(nowrap)operator(=)pre_constant(True)operator(\)) + ident(houtfile) operator(=) ident(StringIO)operator(.)ident(StringIO)operator(()operator(\)) + ident(hfmt)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(houtfile)operator(\)) + + ident(nfmt) operator(=) ident(NullFormatter)operator(()operator(\)) + ident(noutfile) operator(=) ident(StringIO)operator(.)ident(StringIO)operator(()operator(\)) + ident(nfmt)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(noutfile)operator(\)) + + ident(stripped_html) operator(=) ident(re)operator(.)ident(sub)operator(()string)delimiter(')>operator(,) stringoperator(,) ident(houtfile)operator(.)ident(getvalue)operator(()operator(\))operator(\)) + ident(escaped_text) operator(=) ident(escape_html)operator(()ident(noutfile)operator(.)ident(getvalue)operator(()operator(\))operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(stripped_html)operator(,) ident(escaped_text)operator(\)) + + keyword(def) ident(test_external_css)operator(()pre_constant(self)operator(\))operator(:) + comment(# test correct behavior) + comment(# CSS should be in /tmp directory) + ident(fmt1) operator(=) ident(HtmlFormatter)operator(()ident(full)operator(=)pre_constant(True)operator(,) ident(cssfile)operator(=)stringoperator(,) ident(outencoding)operator(=)stringoperator(\)) + comment(# CSS should be in TESTDIR (TESTDIR is absolute\)) + ident(fmt2) operator(=) ident(HtmlFormatter)operator(()ident(full)operator(=)pre_constant(True)operator(,) ident(cssfile)operator(=)ident(join)operator(()ident(TESTDIR)operator(,) stringoperator(\))operator(,) + ident(outencoding)operator(=)stringoperator(\)) + ident(tfile) operator(=) ident(tempfile)operator(.)ident(NamedTemporaryFile)operator(()ident(suffix)operator(=)stringoperator(\)) + ident(fmt1)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(tfile)operator(\)) + keyword(try)operator(:) + ident(fmt2)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(tfile)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(isfile)operator(()ident(join)operator(()ident(TESTDIR)operator(,) stringoperator(\))operator(\))operator(\)) + keyword(except) exception(IOError)operator(:) + comment(# test directory not writable) + keyword(pass) + ident(tfile)operator(.)ident(close)operator(()operator(\)) + + pre_constant(self)operator(.)ident(assert_)operator(()ident(isfile)operator(()ident(join)operator(()ident(dirname)operator(()ident(tfile)operator(.)ident(name)operator(\))operator(,) stringoperator(\))operator(\))operator(\)) + ident(os)operator(.)ident(unlink)operator(()ident(join)operator(()ident(dirname)operator(()ident(tfile)operator(.)ident(name)operator(\))operator(,) stringoperator(\))operator(\)) + keyword(try)operator(:) + ident(os)operator(.)ident(unlink)operator(()ident(join)operator(()ident(TESTDIR)operator(,) stringoperator(\))operator(\)) + keyword(except) exception(OSError)operator(:) + keyword(pass) + + keyword(def) ident(test_all_options)operator(()pre_constant(self)operator(\))operator(:) + keyword(for) ident(optdict) keyword(in) operator([)predefined(dict)operator(()ident(nowrap)operator(=)pre_constant(True)operator(\))operator(,) + predefined(dict)operator(()ident(linenos)operator(=)pre_constant(True)operator(\))operator(,) + predefined(dict)operator(()ident(linenos)operator(=)pre_constant(True)operator(,) ident(full)operator(=)pre_constant(True)operator(\))operator(,) + predefined(dict)operator(()ident(linenos)operator(=)pre_constant(True)operator(,) ident(full)operator(=)pre_constant(True)operator(,) ident(noclasses)operator(=)pre_constant(True)operator(\))operator(])operator(:) + + ident(outfile) operator(=) ident(StringIO)operator(.)ident(StringIO)operator(()operator(\)) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()operator(**)ident(optdict)operator(\)) + ident(fmt)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(outfile)operator(\)) + + keyword(def) ident(test_valid_output)operator(()pre_constant(self)operator(\))operator(:) + comment(# test all available wrappers) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()ident(full)operator(=)pre_constant(True)operator(,) ident(linenos)operator(=)pre_constant(True)operator(,) ident(noclasses)operator(=)pre_constant(True)operator(,) + ident(outencoding)operator(=)stringoperator(\)) + + ident(handle)operator(,) ident(pathname) operator(=) ident(tempfile)operator(.)ident(mkstemp)operator(()stringoperator(\)) + ident(tfile) operator(=) ident(os)operator(.)ident(fdopen)operator(()ident(handle)operator(,) stringoperator(\)) + ident(fmt)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(tfile)operator(\)) + ident(tfile)operator(.)ident(close)operator(()operator(\)) + ident(catname) operator(=) ident(os)operator(.)ident(path)operator(.)ident(join)operator(()ident(TESTDIR)operator(,) stringoperator(,) stringoperator(\)) + keyword(try)operator(:) + keyword(try)operator(:) + keyword(import) ident(subprocess) + ident(ret) operator(=) ident(subprocess)operator(.)ident(Popen)operator(()operator([)stringoperator(,) stringoperator(,) stringoperator(,) 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(:) + comment(# Python 2.3 - no subprocess module) + ident(ret) operator(=) ident(os)operator(.)ident(popen)operator(()string operator(%) operator(()ident(catname)operator(,) ident(pathname)operator(\))operator(\))operator(.)ident(close)operator(()operator(\)) + keyword(if) ident(ret) operator(==) integer(32512)operator(:) keyword(raise) exception(OSError) comment(# not found) + keyword(except) exception(OSError)operator(:) + comment(# nsgmls not available) + keyword(pass) + keyword(else)operator(:) + pre_constant(self)operator(.)ident(failIf)operator(()ident(ret)operator(,) stringoperator(\)) + + ident(os)operator(.)ident(unlink)operator(()ident(pathname)operator(\)) + + keyword(def) ident(test_get_style_defs)operator(()pre_constant(self)operator(\))operator(:) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()operator(\)) + ident(sd) operator(=) ident(fmt)operator(.)ident(get_style_defs)operator(()operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(sd)operator(.)ident(startswith)operator(()stringoperator(\))operator(\)) + + ident(fmt) operator(=) ident(HtmlFormatter)operator(()ident(cssclass)operator(=)stringoperator(\)) + ident(sd) operator(=) ident(fmt)operator(.)ident(get_style_defs)operator(()operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(sd)operator(.)ident(startswith)operator(()stringoperator(\))operator(\)) + ident(sd) operator(=) ident(fmt)operator(.)ident(get_style_defs)operator(()stringoperator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(sd)operator(.)ident(startswith)operator(()stringoperator(\))operator(\)) + ident(sd) operator(=) ident(fmt)operator(.)ident(get_style_defs)operator(()operator([)stringoperator(,) stringoperator(])operator(\)) + ident(fl) operator(=) ident(sd)operator(.)ident(splitlines)operator(()operator(\))operator([)integer(0)operator(]) + pre_constant(self)operator(.)ident(assert_)operator(()string keyword(in) ident(fl) keyword(and) string keyword(in) ident(fl)operator(\)) + + keyword(def) ident(test_unicode_options)operator(()pre_constant(self)operator(\))operator(:) + ident(fmt) operator(=) ident(HtmlFormatter)operator(()ident(title)operator(=)stringoperator(,) + ident(cssclass)operator(=)stringoperator(,) + ident(cssstyles)operator(=)stringoperator(,) + ident(encoding)operator(=)stringoperator(\)) + ident(handle)operator(,) ident(pathname) operator(=) ident(tempfile)operator(.)ident(mkstemp)operator(()stringoperator(\)) + ident(tfile) operator(=) ident(os)operator(.)ident(fdopen)operator(()ident(handle)operator(,) stringoperator(\)) + ident(fmt)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(tfile)operator(\)) + ident(tfile)operator(.)ident(close)operator(()operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(os) +keyword(import) ident(unittest) +keyword(import) ident(tempfile) + +keyword(from) ident(pygments)operator(.)ident(formatters) keyword(import) ident(LatexFormatter) +keyword(from) ident(pygments)operator(.)ident(lexers) keyword(import) ident(PythonLexer) + +keyword(import) ident(support) + +ident(TESTFILE)operator(,) ident(TESTDIR) operator(=) ident(support)operator(.)ident(location)operator(()ident(__file__)operator(\)) + + +keyword(class) ident(LatexFormatterTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(test_valid_output)operator(()pre_constant(self)operator(\))operator(:) + ident(tokensource) operator(=) predefined(list)operator(()ident(PythonLexer)operator(()operator(\))operator(.)ident(get_tokens)operator(()predefined(open)operator(()ident(TESTFILE)operator(\))operator(.)ident(read)operator(()operator(\))operator(\))operator(\)) + ident(fmt) operator(=) ident(LatexFormatter)operator(()ident(full)operator(=)pre_constant(True)operator(,) ident(encoding)operator(=)stringoperator(\)) + + ident(handle)operator(,) ident(pathname) operator(=) ident(tempfile)operator(.)ident(mkstemp)operator(()stringoperator(\)) + comment(# place all output files in /tmp too) + ident(old_wd) operator(=) ident(os)operator(.)ident(getcwd)operator(()operator(\)) + ident(os)operator(.)ident(chdir)operator(()ident(os)operator(.)ident(path)operator(.)ident(dirname)operator(()ident(pathname)operator(\))operator(\)) + ident(tfile) operator(=) ident(os)operator(.)ident(fdopen)operator(()ident(handle)operator(,) stringoperator(\)) + ident(fmt)operator(.)ident(format)operator(()ident(tokensource)operator(,) ident(tfile)operator(\)) + ident(tfile)operator(.)ident(close)operator(()operator(\)) + keyword(try)operator(:) + keyword(try)operator(:) + keyword(import) ident(subprocess) + ident(ret) operator(=) ident(subprocess)operator(.)ident(Popen)operator(()operator([)stringoperator(,) stringoperator(,) + ident(pathname)operator(])operator(,) + ident(stdout)operator(=)ident(subprocess)operator(.)ident(PIPE)operator(\))operator(.)ident(wait)operator(()operator(\)) + keyword(except) exception(ImportError)operator(:) + comment(# Python 2.3 - no subprocess module) + ident(ret) operator(=) ident(os)operator(.)ident(popen)operator(()string + operator(%) ident(pathname)operator(\))operator(.)ident(close)operator(()operator(\)) + keyword(if) ident(ret) operator(==) integer(32512)operator(:) keyword(raise) exception(OSError) comment(# not found) + keyword(except) exception(OSError)operator(:) + comment(# latex not available) + keyword(pass) + keyword(else)operator(:) + pre_constant(self)operator(.)ident(failIf)operator(()ident(ret)operator(,) stringoperator(\)) + + ident(os)operator(.)ident(unlink)operator(()ident(pathname)operator(\)) + ident(os)operator(.)ident(chdir)operator(()ident(old_wd)operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(unittest) + +keyword(from) ident(pygments)operator(.)ident(token) keyword(import) ident(Text) +keyword(from) ident(pygments)operator(.)ident(lexer) keyword(import) ident(RegexLexer) + +keyword(class) ident(TestLexer)operator(()ident(RegexLexer)operator(\))operator(:) + string + ident(tokens) operator(=) operator({) + stringoperator(:) operator([) + operator(()stringoperator(,) ident(Text)operator(.)ident(Root)operator(,) stringoperator(\))operator(,) + operator(()stringoperator(,) ident(Text)operator(.)ident(Root)operator(\))operator(,) + operator(])operator(,) + stringoperator(:) operator([) + operator(()stringoperator(,) ident(Text)operator(.)ident(Beer)operator(,) operator(()stringoperator(,) stringoperator(\))operator(\))operator(,) + operator(])operator(,) + stringoperator(:) operator([) + operator(()stringoperator(,) ident(Text)operator(.)ident(Rag)operator(,) stringoperator(\))operator(,) + operator(()stringoperator(,) ident(Text)operator(.)ident(Rag)operator(,) operator(()stringoperator(,) stringoperator(\))operator(\))operator(,) + operator(])operator(,) + operator(}) + +keyword(class) ident(TupleTransTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + keyword(def) ident(test)operator(()pre_constant(self)operator(\))operator(:) + ident(lx) operator(=) ident(TestLexer)operator(()operator(\)) + ident(toks) operator(=) predefined(list)operator(()ident(lx)operator(.)ident(get_tokens_unprocessed)operator(()stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(toks)operator(,) + operator([)operator(()integer(0)operator(,) ident(Text)operator(.)ident(Root)operator(,) stringoperator(\))operator(,) operator(()integer(1)operator(,) ident(Text)operator(.)ident(Rag)operator(,) stringoperator(\))operator(,) operator(()integer(2)operator(,) ident(Text)operator(.)ident(Rag)operator(,) stringoperator(\))operator(,) + operator(()integer(3)operator(,) ident(Text)operator(.)ident(Beer)operator(,) stringoperator(\))operator(,) operator(()integer(4)operator(,) ident(Text)operator(.)ident(Root)operator(,) stringoperator(\))operator(])operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(unittest) +keyword(import) ident(StringIO) +keyword(import) ident(sys) + +keyword(from) ident(pygments) keyword(import) ident(token) + + +keyword(class) ident(TokenTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(test_tokentype)operator(()pre_constant(self)operator(\))operator(:) + ident(e) operator(=) pre_constant(self)operator(.)ident(assertEquals) + ident(r) operator(=) pre_constant(self)operator(.)ident(assertRaises) + + ident(t) operator(=) ident(token)operator(.)ident(String) + + ident(e)operator(()ident(t)operator(.)ident(split)operator(()operator(\))operator(,) operator([)ident(token)operator(.)ident(Token)operator(,) ident(token)operator(.)ident(Literal)operator(,) ident(token)operator(.)ident(String)operator(])operator(\)) + + ident(e)operator(()ident(t)operator(.)ident(__class__)operator(,) ident(token)operator(.)ident(_TokenType)operator(\)) + + keyword(def) ident(test_functions)operator(()pre_constant(self)operator(\))operator(:) + pre_constant(self)operator(.)ident(assert_)operator(()ident(token)operator(.)ident(is_token_subtype)operator(()ident(token)operator(.)ident(String)operator(,) ident(token)operator(.)ident(String)operator(\))operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(token)operator(.)ident(is_token_subtype)operator(()ident(token)operator(.)ident(String)operator(,) ident(token)operator(.)ident(Literal)operator(\))operator(\)) + pre_constant(self)operator(.)ident(failIf)operator(()ident(token)operator(.)ident(is_token_subtype)operator(()ident(token)operator(.)ident(Literal)operator(,) ident(token)operator(.)ident(String)operator(\))operator(\)) + + pre_constant(self)operator(.)ident(assert_)operator(()ident(token)operator(.)ident(string_to_tokentype)operator(()ident(token)operator(.)ident(String)operator(\)) keyword(is) ident(token)operator(.)ident(String)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(token)operator(.)ident(string_to_tokentype)operator(()stringoperator(\)) keyword(is) ident(token)operator(.)ident(Token)operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(token)operator(.)ident(string_to_tokentype)operator(()stringoperator(\)) keyword(is) ident(token)operator(.)ident(String)operator(\)) + + keyword(def) ident(test_sanity_check)operator(()pre_constant(self)operator(\))operator(:) + ident(stp) operator(=) ident(token)operator(.)ident(STANDARD_TYPES)operator(.)ident(copy)operator(()operator(\)) + ident(stp)operator([)ident(token)operator(.)ident(Token)operator(]) operator(=) string comment(# Token and Text do conflict, that is okay) + ident(t) operator(=) operator({)operator(}) + keyword(for) ident(k)operator(,) ident(v) keyword(in) ident(stp)operator(.)ident(iteritems)operator(()operator(\))operator(:) + ident(t)operator(.)ident(setdefault)operator(()ident(v)operator(,) operator([)operator(])operator(\))operator(.)ident(append)operator(()ident(k)operator(\)) + keyword(if) predefined(len)operator(()ident(t)operator(\)) operator(==) predefined(len)operator(()ident(stp)operator(\))operator(:) + keyword(return) comment(# Okay) + + keyword(for) ident(k)operator(,) ident(v) keyword(in) ident(t)operator(.)ident(iteritems)operator(()operator(\))operator(:) + keyword(if) predefined(len)operator(()ident(v)operator(\)) operator(>) integer(1)operator(:) + pre_constant(self)operator(.)ident(fail)operator(()string operator(%) operator(()ident(k)operator(,) ident(v)operator(\))operator(\)) + + +keyword(if) ident(__name__) operator(==) stringoperator(:) + 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(class) ident(TestLexer)operator(()ident(RegexLexer)operator(\))operator(:) + ident(tokens) operator(=) operator({) + stringoperator(:) operator([) + operator(()stringoperator(,) ident(using)operator(()ident(this)operator(,) ident(state)operator(=)stringoperator(\))operator(\))operator(,) + operator(()stringoperator(,) ident(bygroups)operator(()ident(String)operator(,) ident(using)operator(()ident(this)operator(,) ident(state)operator(=)stringoperator(\))operator(,) ident(String)operator(\))operator(\))operator(,) + operator(()stringoperator(,) ident(Text)operator(\))operator(,) + operator(])operator(,) + stringoperator(:) operator([) + operator(()stringoperator(,) ident(Keyword)operator(\))operator(,) + operator(])operator(,) + operator(}) + +keyword(class) ident(UsingStateTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + keyword(def) ident(test_basic)operator(()pre_constant(self)operator(\))operator(:) + ident(expected) operator(=) operator([)operator(()ident(Text)operator(,) stringoperator(\))operator(,) operator(()ident(String)operator(,) stringoperator(\))operator(,) operator(()ident(Keyword)operator(,) stringoperator(\))operator(,) + operator(()ident(String)operator(,) stringoperator(\))operator(,) operator(()ident(Text)operator(,) stringoperator(\))operator(]) + ident(t) operator(=) predefined(list)operator(()ident(TestLexer)operator(()operator(\))operator(.)ident(get_tokens)operator(()stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(t)operator(,) ident(expected)operator(\)) + keyword(def) ident(test_error)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) ident(gen)operator(()operator(\))operator(:) + ident(x) operator(=) predefined(list)operator(()ident(TestLexer)operator(()operator(\))operator(.)ident(get_tokens)operator(()stringoperator(\))operator(\)) + comment(#XXX: should probably raise a more specific exception if the state) + comment(# doesn't exist.) + pre_constant(self)operator(.)ident(assertRaises)operator(()exception(Exception)operator(,) ident(gen)operator(\)) + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(unittest)operator(.)ident(main)operator(()operator(\)) +comment(# -*- coding: utf-8 -*-) +string + +keyword(import) ident(unittest) +keyword(import) ident(os) + +keyword(from) ident(pygments) keyword(import) ident(util) + + +keyword(class) ident(UtilTest)operator(()ident(unittest)operator(.)ident(TestCase)operator(\))operator(:) + + keyword(def) ident(test_getoptions)operator(()pre_constant(self)operator(\))operator(:) + ident(raises) operator(=) pre_constant(self)operator(.)ident(assertRaises) + ident(equals) operator(=) pre_constant(self)operator(.)ident(assertEquals) + + ident(equals)operator(()ident(util)operator(.)ident(get_bool_opt)operator(()operator({)operator(})operator(,) stringoperator(,) pre_constant(True)operator(\))operator(,) pre_constant(True)operator(\)) + ident(equals)operator(()ident(util)operator(.)ident(get_bool_opt)operator(()operator({)operator(})operator(,) stringoperator(,) integer(1)operator(\))operator(,) pre_constant(True)operator(\)) + ident(equals)operator(()ident(util)operator(.)ident(get_bool_opt)operator(()operator({)operator(})operator(,) stringoperator(,) stringoperator(\))operator(,) pre_constant(True)operator(\)) + ident(equals)operator(()ident(util)operator(.)ident(get_bool_opt)operator(()operator({)operator(})operator(,) stringoperator(,) stringoperator(\))operator(,) pre_constant(False)operator(\)) + ident(raises)operator(()ident(util)operator(.)ident(OptionError)operator(,) ident(util)operator(.)ident(get_bool_opt)operator(,) operator({)operator(})operator(,) stringoperator(,) operator([)operator(])operator(\)) + ident(raises)operator(()ident(util)operator(.)ident(OptionError)operator(,) ident(util)operator(.)ident(get_bool_opt)operator(,) operator({)operator(})operator(,) stringoperator(,) stringoperator(\)) + + ident(equals)operator(()ident(util)operator(.)ident(get_int_opt)operator(()operator({)operator(})operator(,) stringoperator(,) integer(1)operator(\))operator(,) integer(1)operator(\)) + ident(raises)operator(()ident(util)operator(.)ident(OptionError)operator(,) ident(util)operator(.)ident(get_int_opt)operator(,) operator({)operator(})operator(,) stringoperator(,) operator([)operator(])operator(\)) + ident(raises)operator(()ident(util)operator(.)ident(OptionError)operator(,) ident(util)operator(.)ident(get_int_opt)operator(,) operator({)operator(})operator(,) stringoperator(,) stringoperator(\)) + + ident(equals)operator(()ident(util)operator(.)ident(get_list_opt)operator(()operator({)operator(})operator(,) stringoperator(,) operator([)integer(1)operator(])operator(\))operator(,) operator([)integer(1)operator(])operator(\)) + ident(equals)operator(()ident(util)operator(.)ident(get_list_opt)operator(()operator({)operator(})operator(,) stringoperator(,) stringoperator(\))operator(,) operator([)stringoperator(,) stringoperator(])operator(\)) + ident(raises)operator(()ident(util)operator(.)ident(OptionError)operator(,) ident(util)operator(.)ident(get_list_opt)operator(,) operator({)operator(})operator(,) stringoperator(,) integer(1)operator(\)) + + + keyword(def) ident(test_docstring_headline)operator(()pre_constant(self)operator(\))operator(:) + keyword(def) ident(f1)operator(()operator(\))operator(:) + string + keyword(def) ident(f2)operator(()operator(\))operator(:) + string + + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(util)operator(.)ident(docstring_headline)operator(()ident(f1)operator(\))operator(,) stringoperator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(util)operator(.)ident(docstring_headline)operator(()ident(f2)operator(\))operator(,) stringoperator(\)) + + keyword(def) ident(test_analysator)operator(()pre_constant(self)operator(\))operator(:) + keyword(class) ident(X)operator(()predefined(object)operator(\))operator(:) + keyword(def) ident(analyse)operator(()ident(text)operator(\))operator(:) + keyword(return) float(0)float(.5) + ident(analyse) operator(=) ident(util)operator(.)ident(make_analysator)operator(()ident(analyse)operator(\)) + pre_constant(self)operator(.)ident(assertEquals)operator(()ident(X)operator(.)ident(analyse)operator(()stringoperator(\))operator(,) float(0)float(.5)operator(\)) + + keyword(def) ident(test_shebang_matches)operator(()pre_constant(self)operator(\))operator(:) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(shebang_matches)operator(()stringoperator(,) stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(shebang_matches)operator(()stringoperator(,) stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(shebang_matches)operator(()stringoperator(,) + stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(shebang_matches)operator(()stringoperator(,) + stringoperator(\))operator(\)) + + pre_constant(self)operator(.)ident(failIf)operator(()ident(util)operator(.)ident(shebang_matches)operator(()stringoperator(,) stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(failIf)operator(()ident(util)operator(.)ident(shebang_matches)operator(()stringoperator(,) stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(failIf)operator(()ident(util)operator(.)ident(shebang_matches)operator(()stringoperator(,) stringoperator(\))operator(\)) + + keyword(def) ident(test_doctype_matches)operator(()pre_constant(self)operator(\))operator(:) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(doctype_matches)operator(()string )delimiter(')>operator(,) + stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(failIf)operator(()ident(util)operator(.)ident(doctype_matches)operator(()string )delimiter(')>operator(,) + stringoperator(\))operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(html_doctype_matches)operator(() + string)delimiter(')>operator(\))operator(\)) + + keyword(def) ident(test_xml)operator(()pre_constant(self)operator(\))operator(:) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(looks_like_xml)operator(() + string)delimiter(')>operator(\))operator(\)) + pre_constant(self)operator(.)ident(assert_)operator(()ident(util)operator(.)ident(looks_like_xml)operator(()stringabc)delimiter(')>operator(\))operator(\)) + pre_constant(self)operator(.)ident(failIf)operator(()ident(util)operator(.)ident(looks_like_xml)operator(()string)delimiter(')>operator(\))operator(\)) + +keyword(if) ident(__name__) operator(==) stringoperator(:) + ident(unittest)operator(.)ident(main)operator(()operator(\)) -- cgit v1.2.1