hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [10/28] incubator-hawq git commit: HAWQ-837. Add python modules into HAWQ code
Date Tue, 21 Jun 2016 02:41:26 GMT
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/FormatStringChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/FormatStringChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/FormatStringChecks.py
new file mode 100644
index 0000000..563da14
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/FormatStringChecks.py
@@ -0,0 +1,183 @@
+from pychecker2.Check import Check
+from pychecker2.util import BaseVisitor
+from pychecker2.Warning import Warning
+from compiler import ast, walk
+from types import *
+import re
+
+class UnknownError(Exception): pass
+
+def _compute_node(node, recurse):
+    if isinstance(node, ast.Add):
+        return recurse(node.left) + recurse(node.right)
+    elif isinstance(node, ast.Mul):
+        return recurse(node.left) * recurse(node.right)
+    elif isinstance(node, ast.Sub):
+        return recurse(node.left) - recurse(node.right)
+    elif isinstance(node, ast.Div):
+        return recurse(node.left) / recurse(node.right)
+    raise UnknownError
+
+def _compute_constant(node):
+    "Compute a simple forms of constant strings from an expression node"
+    if isinstance(node, ast.Const):
+        return node.value
+    return _compute_node(node, _compute_constant)
+
+def _compute_tuple_size(node):
+    "Compute the length of simple forms of tuples from an expression node"
+    if isinstance(node, ast.Tuple):
+        return (None,) * len(node.nodes)
+    if isinstance(node, ast.Const):
+        return node.value
+    if isinstance(node, ast.Backquote):
+        return ''
+    return _compute_node(node, _compute_tuple_size)
+
+# for details: http://www.python.org/doc/current/lib/typesseq-strings.html
+_MOD_AND_TYPE = '([hlL])?([diouxXeEfFgGcrs%])'
+_TUP_FORMAT_REGEX = re.compile('%(())?[ #+-]*'
+                               '([0-9]*|[*])(|[.](|[*]|[0-9]*))' +
+                               _MOD_AND_TYPE)
+_DICT_FORMAT_REGEX = re.compile('%([(]([a-zA-Z_]+)[)])?[ #+-]*'
+                                '([0-9]*)(|[.](|[0-9]*))' + _MOD_AND_TYPE)
+
+class FormatError(Exception):
+    def __init__(self, position):
+        Exception.__init__(self)
+        self.position = position
+
+def _check_format(s):
+    pos = 0
+    specs = []
+    while 1:
+        pos = s.find('%', pos)
+        if pos < 0:
+            return specs
+
+        match = _TUP_FORMAT_REGEX.search(s, pos)
+        if not match or match.start(0) != pos:
+            match = _DICT_FORMAT_REGEX.search(s, pos)
+            if not match or match.start(0) != pos:
+                raise FormatError(pos)
+
+        if match.group(7) != '%':       # ignore "%%"
+            specs.append( (match.group(2), match.group(3), match.group(5),
+                           match.group(6)) )
+        pos = match.end(0)
+    return specs
+
+class _GetMod(BaseVisitor):
+    def __init__(self):
+        self.mods = []
+    def visitMod(self, node):
+        self.mods.append(node)
+        self.visitChildren(node)
+    # don't descend into other scopes
+    def visitFunction(self, node): pass
+    visitClass = visitFunction
+    visitLambda = visitFunction
+
+def get_mods(node):
+    try:
+        return walk(node.code, _GetMod()).mods
+    except AttributeError:
+        return walk(node.node, _GetMod()).mods
+
+_BAD_FORMAT_MAX = 10
+def _bad_format_str(s, pos):
+    result = s[pos : pos + _BAD_FORMAT_MAX]
+    return result + (len(s) > pos + _BAD_FORMAT_MAX and "..." or "")
+
+class FormatStringCheck(Check):
+    "Look for warnings in format strings"
+
+    badFormat = \
+              Warning('Report illegal format specifications in format strings',
+                      'Bad format specifier at position %d (%s)')
+    uselessModifier = \
+              Warning('Report unused modifiers for format strings (l, h, L)',
+                      'Modifier %s is not necessary')
+
+    mixedFormat = \
+              Warning('Report format strings which use both positional '
+                      'and named formats',
+                      'Cannot mix positional and named formats (%%%s)')
+    
+    formatCount = \
+              Warning('Report positional format string with the wrong '
+                      'number of arguments',
+                      'Wrong number of arguments supplied for format: '
+                      '%d given %d required')
+    unknownFormatName = \
+              Warning('Report unknown names if locals() or globals() '
+                      'are used for format strings',
+                      'The name "%s" is not defined in %s')
+
+    badConstant = \
+              Warning('Report bad constant expressions for format strings',
+                      'Error computing constant: %s')
+
+    def check(self, file, unused_checker):
+        if not file.parseTree:
+            return
+
+        for scope in file.scopes.values():
+            for mod in get_mods(scope.node):
+                formats = []
+                try:
+                    s = _compute_constant(mod.left)
+                    formats = _check_format(s)
+                except FormatError, detail:
+                    file.warning(mod, self.badFormat, detail.position,
+                                 _bad_format_str(s, detail.position))
+                except TypeError, detail:
+                    file.warning(mod, self.badConstant, str(detail))
+                except UnknownError:
+                    pass
+                if not formats:
+                    continue
+
+                count = len(formats)
+                for name, width, precision, lmodifier in formats:
+                    if lmodifier:
+                        file.warning(mod, self.uselessModifier, lmodifier)
+                    if width == '*':
+                        count += 1
+                    if precision == '*':
+                        count += 1
+
+                names = [f[0] for f in formats if f[0]]
+                if len(names) == 0:     # tuple
+                    try:
+                        t = _compute_tuple_size(mod.right)
+                        n = 1
+                        if type(t) == TupleType:
+                            n = len(t)
+                        if n != count:
+                            file.warning(mod, self.formatCount, n, count)
+                    except UnknownError:
+                        pass
+                    except TypeError, detail:
+                        file.warning(mod, self.badConstant, str(detail))
+
+                elif len(names) == len(formats): # dictionary
+                    defines = None
+                    if isinstance(mod.right, ast.CallFunc) and \
+                       isinstance(mod.right.node, ast.Name):
+                        if mod.right.node.name in ['locals', 'vars']:
+                            defines = scope.defs
+                            uses = scope.uses
+                        if mod.right.node.name == 'globals':
+                            defines = file.root_scope.defs
+                            uses = file.root_scope.uses
+                    if defines is not None:
+                        for n in names:
+                            if not defines.has_key(n):
+                                file.warning(mod, self.unknownFormatName,
+                                             n, mod.right.node.name)
+                            else:
+                                uses[n] = uses.get(n, mod)
+                else:
+                    file.warning(mod, self.mixedFormat, "(%s)" % names[0])
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ImportChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ImportChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ImportChecks.py
new file mode 100644
index 0000000..43eef4a
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ImportChecks.py
@@ -0,0 +1,93 @@
+from pychecker2.Check import Check
+from pychecker2.Check import Warning
+from pychecker2 import util
+
+from compiler import walk
+
+class ModuleReference:
+    def __init__(self, localname, remotename, module, nodes):
+        self.localname = localname
+        self.remotename = remotename
+        self.module = module
+        self.nodes = nodes
+
+    def __getstate__(self):
+        return (self.localname, self.remotename, self.module.__name__, 
+                self.nodes)
+
+    def __setstate__(self, data):
+        (self.localname, self.remotename, module, self.nodes) = data
+        self.module = __import__(module, globals(), {}, [''])
+
+class ImportCheck(Check):
+    '''
+Get 'from module import *' names hauled into the file and modules.
+Figure out which names come from 'import name'.
+    '''
+
+    importError = Warning('Report/ignore imports that may fail',
+                          'Error trying to import %s: %s')
+    duplicateImport = Warning('Report/ignore duplicate imports',
+                              'Import of "%s" is duplicate%s')
+    shadowImport = Warning('Report imports which shadow names from '
+                           'other imports',
+                           'Import of "%s" duplicates import from '
+                           'module %s at %d')
+
+    def check(self, file, checker):
+        def try_import(name, node):
+            try:
+                return __import__(name, globals(), {}, [''])
+            except ImportError, detail:
+                file.warning(node, ImportCheck.importError, name, str(detail))
+            except Exception, detail:
+                file.warning(node, ImportCheck.importError, name, str(detail))
+            return None
+
+        def add_import(node, local, remote, module):
+            scopes = util.enclosing_scopes(file.scopes, node)
+            for scope in scopes:
+                try:
+                    ref = scope.imports[local]
+                    if not util.try_if_exclusive(ref.nodes, node):
+                        if ref.module == module:
+                            if scope == scopes[0]:
+                                extra = " in current scope"
+                            else:
+                                extra = " of import in parent scope %s" % scope
+                            file.warning(node, ImportCheck.duplicateImport,
+                                         local, extra)
+                        else:
+                            file.warning(node, ImportCheck.shadowImport,
+                                         local,
+                                         ref.module.__name__,
+                                         ref.nodes.lineno)
+                except KeyError:
+                    pass
+            scopes[0].imports[local] = ModuleReference(local, remote,
+                                                       module, node)
+            checker.check_module(module)
+            
+        class FromImportVisitor:
+
+            def visitFrom(self, node):
+                m = try_import(node.modname, node)
+                if m:
+                    for module_name, local_name in node.names:
+                        if module_name == '*':
+                            for name in dir(m):
+                                if not name.startswith('_'):
+                                   add_import(node, name, name, m)
+                        else:
+                            add_import(node, local_name or module_name,
+                                       module_name, m)
+
+            def visitImport(self, node):
+                for module, name in node.names:
+                    m = try_import(module, node)
+                    if m:
+                        add_import(node, name or module, None, m)
+
+
+        if file.root_scope:
+            walk(file.root_scope.node, FromImportVisitor())

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/NOTES.txt
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/NOTES.txt b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/NOTES.txt
new file mode 100644
index 0000000..95bcb7b
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/NOTES.txt
@@ -0,0 +1,131 @@
+This is a re-write of pychecker using traditional parse tree
+techniques, rather than the bytecode.
+
+There are some other design changes, related to Warning objects and
+Option handling.  In general, pychecker2 tries to distribute checks to
+separate classes.  These classes are more self-contained: they hold
+onto the option variables and define the Warning objects they support.
+
+ToDo:
+        All missing stuff
+        Always returning None
+        It is illegal to delete a name from the local namespace if it occurs
+            as a free variable in a nested block.
+        More path analysis
+            used before set for if/else try/except
+        Warn about unpacking args:
+             def f(a, (b, c)): pass
+
+Items still missing:
+        Error suppression (errors may be suppressed globally)
+
+        Detail of exception is an exception
+        Local used after deleted, already deleted, deleted before set
+        Not calling base class __init__
+        Using return value which is always None
+        Wrong # of args on function (including ctor)
+        Function arguments, kwargs
+        Abstract methods
+        exec may use locals/globals
+        import x with from x import
+
+        Modifying a default parameter
+        Tuple access to list list[1, 2]
+        List .append() takes one argument
+        Return None from __getattr__
+        string iteration
+        Inconsistent return type
+        Object has no attr
+        Method read as attribute, but not called:
+        Function always returns None (use empty return)
+        Unpack wrong size
+        Unpack wrong type
+
+        Exec warnings
+        Security warning: input()
+
+        Module imports itself
+        Complexity
+        Doc strings
+        New python features:
+             slots
+             properties
+             integer division
+        Warning for string raising
+
+Bugs:
+        More member not used
+        Speed
+        Is __file__ a builtin?
+
+        Aliases:
+            class C:
+                  def f(a, b): pass
+                  def g(a, b): pass
+                  h = f
+                  h = g			# redef of h, not caught now
+
+        foo = 1
+        del foo	                        # should not be unused
+
+        from __future__ import produces unused warnings
+        import of readline has side effect on input/raw_input, and should be
+           marked as used
+
+Important stuff:
+
+If you want to add new checks, there are some parts to be aware of:
+
+        File
+                A stupid data structure to hold everything we know about 
+                a file to be checked.
+
+                Members:
+                   name
+                        The file name.
+
+                   parseTree
+                        The root of the Abstract Syntax Tree returned from
+                        compiler.parseFile.  Will be None if the file
+                        won't even parse.
+
+                   scopes
+                        A dictionary of { node, scope } computed with
+                        from compiler.symbols. For convenience, scopes
+                        also refer back to the node and to the
+                        enclosing parent scope (node and parent,
+                        respectively).
+
+                    root_scope
+                        Convience for scopes[parseTree]
+
+        Check
+                Basic step for checking a file.  Usually contributes
+                Warnings or additional information to File.  New checks
+                will subclass this, and be added to the chain of checks
+                given in main().
+
+        Warning
+                A description of a warning emitted by pychecker.
+
+        CheckList
+                Contains "global" check information: cached module
+                data and the list of Check objects.
+
+        Command line options are pulled from each check.
+        A Warning is also turned into a boolean-style command line option.
+
+To add a new check, write a class (e.g., CompareCheck) that subclasses the
+Check class.  In its check method if you need to visit nodes of a particular
+type, write a Visitor class (subclass of BaseVisitor) which has a
+visit<Node> method, where <Node> is the name of a type of node to visit.
+See 
+
+    http://www.python.org/~jeremy/compiler/module-compiler.ast.html
+
+for the types of the nodes or print file.parseTree to see what classes all
+the nodes are.  See the OpChecks.CompareCheck class for an example of a
+check that visits all Compare nodes and the OpChecksExceptCheck class for an
+example that visits all TryExcept nodes.
+
+New checks should have unit tests in utest/.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/OpChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/OpChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/OpChecks.py
new file mode 100644
index 0000000..c99d5a3
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/OpChecks.py
@@ -0,0 +1,68 @@
+from pychecker2.Check import Check
+from pychecker2.Warning import Warning
+from pychecker2.util import BaseVisitor
+
+import compiler
+
+
+class OpCheck(Check):
+
+    operator = Warning(
+        "Check for (++) and (--) which are legal, but not useful",
+        "Operator (%s) doesn't exist, statement has no effect"
+        )
+    operatorPlus = Warning(
+        'Check for unary +',
+        "Operator (+) normally has no effect"
+        )
+
+    def check(self, file, unused_checklist):
+        class OpVisitor:
+            def visitUnaryAdd(s, n):
+                if n.getChildren()[0].__class__ == compiler.ast.UnaryAdd:
+                    file.warning(n, self.operator, '++')
+                else:
+                    file.warning(n, self.operatorPlus)
+
+            def visitUnarySub(s, n):
+                if n.getChildren()[0].__class__ == compiler.ast.UnarySub:
+                    file.warning(n, self.operator, '--')
+        if file.parseTree:        
+            compiler.walk(file.parseTree, OpVisitor())
+
+class ExceptCheck(Check):
+    emptyExcept = Warning('Warn about "except:"',
+                          'Empty except clauses can hide unexpected errors')
+    
+    def check(self, file, unused_checklist):
+        class ExceptVisitor(BaseVisitor):
+            def visitTryExcept(s, node):
+                for exc, det, code in node.handlers:
+                    if exc is None:
+                        file.warning(code.nodes[0], self.emptyExcept)
+                s.visitChildren(node)
+        if file.parseTree:
+            compiler.walk(file.parseTree, ExceptVisitor())
+
+class CompareCheck(Check):
+    useIs = Warning('warn about "== None"',
+                    'use "is" when comparing with None')
+
+    def check(self, file, unused_checklist):
+        def checkEqualNone(node, expr, op):
+            if (op == '==' and 
+                expr.__class__ == compiler.ast.Name and
+                expr.name == "None"):
+                file.warning(node, self.useIs)
+
+        class CompareVisitor(BaseVisitor):
+            def visitCompare(s, node):
+                children = node.getChildren()
+                for i in range(0, len(children) - 1, 2):
+                    left, op = children[i:i+2]
+                    checkEqualNone(node, left, op)
+                op, right = children[-2:]
+                checkEqualNone(node, right, op)
+
+        if file.parseTree:
+            compiler.walk(file.parseTree, CompareVisitor())

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Options.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Options.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Options.py
new file mode 100644
index 0000000..b64f9a9
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Options.py
@@ -0,0 +1,106 @@
+class Error(Exception): pass
+
+class Opt:
+
+    def __init__(self, object, longName, description, default):
+        self.object = object
+        self.longName = longName
+        self.description = description
+        setattr(object, longName, default)
+        self.default = default
+        
+    def set_value(self, value):
+        setattr(self.object, self.longName, value)
+
+    def get_value(self):
+        return getattr(self.object, self.longName)
+
+    def get_description(self):
+        return self.description
+
+    def is_boolean(self):
+        return None
+    
+    def reset(self):
+        setattr(self.object, self.longName, self.default)
+
+class BoolOpt(Opt):
+
+    def __init__(self, object, longName, description, default = None):
+        Opt.__init__(self, object, longName, description, default)
+
+    def set_value(self, unused):
+        setattr(self.object, self.longName, not self.get_value())
+        
+    def is_boolean(self):
+        return 1
+
+
+MAJOR = 'Major'
+ERROR = 'Error'
+MISC = 'Miscellaneous'
+Categories = [MAJOR, ERROR, MISC]
+
+class Options:
+
+    def __init__(self):
+        self.options = {}
+        for c in Categories:
+            self.options[c] = []
+        self.add(BoolOpt(self, 'verbose', 'turn on verbose messages'), MISC)
+        self.add(BoolOpt(self, 'incremental', 'print warnings as they are created'), MISC)
+        self.add(BoolOpt(self, 'profile', 'print a profile of pychecker', 0), MISC)
+
+    def add(self, option, category=ERROR):
+        self.options[category].append(option)
+        
+    def process_options(self, args):
+        import getopt
+        try:
+            longopts = {}
+            for opts in self.options.values():
+                for opt in opts:
+                    opt.reset()
+                    optname = opt.longName
+                    if opt.is_boolean() and opt.get_value():
+                        optname = "no-" + opt.longName
+                    longopts[optname] = opt
+            specs = []
+            for k, v in longopts.items():
+                if not v.is_boolean():
+                    k += '='
+                specs.append(k)
+            opts, args = getopt.getopt(args, '', specs)
+        except getopt.GetoptError, detail:
+            raise Error(detail)
+        
+        for opt, arg in opts:
+            longopts[opt[2:]].set_value(arg)
+
+        from pychecker2.File import File
+        return [ File(f) for f in args ]
+
+    def usage(self, argv0, stream):
+        indent = " "
+        over = 20
+        print >> stream, "Usage:"
+        print >> stream, \
+              "%s%s [options] [--] file1.py file2.py ..." % (indent, argv0)
+        print >> stream, "available options:"
+        for c in Categories:
+            if not self.options[c]:
+                continue
+            print >> stream
+            print >> stream, "%s:" % c
+            opts = self.options[c]
+            opts.sort(lambda x, y: cmp(x.longName, y.longName))
+            for opt in opts:
+                name = opt.longName
+                if opt.is_boolean() and opt.get_value():
+                        name = "no-" + name
+                print >> stream, "%s--%*s %s" % (
+                    indent, -over, name, opt.get_description())
+                if not opt.is_boolean():
+                    print >> stream, "%s  %*s %s" % (
+                        indent, -over, '', opt.get_value())
+            

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ParseChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ParseChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ParseChecks.py
new file mode 100644
index 0000000..9c99733
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ParseChecks.py
@@ -0,0 +1,84 @@
+from pychecker2.Check import Check
+from pychecker2.Warning import Warning
+from pychecker2.Options import BoolOpt
+from pychecker2 import symbols
+
+from compiler import parseFile, walk
+import parser
+
+def _parent_link(node):
+    for c in node.getChildNodes():
+        c.parent = node
+        _parent_link(c)
+
+class ParseCheck(Check):
+
+    syntaxErrors = Warning('Report/ignore syntax errors',
+                           'Unable to parse: %s')
+
+    def __init__(self):
+        self.main = None
+    
+    def get_options(self, options):
+        desc = 'Ignore module-level code protected by __name__ == "__main__"'
+        options.add(BoolOpt(self, 'main', desc, 1))
+    
+    def check(self, file, unused_checker):
+        try:
+            file.parseTree = parseFile(file.name)
+            # link each node to it's parent
+            _parent_link(file.parseTree)
+            file.parseTree.parent = None
+        except parser.ParserError, detail:
+            file.warning(1, self.syntaxErrors, detail.args[0])
+        except IOError, detail:
+            file.warning(0, self.syntaxErrors, detail.strerror)
+        if not file.parseTree:
+            return
+
+        if not self.main:
+            # remove __name__ == '__main__' code from module-level
+            for n in file.parseTree.node.nodes:
+                try:
+                    test, code = n.tests[0]
+                    comparison, value = test.ops[0]
+                    if comparison == '==':
+                        try:
+                            if test.expr.name == '__name__' and \
+                               value.value == '__main__':
+                                file.parseTree.node.nodes.remove(n)
+                                break
+                        except AttributeError:
+                            if test.expr.value == '__main__' and \
+                               value.name == '__name__':
+                                file.parseTree.node.nodes.remove(n)
+                                break
+                except (AttributeError, IndexError):
+                    pass
+
+        file.scopes = walk(file.parseTree, symbols.SymbolVisitor()).scopes
+        file.root_scope = file.scopes[file.parseTree]
+
+        # add starting lineno into scopes, since they don't have it
+        for k, v in file.scopes.items():
+            v.lineno = k.lineno
+
+        # define the root of the scope tree (global scope, within
+        # the module)
+        file.root_scope.lineno = 1
+
+        # create a mapping from scopes back to the nodes which made 'em
+        for node, scope in file.scopes.items():
+            scope.node = node
+
+        # create a mapping from each scope back to it's enclosing scope
+        for s in file.scopes.values():
+            for c in s.get_children():
+                c.parent = s
+        file.root_scope.parent = None
+
+        # initialize the mapping of imported names to modules
+        for s in file.scopes.values():
+            s.imports = {}
+
+            

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReachableChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReachableChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReachableChecks.py
new file mode 100644
index 0000000..7e506cb
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReachableChecks.py
@@ -0,0 +1,91 @@
+from pychecker2.Check import Check
+from pychecker2.util import BaseVisitor
+from pychecker2.Warning import Warning
+
+from compiler import ast, walk
+
+class ReachableCheck(Check):
+
+    unreachable = Warning('Report unreachable code', 'Line is unreachable')
+
+    implicitReturn = \
+       Warning('Report implicit return in a function with explicit returns',
+               'Function %s uses both implicit and explicit returns')
+
+    def check(self, file, unused_checker):
+        class ReturnsVisitor(BaseVisitor):
+            def __init__(s):
+                s.always_returns = 0    #  icky: result value by side-effect
+                s.has_returns = 0
+
+            def check_returns(s, node):
+                s.always_returns = 0                
+                s.visit(node)
+                return s.always_returns
+                
+            def alternatives_with_else(s, nodes, else_):
+                for n in nodes:
+                    if not s.check_returns(n):
+                        return
+                s.always_returns = 0
+                if else_:
+                    s.visit(else_)
+
+            def visitAssert(s, node):
+                if isinstance(node.test, ast.Const):
+                    s.always_returns = not node.test.value
+                if isinstance(node.test, ast.Name):
+                    if node.test.name == 'None':
+                        s.always_returns = 1
+
+            def visitReturn(s, node):
+                s.always_returns = 1
+                if not isinstance(node.value, ast.Const) or \
+                   node.value.value is not None:
+                    s.has_returns = 1
+                
+            def visitRaise(s, unused_node):
+                s.always_returns = 1
+
+            def visitTryExcept(s, node):
+                # if body always returns, else code is unreachable
+                if s.check_returns(node.body) and node.else_:
+                    file.warning(node.else_.nodes[0], self.unreachable)
+                s.always_returns = 0
+                # no matter what happens in the try clause, it might
+                # cause an exception, so check the handlers and else
+                # conditions all return
+                handlers = [code for exc, detail, code in node.handlers]
+                s.alternatives_with_else(handlers, node.else_ or node.body)
+
+            def visitIf(s, node):
+                code = [code for cond, code in node.tests]
+                s.alternatives_with_else(code, node.else_)
+                    
+            def visitStmt(s, node):
+                for n in range(len(node.nodes) - 1):
+                    if s.check_returns(node.nodes[n]):
+                        file.warning(node.nodes[n + 1], self.unreachable)
+                        break
+                else:
+                    if node.nodes and \
+                       not s.check_returns(node.nodes[-1]) and \
+                       isinstance(node.parent, ast.Function) and \
+                       s.has_returns:
+                        file.warning(node.nodes[-1], self.implicitReturn,
+                                     node.parent.name)
+                
+            def visitFunction(s, node):
+                pass
+            visitClass = visitFunction
+
+            def visitWhile(s, unused):
+                # FIXME: while's may never execute and not return
+                s.always_returns = 0
+
+            visitFor = visitWhile
+
+        for scope in file.scopes.values():
+            if isinstance(scope.node, ast.Function):
+                walk(scope.node.code, ReturnsVisitor())
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReturnChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReturnChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReturnChecks.py
new file mode 100644
index 0000000..494d6dc
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ReturnChecks.py
@@ -0,0 +1,43 @@
+from pychecker2.Check import Check
+from pychecker2.Check import Warning
+from pychecker2.util import BaseVisitor, type_filter
+from pychecker2 import symbols
+
+from compiler import ast, walk
+
+class Returns(BaseVisitor):
+
+    def __init__(self):
+        self.result = []
+
+    def visitReturn(self, node):
+        self.result.append(node)
+
+    # Don't descend into other scopes
+    def visitFunction(self, node): pass
+    visitClass = visitFunction
+    visitLambda = visitFunction
+
+def _is_implicit(node):
+    if isinstance(node, ast.Const) and node.value is None:
+        return 1
+    return None
+
+class MixedReturnCheck(Check):
+
+    mixedReturns = \
+        Warning('Report functions using "return" and "return value"',
+                'Function %s uses both "return" and "return value"')
+
+    def check(self, file, unused_checker):
+        for scope in type_filter(file.scopes.values(), symbols.FunctionScope):
+            returns = walk(scope.node.code, Returns()).result
+            empty, value = [], []
+            for node in returns:
+                if _is_implicit(node.value):
+                    empty.append(node)
+                else:
+                    value.append(node)
+            if len(empty) > 0 and len(value) > 0:
+                file.warning(empty[0], self.mixedReturns, scope.name)
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ScopeChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ScopeChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ScopeChecks.py
new file mode 100644
index 0000000..5f5d19d
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/ScopeChecks.py
@@ -0,0 +1,28 @@
+
+from pychecker2.Check import Check
+from pychecker2.Warning import Warning
+from pychecker2 import util
+
+from compiler.ast import *
+
+class RedefineCheck(Check):
+    redefinedScope = Warning('Report redefined scopes',
+                             'Scope (%s) is redefined at line %d')
+
+    def check(self, file, unused_checker):
+        names = {}                      # map name, parent to this scope
+        for node, scope in file.scopes.items():
+            if hasattr(node, 'name'):	# classes, functions
+                key = (scope.parent, node.name)
+                if names.has_key(key):
+                    # oops, another scope has the same name and parent
+                    first = node
+                    second = names[key]
+                    # but don't warn if the parent node is the same If or Try
+                    if util.try_if_exclusive(first, second):
+                        continue
+                    if first.lineno > second.lineno:
+                        second, first = first, second
+                    file.warning(first, self.redefinedScope,
+                                 first.name, second.lineno)
+                names[key] = node

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/TestSupport.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/TestSupport.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/TestSupport.py
new file mode 100644
index 0000000..cc03a5e
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/TestSupport.py
@@ -0,0 +1,57 @@
+from pychecker2 import main
+from pychecker2 import Options
+
+import unittest
+
+class WarningTester(unittest.TestCase):
+    def __init__(self, arg):
+        unittest.TestCase.__init__(self, arg)
+        self.options = Options.Options()
+        self.checklist = main.create_checklist(self.options)
+        self.argv = []
+
+    def check_warning(self, w, expected_line, expected_type, *expected_args):
+        warn_line, warn_type, warn_args = w
+        try:
+            self.assertEqual(warn_type, expected_type)
+            self.assertEqual(warn_line, expected_line)
+            self.assertEqual(len(warn_args), len(expected_args))
+            for i in range(len(expected_args)):
+                self.assertEqual(warn_args[i], expected_args[i])
+        except AssertionError:          # help w/debugging
+            print warn_line, warn_type, warn_args
+            print expected_line, expected_type, expected_args
+            raise
+
+    def check_file(self, data):
+        import tempfile, os
+        fname = tempfile.mktemp()
+        fp = open(fname, 'wb')
+        try:
+            fp.write(data)
+            fp.close()
+            f, = self.options.process_options(self.argv + [fname])
+            self.checklist.check_file(f)
+        finally:
+            fp.close()
+            os.unlink(fname)
+        return f
+
+    def warning_file(self, f, line, warning, *args):
+        assert len(f.warnings) == 1, "Not just one warning:" + `f.warnings`
+        self.check_warning(f.warnings[0], line, warning, *args)
+
+    def warning(self, test, line, warning, *args):
+        test += '\n'
+        f = self.check_file(test)
+        self.warning_file(f, line, warning, *args)
+
+    def silent(self, test):
+        f = self.check_file(test)
+        if f.warnings:
+            print f.warnings
+        self.assertEqual(len(f.warnings), 0)
+
+    def setUp(self):
+        self.argv = []
+        

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/VariableChecks.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/VariableChecks.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/VariableChecks.py
new file mode 100644
index 0000000..debdd17
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/VariableChecks.py
@@ -0,0 +1,354 @@
+from pychecker2.Check import Check
+from pychecker2.Options import Opt, BoolOpt
+from pychecker2.Warning import Warning
+from pychecker2.util import *
+from pychecker2 import symbols
+
+from compiler import ast, walk
+
+def _is_method(scope):
+    return scope.__class__ is symbols.FunctionScope and \
+           scope.parent.__class__ is symbols.ClassScope
+
+def _is_self(scope, name):
+    return _is_method(scope) and name in scope.node.argnames[:1]
+
+def is_arg_and_defaulted_to_same_name(name, scope):
+    if isinstance(scope, symbols.FunctionScope):
+        if name in scope.node.argnames and scope.node.defaults:
+            # compute default args
+            args = scope.node.argnames[:]
+            # knock off kwargs
+            if scope.node.kwargs:
+                args = args[:-1]
+            # knock off varags 
+            if scope.node.varargs:
+                args = args[:-1]
+            # take the last args as the defaults
+            args = args[-len(scope.node.defaults):]
+            try:
+                # get the corresponding default arg value
+                default = scope.node.defaults[args.index(name)]
+                # must be a Name node of the same name
+                if isinstance(default, ast.Name) and \
+                   default.name == name:
+                    return 1
+            except ValueError:
+                pass
+    return None
+
+
+class ShadowCheck(Check):
+    """Use symbol information to check that no scope defines a name
+    already known to a parent scope"""
+
+    defineNone = Warning('Report any redefinition of None',
+                         'Do not redefine None')
+    shadowBuiltins = Warning('Report names that shadow builtins',
+                            'Identifier (%s) shadows builtin', 0)
+    shadowIdentifier = Warning('Report names already defined in outer scopes',
+                               'Identifier (%s) shadows definition in scope %s')
+    def check(self, file, unused_checker):
+        # warn if any name defined in a scope is defined in a parent scope
+        # or even the builtins
+        for node, scope in file.not_class_scopes():
+            for name in scope.defs:
+                if name == 'None':
+                    file.warning(scope.defs[name], self.defineNone)
+                    continue
+                if name in scope.globals:
+                    continue
+                if is_arg_and_defaulted_to_same_name(name, scope):
+                    continue
+                if _is_self(scope, name):
+                    continue
+                if __builtins__.has_key(name):
+                    file.warning(scope.defs[name], self.shadowBuiltins, name)
+                for p in parents(scope):
+                    if p.defs.has_key(name) and \
+                       not isinstance(p, symbols.ClassScope):
+                        file.warning(scope.defs[name], \
+                                     self.shadowIdentifier, name, `p`)
+
+def _str_value(s):
+    if type(s) == type(''):
+        return eval(s)
+    return s
+
+
+def _empty_function(stmts):
+    if not stmts:
+        return 1
+    stmt = stmts[0]
+    # functions which only raise exceptions 
+    if isinstance(stmt, ast.Raise):
+        return 1
+    # functions which do nothing 
+    if len(stmts) == 1 and isinstance(stmt, ast.Pass):
+        return 1
+    # functions which just return a constant 
+    if len(stmts) == 1 and \
+       isinstance(stmt, ast.Return) and isinstance(stmt.value, ast.Const):
+        return 1
+    # functions which only assert falsehood 
+    if isinstance(stmt, ast.Assert):
+        if (isinstance(stmt.test, ast.Const) and not stmt.test.value) or \
+            (isinstance(stmt.test, ast.Name) and stmt.test.name == 'None'):
+            return 1
+    return 0
+
+class UnusedCheck(Check):
+    """Use symbol information to check that no scope defines a name
+    not used in this or any child scope"""
+
+    unused = Warning('Report names not used', 'Identifier (%s) not used')
+
+    def __init__(self):
+        self.reportUnusedSelf = None
+        self.unusedPrefixes = None
+
+    def get_options(self, options):
+        desc = 'Ignore unused identifiers that start with these values'
+        default = ['unused', 'empty', 'dummy',
+                   '__pychecker__', '__all__', '__version__', 'ignored']
+        options.add(Opt(self, 'unusedPrefixes', desc, default))
+        
+        desc = 'Ignore unused method "self" parameter'
+        options.add(BoolOpt(self, 'reportUnusedSelf', desc))
+
+    def check(self, file, unused_checker):
+        self.unusedPrefixes = _str_value(self.unusedPrefixes)
+
+        def used(name, parent_scope):
+            if parent_scope.uses.has_key(name):
+                return 1
+            for c in parent_scope.get_children():
+                if used(name, c):
+                    return 1
+            return 0
+
+        for nodes, scope in file.not_class_scopes():
+            if isinstance(nodes, ast.Function):
+                if _empty_function(nodes.code.nodes):
+                    continue
+            
+            # ensure that every defined variable is used in some scope
+            for var in scope.defs:
+                # ignore '_'... just because
+                if var == '_':
+                    continue
+
+                # check for method self
+                if not self.reportUnusedSelf and _is_self(scope, var):
+                    continue
+
+                # ignore names in the root scope which are not imported:
+                # class defs, function defs, variables, etc, unless
+                # they start with '_'
+                if scope == file.root_scope:
+                    if not scope.imports.has_key(var):
+                        if not var.startswith('_'):
+                            continue
+
+                for prefix in self.unusedPrefixes:
+                    if var.startswith(prefix):
+                        break
+                else:
+                    if not used(var, scope) and not scope.globals.has_key(var):
+                        file.warning(scope.defs[var], self.unused, var)
+
+def _importedName(scope, name):
+    if scope.imports.has_key(name):
+        return 1
+    if scope.parent:
+        return _importedName(scope.parent, name)
+    return None
+
+class UnknownCheck(Check):
+    """Use symbol information to check that no scope uses a name
+    not defined in a parent scope"""
+
+    unknown = Warning('Report names that are not defined',
+                      'Unknown identifier: %s')
+
+    builtins = {}
+    builtins.update(__builtins__)
+    builtins['__builtins__'] = __builtins__
+    builtins['WindowsError'] = getattr(__builtins__, 'WindowsError', None)
+
+    def check(self, file, unused_checker):
+
+        # if a name used is not found in the defined variables, complain
+        for scope in file.scopes.values():
+            unknown = dict_minus(scope.uses, scope.defs)
+            unknown = dict_minus(unknown, self.builtins)
+            for var in unknown:
+                for p in parents(scope):
+                    if p.defs.has_key(var):
+                        break
+                else:
+                    if not _importedName(scope, var):
+                        file.warning(scope.uses[var], self.unknown, var)
+
+def _first_arg_defaulted(function_node):
+    count = len(function_node.argnames)
+    if function_node.varargs:
+        count -= 1
+    if function_node.kwargs:
+        count -= 1
+    if count > 0 and len(function_node.defaults) == count:
+        return 1
+    return None
+
+class SelfCheck(Check):
+    'Check for simple self parameter'
+    
+    selfName = Warning('Report any methods whose first argument is not self',
+                       'First argument to method %s (%s) is not in %s')
+    selfDefault = Warning('Report a self parameter with a default value',
+                          'First argument to method %s (%s) has a default value')
+    
+    functionSelf = Warning('Report functions (not methods) with '
+                           'arguments named "self"',
+                           'Argument to function (%s) is "%s"')
+    
+    missingSelf = Warning('Report methods without "self"',
+                          'Method %s is missing self parameter')
+    
+    def get_options(self, options):
+        desc = 'Name of self parameter'
+        default = ["self", "this", "s"]
+        options.add(Opt(self, 'selfNames', desc, default))
+
+        desc = 'Suspicious self parameters'
+        self.selfSuspicious = ["self"]
+        options.add(Opt(self, 'selfSuspicious', desc, self.selfSuspicious))
+
+    def check(self, file, unused_checker):
+        self.selfNames      = _str_value(self.selfNames)
+        self.selfSuspicious = _str_value(self.selfSuspicious)
+
+        for node, scope in file.function_scopes():
+            args = node.argnames
+            name = getattr(scope.node, 'name', 'lambda')
+            if _is_method(scope):
+                if not args:
+                    file.warning(scope.node, self.missingSelf, name)
+                else:
+                    if args[0] not in self.selfNames:
+                        file.warning(scope.node, self.selfName,
+                                     name, args[0], `self.selfNames`)
+                    if _first_arg_defaulted(scope.node):
+                        file.warning(scope.node, self.selfDefault,
+                                     name, args[0])
+            else:
+                for arg in args:
+                    if arg in self.selfSuspicious:
+                        file.warning(scope.defs[arg], self.functionSelf,
+                                     name, arg)
+
+                
+
+class UnpackCheck(Check):
+    'Mark all unpacked variables as used'
+
+    def __init__(self):
+        self.unpackedUsed = None
+
+    def get_options(self, options):
+        desc = 'Do not treat variables used in tuple assignment as used'
+        options.add(BoolOpt(self, 'unpackedUsed', desc, 1))
+
+    def check(self, file, unused_checker):
+        if not self.unpackedUsed:
+            return
+
+        class Visitor:
+            def visitAssTuple(self, node):
+                for c in node.getChildNodes():
+                    for n in parents(c):
+                        try:
+                            file.scopes[n].uses[c.name] = node
+                            break
+                        except (KeyError, AttributeError):
+                            pass
+            visitAssList = visitAssTuple
+
+        # local args unpacked on the `def' line are used, too
+        for scope_node, scope in file.function_scopes():
+            for arg in type_filter(scope_node.argnames, tuple):
+                for unpacked in ast.flatten(arg):
+                    scope.uses[unpacked] = scope.uses.get(unpacked, scope_node)
+
+        if file.root_scope:
+            walk(file.root_scope.node, Visitor())
+
+def intersect2(a, b):
+    return [i for i in a if i in b]
+
+def intersect(items):
+    result = items[0]
+    for item in items[1:]:
+        result = intersect2(result, item)
+    return result
+
+class UsedBeforeSetCheck(Check):
+
+    usedBeforeDefined = \
+          Warning('Report variables that may be used before they are defined',
+                  'The local %s may be used before defined')
+
+    def check(self, file, unused_checker):
+        class Visitor(BaseVisitor):
+            def __init__(self, defines = None, uses = None):
+                # list of vars defined
+                self.defines = []
+                # name->node vars used before defined                    
+                self.uses = {}
+                if defines is not None:
+                    self.defines = defines[:]
+                if uses is not None:
+                    self.uses = uses.copy()
+            def visitFunction(self, n):
+                self.defines.append(n.name)
+                
+            visitClass = visitFunction
+            visitAssName = visitFunction
+
+            def visitGlobal(self, node):
+                for name in node.names:
+                    self.defines.append(name)
+            
+            def visitListComp(self, n):
+                # visit qualifiers before expression
+                children = ast.flatten_nodes(n.quals) + [n.expr]
+                for c in children:
+                    self.visit(c)
+            
+            def visitName(self, n):
+                if n.name not in self.defines:
+                    self.uses[n.name] = self.uses.get(n.name, n)
+
+            def visitIf(self, n):
+                if not n.else_:
+                    return
+                visits = []
+                for test, code in n.tests:
+                    visits.append(walk(code, Visitor(self.defines, self.uses)))
+                visits.append(walk(n.else_, Visitor(self.defines, self.uses)))
+                # compute the intersection of defines
+                self.defines = intersect([v.defines for v in visits])
+                # compute the union of uses, perserving first occurances
+                union = {}
+                visits.reverse()
+                for v in visits:
+                    union.update(v.uses)
+                union.update(self.uses)
+                self.uses = union
+                        
+        for node, scope in file.function_scopes():
+            predefined = ast.flatten(scope.params) + scope.imports.keys()
+            visitor = walk(node.code, Visitor(predefined))
+            usedBefore = dict_intersect(visitor.uses, scope.defs)
+            for name, use_node in usedBefore.items():
+                file.warning(use_node, self.usedBeforeDefined, name)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Warning.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Warning.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Warning.py
new file mode 100644
index 0000000..be01283
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/Warning.py
@@ -0,0 +1,13 @@
+
+class Warning:
+
+    def __init__(self, description, message, value = 1):
+        self.message = message
+        self.description = description
+        self.value = value
+        
+    def __cmp__(self, other):
+        return cmp(self.message, other.message)
+
+    def __repr__(self):
+        return repr(self.message)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/__init__.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/__init__.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/__init__.py
new file mode 100644
index 0000000..e16c76d
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/__init__.py
@@ -0,0 +1 @@
+""

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/main.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/main.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/main.py
new file mode 100644
index 0000000..40b1a9e
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/main.py
@@ -0,0 +1,115 @@
+import sys
+from os.path import dirname, realpath
+sys.path.append(dirname(dirname(realpath(sys.argv[0]))))
+
+from pychecker2.Check import CheckList
+
+from pychecker2 import Options
+from pychecker2 import ParseChecks
+from pychecker2 import OpChecks
+from pychecker2 import VariableChecks
+from pychecker2 import ScopeChecks
+from pychecker2 import ImportChecks
+from pychecker2 import ClassChecks
+from pychecker2 import ReachableChecks
+from pychecker2 import ReturnChecks
+from pychecker2 import ConditionalChecks
+from pychecker2 import FormatStringChecks
+
+CACHE_FILE = '/tmp/t'
+
+def print_warnings(f, out):
+    if not f.warnings:
+        return 0
+    f.warnings.sort()
+    last_line = -1
+    last_msg = None
+    for line, warning, args in f.warnings:
+        if warning.value:
+            msg = warning.message % args
+            if msg != last_msg or line != last_line:
+                print >>out, \
+                      '%s:%s %s' % (f.name, line or '[unknown line]', msg)
+                last_msg, last_line = msg, line
+    if last_msg:
+        print >>out
+    return 1
+
+def create_checklist(options):
+
+    checks = [ ParseChecks.ParseCheck(),
+               OpChecks.OpCheck(),
+               OpChecks.ExceptCheck(),
+               OpChecks.CompareCheck(),
+               ReachableChecks.ReachableCheck(),
+               ConditionalChecks.ConstantCheck(),
+               ClassChecks.ReprCheck(),
+               ImportChecks.ImportCheck(),
+               FormatStringChecks.FormatStringCheck(),
+               VariableChecks.ShadowCheck(),
+               VariableChecks.UnpackCheck(),
+               VariableChecks.UnusedCheck(),
+               VariableChecks.UnknownCheck(),
+               VariableChecks.SelfCheck(),
+               VariableChecks.UsedBeforeSetCheck(),
+               ReturnChecks.MixedReturnCheck(),
+               ClassChecks.AttributeCheck(),
+               ClassChecks.SpecialCheck(),
+               ClassChecks.InitCheck(),
+               ScopeChecks.RedefineCheck(),
+               ]
+    for checker in checks:
+        checker.get_warnings(options)
+        checker.get_options(options)
+    return CheckList(checks)
+
+def main():
+    import cPickle
+    
+    options = Options.Options()
+    try:
+        checker = cPickle.load(open(CACHE_FILE, 'rb'))
+    except (EOFError, IOError):
+        checker = create_checklist(options)
+
+    try:
+        files = options.process_options(sys.argv[1:])
+    except Options.Error, detail:
+        print >> sys.stderr, "Error: %s" % detail
+        options.usage(sys.argv[0], sys.stderr)
+        return 1
+
+    for f in files:
+        checker.check_file(f)
+        if options.incremental and not options.profile:
+            print_warnings(f, sys.stdout)
+
+    result = 0
+    if not options.incremental and not options.profile:
+        files.sort()
+        for f in files:
+            result |=  print_warnings(f, sys.stdout)
+
+        if not result and options.verbose:
+            print >>sys.stdout, None
+
+    fp = open(CACHE_FILE, 'wb')
+    cPickle.dump(checker, fp, 1)
+    fp.close()
+
+    return result
+
+if __name__ == "__main__":
+    if '--profile' in sys.argv:
+        print 'profiling'
+        import hotshot.stats
+        import time
+        hs = hotshot.Profile('logfile.dat')
+        now = time.time()
+        hs.run('main()')
+        print 'total run time', time.time() - now
+        hs.close()
+        stats = hotshot.stats.load('logfile.dat')
+        stats.sort_stats('time', 'cum').print_stats(50)
+    else:
+        sys.exit(main())

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/check.sh
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/check.sh b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/check.sh
new file mode 100755
index 0000000..9d6e2ee
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/check.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+PYTHONPATH=$PYTHONPATH:.. pychecker --stdlib *.py
+echo ==============================================================
+scripts/pychecker2.sh $* *.py

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/clean.sh
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/clean.sh b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/clean.sh
new file mode 100755
index 0000000..f290884
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/clean.sh
@@ -0,0 +1,5 @@
+#! /bin/sh
+for i in `find . -type d -print`
+do
+    /bin/rm -f *.pyc *.pyo *~ 
+done

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/lib.sh
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/lib.sh b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/lib.sh
new file mode 100755
index 0000000..efde8fd
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/lib.sh
@@ -0,0 +1,2 @@
+#! /bin/sh
+scripts/pychecker2.sh --incremental --no-importError --no-unused --no-shadowIdentifier --no-shadowImport --no-emptyExcept --no-attributeInitialized /usr/local/lib/python2.2/*.py

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/pychecker2.sh
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/pychecker2.sh b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/pychecker2.sh
new file mode 100755
index 0000000..f830212
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/scripts/pychecker2.sh
@@ -0,0 +1,6 @@
+#! /bin/sh
+NAME=$0				# this script
+NAME=`dirname $NAME`		# trim scripts 
+NAME=$NAME/../..
+export PYTHONPATH=$PYTHONPATH:$NAME
+exec python2.2 $NAME/pychecker2/main.py $@

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/symbols.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/symbols.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/symbols.py
new file mode 100644
index 0000000..3f70e97
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/symbols.py
@@ -0,0 +1,372 @@
+#######################################################################
+#
+# THIS FILE IS __NOT__ under the pychecker copyright.
+#
+# The majority of this file is from the python2.2 distribution.
+# It is under the python2.2 copyright.
+#
+#######################################################################
+
+"""Module symbol-table generator"""
+
+from compiler import ast
+from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL, SC_UNKNOWN
+from compiler.misc import mangle
+import types
+
+import sys
+
+MANGLE_LEN = 256
+
+class Scope:
+    # XXX how much information do I need about each name?
+    def __init__(self, name, module, klass=None):
+        self.name = name
+        self.module = module
+        self.defs = {}
+        self.uses = {}
+        self.globals = {}
+        self.params = {}
+        self.frees = {}
+        self.cells = {}
+        self.children = []
+        # nested is true if the class could contain free variables,
+        # i.e. if it is nested within another function.
+        self.nested = None
+        self.generator = None
+        self.klass = None
+        if klass is not None:
+            for i in range(len(klass)):
+                if klass[i] != '_':
+                    self.klass = klass[i:]
+                    break
+
+    def __repr__(self):
+        return "<%s: %s>" % (self.__class__.__name__, self.name)
+
+    def mangle(self, name):
+        if self.klass is None:
+            return name
+        return mangle(name, self.klass)
+
+    def add_def(self, name, node):
+        self.defs[self.mangle(name)] = node
+
+    def add_use(self, name, node):
+        name = self.mangle(name)
+        self.uses[name] = self.uses.get(name, node)
+
+    def add_global(self, name, node):
+        name = self.mangle(name)
+        if self.uses.has_key(name) or self.defs.has_key(name):
+            pass # XXX warn about global following def/use
+        if self.params.has_key(name):
+            raise SyntaxError, "%s in %s is global and parameter" % \
+                  (name, self.name)
+        self.globals[name] = None
+        self.module.add_def(name, node)
+
+    def add_param(self, name, node):
+        name = self.mangle(name)
+        self.defs[name] = node
+        self.params[name] = node
+
+    def get_names(self):
+        d = {}
+        d.update(self.defs)
+        d.update(self.uses)
+        d.update(self.globals)
+        return d.keys()
+
+    def add_child(self, child):
+        self.children.append(child)
+
+    def get_children(self):
+        return self.children
+
+    def DEBUG(self):
+        print >> sys.stderr, self.name, self.nested and "nested" or ""
+        print >> sys.stderr, "\tglobals: ", self.globals
+        print >> sys.stderr, "\tcells: ", self.cells
+        print >> sys.stderr, "\tdefs: ", self.defs
+        print >> sys.stderr, "\tuses: ", self.uses
+        print >> sys.stderr, "\tfrees:", self.frees
+
+    def check_name(self, name):
+        """Return scope of name.
+
+        The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.
+        """
+        if self.globals.has_key(name):
+            return SC_GLOBAL
+        if self.cells.has_key(name):
+            return SC_CELL
+        if self.defs.has_key(name):
+            return SC_LOCAL
+        if self.nested and (self.frees.has_key(name) or
+                            self.uses.has_key(name)):
+            return SC_FREE
+        if self.nested:
+            return SC_UNKNOWN
+        else:
+            return SC_GLOBAL
+
+    def get_free_vars(self):
+        if not self.nested:
+            return {}
+        free = {}
+        free.update(self.frees)
+        for name in self.uses.keys():
+            if not (self.defs.has_key(name) or
+                    self.globals.has_key(name)):
+                free[name] = self.uses[name]
+        return free
+
+    def handle_children(self):
+        for child in self.children:
+            frees = child.get_free_vars()
+            globals = self.add_frees(frees)
+            for name, node in globals.items():
+                child.force_global(name, node)
+
+    def force_global(self, name, node):
+        """Force name to be global in scope.
+
+        Some child of the current node had a free reference to name.
+        When the child was processed, it was labelled a free
+        variable.  Now that all its enclosing scope have been
+        processed, the name is known to be a global or builtin.  So
+        walk back down the child chain and set the name to be global
+        rather than free.
+
+        Be careful to stop if a child does not think the name is
+        free.
+        """
+        self.globals[name] = node
+        if self.frees.has_key(name):
+            del self.frees[name]
+        for child in self.children:
+            if child.check_name(name) == SC_FREE:
+                child.force_global(name, node)
+
+    def add_frees(self, names):
+        """Process list of free vars from nested scope.
+
+        Returns a list of names that are either 1) declared global in the
+        parent or 2) undefined in a top-level parent.  In either case,
+        the nested scope should treat them as globals.
+        """
+        child_globals = {}
+        for name, node in names.items():
+            sc = self.check_name(name)
+            if self.nested:
+                if sc == SC_UNKNOWN or sc == SC_FREE \
+                   or isinstance(self, ClassScope):
+                    self.frees[name] = node
+                elif sc == SC_GLOBAL:
+                    child_globals[name] = node
+                elif isinstance(self, FunctionScope) and sc == SC_LOCAL:
+                    self.cells[name] = node
+                elif sc != SC_CELL:
+                    child_globals[name] = node
+            else:
+                if sc == SC_LOCAL:
+                    self.cells[name] = node
+                elif sc != SC_CELL:
+                    child_globals[name] = node
+        return child_globals
+
+    def get_cell_vars(self):
+        return self.cells.keys()
+
+class ModuleScope(Scope):
+    __super_init = Scope.__init__
+
+    def __init__(self):
+        self.__super_init("global", self)
+
+class FunctionScope(Scope):
+    pass
+
+class LambdaScope(FunctionScope):
+    __super_init = FunctionScope.__init__
+
+    __counter = 1
+
+    def __init__(self, module, klass=None):
+        i = self.__counter
+        self.__counter += 1
+        self.__super_init("lambda.%d" % i, module, klass)
+
+class ClassScope(Scope):
+    __super_init = Scope.__init__
+
+    def __init__(self, name, module):
+        self.__super_init(name, module, name)
+
+class SymbolVisitor:
+    def __init__(self):
+        self.scopes = {}
+        self.klass = None
+
+    # node that define new scopes
+    def visit(self, unused_node, *args):
+        "overwritten by compiler.walk"
+        pass
+
+    def visitModule(self, node):
+        scope = self.module = self.scopes[node] = ModuleScope()
+        self.visit(node.node, scope)
+
+    visitExpression = visitModule
+
+    def visitFunction(self, node, parent):
+        parent.add_def(node.name, node)
+        for n in node.defaults:
+            self.visit(n, parent)
+        scope = FunctionScope(node.name, self.module, self.klass)
+        if parent.nested or isinstance(parent, FunctionScope):
+            scope.nested = 1
+        self.scopes[node] = scope
+        self._do_args(scope, node.argnames, node)
+        self.visit(node.code, scope)
+        self.handle_free_vars(scope, parent)
+
+    def visitLambda(self, node, parent):
+        for n in node.defaults:
+            self.visit(n, parent)
+        scope = LambdaScope(self.module, self.klass)
+        if parent.nested or isinstance(parent, FunctionScope):
+            scope.nested = 1
+        self.scopes[node] = scope
+        self._do_args(scope, node.argnames, node)
+        self.visit(node.code, scope)
+        self.handle_free_vars(scope, parent)
+
+    def _do_args(self, scope, args, node):
+        for name in args:
+            if type(name) == types.TupleType:
+                self._do_args(scope, name, node)
+            else:
+                scope.add_param(name, node)
+
+    def handle_free_vars(self, scope, parent):
+        parent.add_child(scope)
+        scope.handle_children()
+
+    def visitClass(self, node, parent):
+        parent.add_def(node.name, node)
+        for n in node.bases:
+            self.visit(n, parent)
+        scope = ClassScope(node.name, self.module)
+        if parent.nested or isinstance(parent, FunctionScope):
+            scope.nested = 1
+        self.scopes[node] = scope
+        prev = self.klass
+        self.klass = node.name
+        self.visit(node.code, scope)
+        self.klass = prev
+        self.handle_free_vars(scope, parent)
+
+    # name can be a def or a use
+
+    # XXX a few calls and nodes expect a third "assign" arg that is
+    # true if the name is being used as an assignment.  only
+    # expressions contained within statements may have the assign arg.
+
+    def visitName(self, node, scope, assign=0):
+        if assign:
+            scope.add_def(node.name, node)
+        else:
+            scope.add_use(node.name, node)
+
+    # operations that bind new names
+
+    def visitFor(self, node, scope):
+        self.visit(node.assign, scope, 1)
+        self.visit(node.list, scope)
+        self.visit(node.body, scope)
+        if node.else_:
+            self.visit(node.else_, scope)
+
+    def visitFrom(self, node, scope):
+        for name, asname in node.names:
+            if name == "*":
+                continue
+            scope.add_def(asname or name, node)
+
+    def visitImport(self, node, scope):
+        for name, asname in node.names:
+            i = name.find(".")
+            if i > -1:
+                name = name[:i]
+            scope.add_def(asname or name, node)
+
+    def visitGlobal(self, node, scope):
+        for name in node.names:
+            scope.add_global(name, node)
+
+    def visitAssign(self, node, scope):
+        """Propagate assignment flag down to child nodes.
+
+        The Assign node doesn't itself contains the variables being
+        assigned to.  Instead, the children in node.nodes are visited
+        with the assign flag set to true.  When the names occur in
+        those nodes, they are marked as defs.
+
+        Some names that occur in an assignment target are not bound by
+        the assignment, e.g. a name occurring inside a slice.  The
+        visitor handles these nodes specially; they do not propagate
+        the assign flag to their children.
+        """
+        for n in node.nodes:
+            self.visit(n, scope, 1)
+        self.visit(node.expr, scope)
+
+    def visitAssName(self, node, scope, unused_assign=1):
+        scope.add_def(node.name, node)
+
+    def visitAssAttr(self, node, scope, unused_assign=0):
+        self.visit(node.expr, scope, 0)
+
+    def visitSubscript(self, node, scope, unused_assign=0):
+        self.visit(node.expr, scope, 0)
+        for n in node.subs:
+            self.visit(n, scope, 0)
+
+    def visitSlice(self, node, scope, unused_assign=0):
+        self.visit(node.expr, scope, 0)
+        if node.lower:
+            self.visit(node.lower, scope, 0)
+        if node.upper:
+            self.visit(node.upper, scope, 0)
+
+    def visitAugAssign(self, node, scope):
+        # If the LHS is a name, then this counts as assignment.
+        # Otherwise, it's just use.
+        self.visit(node.node, scope)
+        if isinstance(node.node, ast.Name):
+            self.visit(node.node, scope, 1) # XXX worry about this
+        self.visit(node.expr, scope)
+
+    # prune if statements if tests are false
+
+    _const_types = types.StringType, types.IntType, types.FloatType
+
+    def visitIf(self, node, scope):
+        for test, body in node.tests:
+            if isinstance(test, ast.Const):
+                if type(test.value) in self._const_types:
+                    if not test.value:
+                        continue
+            self.visit(test, scope)
+            self.visit(body, scope)
+        if node.else_:
+            self.visit(node.else_, scope)
+
+    # a yield statement signals a generator
+
+    def visitYield(self, node, scope):
+        scope.generator = 1
+        self.visit(node.value, scope)
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/test.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/test.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/test.py
new file mode 100644
index 0000000..945c583
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/test.py
@@ -0,0 +1,55 @@
+import os
+import sys
+import unittest
+import glob
+
+def test(modules, verbosity):
+    for m in modules:
+        s = unittest.defaultTestLoader.loadTestsFromName(m)
+        result = unittest.TextTestRunner(verbosity=verbosity).run(s)
+        if not result.wasSuccessful():
+            return 1
+    return 0
+
+
+def _modules(root):
+    modules = []
+    files = glob.glob(os.path.join(root, 'utest', '*.py'))
+    files.sort()
+    for fname in files:
+        fname = os.path.split(fname)[1] # remove path
+        module = 'pychecker2.utest.' + os.path.splitext(fname)[0]
+        if not module.endswith('_'):    # ignore __init__
+            modules.append(module)
+    return modules
+
+class Usage(Exception): pass
+
+def main(args):
+    import getopt
+    verbosity = 1
+    try:
+        opts, files = getopt.getopt(args, 'v')
+        for opt, arg in opts:
+            if opt == '-v':
+                verbosity += 1
+            else:
+                raise Usage('unknown option ' + opt)
+    except getopt.GetoptError, detail:
+        raise Usage(str(detail))
+
+    root = os.path.dirname(os.path.realpath(sys.argv[0]))
+    pychecker2 = os.path.split(root)[0]
+    sys.path.append(pychecker2)
+
+    return test(_modules(root), verbosity)
+        
+
+if __name__ == '__main__':
+    try:
+        sys.exit(main(sys.argv[1:]))
+    except Usage, error:
+        err = sys.stderr
+        print >>err, "Error: " + str(error)
+        print >>err, "Usage: %s [-v]" % sys.argv[0]
+        sys.exit(1)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/__init__.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/__init__.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/badparse.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/badparse.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/badparse.py
new file mode 100644
index 0000000..4b19a81
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/badparse.py
@@ -0,0 +1 @@
+===

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/class.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/class.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/class.py
new file mode 100644
index 0000000..1a2adb0
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/class.py
@@ -0,0 +1,152 @@
+import compiler
+import compiler                   as one
+import compiler.ast              
+import compiler.ast               as two
+from   compiler import ast       
+from   compiler import ast        as three
+from   compiler.ast import Const 
+from   compiler.ast import Const  as four
+
+func = lambda x: x
+
+class D:
+    class B(compiler.ast.Const):
+        inherited2 = 1
+        def x(self):
+            self.inherited1 = 1
+
+class A(D.B):
+    def __init__(self):
+        self.x = 1                      # define x on A
+        self.w.q = 1
+
+    def f(s, self):                     # unusual self
+        print self
+        s.self = 1
+        s = 7
+
+    def x():                            # no self, redefine x on object
+        pass
+
+    def y(self):
+        self.a, self.b = (1, 2)         # define a, b
+
+    def _z(self):
+        print self._z                   # method
+        print self.x                    # assigned
+        print self.a                    # unpacked
+        print self.w                    # unknown
+        print self.inherited1           # known from B
+        print self.inherited2           # known from B
+        print self.value                # from compiler.ast.Const, fails
+        print self.goofy                # defined in class scope
+
+    goofy = x
+    
+class E(one.ast.Const):
+    def f(self):
+        print self.value
+
+class F(two.Const):
+    def f(self):
+        print self.value
+
+class H(three.Const):
+    def f(self):
+        print self.value
+
+class I(four):
+    def f(self):
+        print self.value
+
+class J(ast.Const):
+    def f(self):
+        print self.value
+
+class K(Const):
+    def f(self):
+        print self.value
+
+#
+# Various abusive imports, all under a non-global scope
+#
+
+def z(arg):
+    from xml.dom import minidom as md
+
+    class L(md.Node):
+        def f(self):
+            print arg, self.childNodes
+    print L()
+
+def zz(arg):
+    from xml import dom as d
+
+    class L(d.minidom.Node):
+        def f(self):
+            print arg, self.childNodes  # should fail
+    print L()
+
+def zzz(arg):
+    from xml.dom.minidom import Node as X
+
+    class L(X):
+        def f(self):
+            print arg, self.childNodes
+    print L()
+
+def zzzz(arg):
+    from tests import nested
+
+    class L(nested.N1.N2):
+        def f(self):
+            print self.x
+    print L(), arg
+
+class Base:
+   def f(self, x): pass
+class Derived(Base):
+   def f(self): pass
+
+class Node(compiler.ast.Node):
+    def getChildren(self, x):
+        return x
+
+class Node2(compiler.ast.Slice):
+    def __init__(self):
+        return self
+
+class BadSpecial:
+
+    def __del__(self):
+        return 0
+
+    def __cmp__(self, x):
+        return x
+
+    def __len__(self):
+        return 0
+
+    def __le__(self):
+        return 0
+
+    def __gt__(self, a, b):
+        return 0
+
+    def __ge__(self, a, b = None, c = None):
+        return 0
+
+    def __setattr__(self, a = None):
+        return 0
+
+    def __not_special__(self):
+        return 0
+    
+class Z1:
+    class Z2:
+        from xml.dom import minidom as md
+
+class Z3(Z1.Z2.md.Node):
+    def f(self):
+        print self.childNodes
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/except.py
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/except.py b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/except.py
new file mode 100644
index 0000000..0a64ca5
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/except.py
@@ -0,0 +1,11 @@
+
+try:
+    pass
+except AttributeError:
+    pass
+
+try:
+    pass
+except:
+    pass
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/incremental
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/incremental b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/incremental
new file mode 100644
index 0000000..370ecb0
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/incremental
@@ -0,0 +1,49 @@
+tests/badparse.py:1 Unable to parse: could not parse string
+
+tests/class.py:20 Method x defined at line 28 in class A redefined
+tests/class.py:21 Class A has no attribute w
+tests/class.py:28 Method x is missing self parameter
+tests/class.py:38 Class A has no attribute w
+
+tests/global.py:3 Unknown identifier: y
+
+tests/import.py:1 Identifier (bar) not used
+tests/import.py:3 Identifier (nifty) not used
+tests/import.py:7 Import of "join" is duplicate of import in parent scope <ModuleScope: global>
+tests/import.py:9 Unknown identifier: __all__
+tests/import.py:13 Error trying to import xYzZy: No module named xYzZy
+tests/import.py:14 Unknown identifier: z
+tests/import.py:17 Identifier (getopt) not used
+tests/import.py:17 Import of "getopt" is duplicate in current scope
+tests/import.py:18 Import of "join" duplicates import from module posixpath at 4
+tests/import.py:18 Import of "split" duplicates import from module posixpath at 4
+
+tests/op.py:2 Operator (++) doesn't exist, statement has no effect
+tests/op.py:4 Scope (g) is redefined at line 7
+tests/op.py:5 Operator (+) normally has no effect
+tests/op.py:8 Operator (--) doesn't exist, statement has no effect
+
+tests/self.py:9 First argument to method f (x) is not in ['self', 'this', 's']
+tests/self.py:14 Identifier (a) not used
+
+tests/shadow.py:2 Scope (f) is redefined at line 8
+tests/shadow.py:4 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:15 Identifier (a) not used
+tests/shadow.py:15 Identifier (b) not used
+tests/shadow.py:15 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:16 Identifier (f) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:17 Identifier (a) not used
+tests/shadow.py:17 Identifier (a) shadows definition in scope <FunctionScope: g>
+tests/shadow.py:17 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:18 Identifier (b) not used
+tests/shadow.py:18 Identifier (b) shadows definition in scope <FunctionScope: g>
+tests/shadow.py:19 Unknown identifier: c
+tests/shadow.py:19 Unknown identifier: d
+tests/shadow.py:22 Identifier (a) shadows definition in scope <ModuleScope: global>
+
+tests/unusedImport.py:1 Identifier (sys) not used
+
+tests/unused.py:6 Identifier (Test) not used
+
+tests/not_there.py:[unknown line] Unable to parse: [Errno 2] No such file or directory: 'tests/not_there.py'
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-importError
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-importError b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-importError
new file mode 100644
index 0000000..9289799
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-importError
@@ -0,0 +1,48 @@
+tests/badparse.py:1 Unable to parse: could not parse string
+
+tests/class.py:20 Method x defined at line 28 in class A redefined
+tests/class.py:21 Class A has no attribute w
+tests/class.py:28 Method x is missing self parameter
+tests/class.py:38 Class A has no attribute w
+
+tests/global.py:3 Unknown identifier: y
+
+tests/import.py:1 Identifier (bar) not used
+tests/import.py:3 Identifier (nifty) not used
+tests/import.py:7 Import of "join" is duplicate of import in parent scope <ModuleScope: global>
+tests/import.py:9 Unknown identifier: __all__
+tests/import.py:14 Unknown identifier: z
+tests/import.py:17 Identifier (getopt) not used
+tests/import.py:17 Import of "getopt" is duplicate in current scope
+tests/import.py:18 Import of "join" duplicates import from module posixpath at 4
+tests/import.py:18 Import of "split" duplicates import from module posixpath at 4
+
+tests/not_there.py:[unknown line] Unable to parse: [Errno 2] No such file or directory: 'tests/not_there.py'
+
+tests/op.py:2 Operator (++) doesn't exist, statement has no effect
+tests/op.py:4 Scope (g) is redefined at line 7
+tests/op.py:5 Operator (+) normally has no effect
+tests/op.py:8 Operator (--) doesn't exist, statement has no effect
+
+tests/self.py:9 First argument to method f (x) is not in ['self', 'this', 's']
+tests/self.py:14 Identifier (a) not used
+
+tests/shadow.py:2 Scope (f) is redefined at line 8
+tests/shadow.py:4 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:15 Identifier (a) not used
+tests/shadow.py:15 Identifier (b) not used
+tests/shadow.py:15 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:16 Identifier (f) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:17 Identifier (a) not used
+tests/shadow.py:17 Identifier (a) shadows definition in scope <FunctionScope: g>
+tests/shadow.py:17 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:18 Identifier (b) not used
+tests/shadow.py:18 Identifier (b) shadows definition in scope <FunctionScope: g>
+tests/shadow.py:19 Unknown identifier: c
+tests/shadow.py:19 Unknown identifier: d
+tests/shadow.py:22 Identifier (a) shadows definition in scope <ModuleScope: global>
+
+tests/unused.py:6 Identifier (Test) not used
+
+tests/unusedImport.py:1 Identifier (sys) not used
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/80e25b46/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-operator
----------------------------------------------------------------------
diff --git a/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-operator b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-operator
new file mode 100644
index 0000000..78fab6c
--- /dev/null
+++ b/tools/bin/pythonSrc/pychecker-0.8.18/pychecker2/tests/expected/no-operator
@@ -0,0 +1,47 @@
+tests/badparse.py:1 Unable to parse: could not parse string
+
+tests/class.py:20 Method x defined at line 28 in class A redefined
+tests/class.py:21 Class A has no attribute w
+tests/class.py:28 Method x is missing self parameter
+tests/class.py:38 Class A has no attribute w
+
+tests/global.py:3 Unknown identifier: y
+
+tests/import.py:1 Identifier (bar) not used
+tests/import.py:3 Identifier (nifty) not used
+tests/import.py:7 Import of "join" is duplicate of import in parent scope <ModuleScope: global>
+tests/import.py:9 Unknown identifier: __all__
+tests/import.py:13 Error trying to import xYzZy: No module named xYzZy
+tests/import.py:14 Unknown identifier: z
+tests/import.py:17 Identifier (getopt) not used
+tests/import.py:17 Import of "getopt" is duplicate in current scope
+tests/import.py:18 Import of "join" duplicates import from module posixpath at 4
+tests/import.py:18 Import of "split" duplicates import from module posixpath at 4
+
+tests/not_there.py:[unknown line] Unable to parse: [Errno 2] No such file or directory: 'tests/not_there.py'
+
+tests/op.py:4 Scope (g) is redefined at line 7
+tests/op.py:5 Operator (+) normally has no effect
+
+tests/self.py:9 First argument to method f (x) is not in ['self', 'this', 's']
+tests/self.py:14 Identifier (a) not used
+
+tests/shadow.py:2 Scope (f) is redefined at line 8
+tests/shadow.py:4 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:15 Identifier (a) not used
+tests/shadow.py:15 Identifier (b) not used
+tests/shadow.py:15 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:16 Identifier (f) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:17 Identifier (a) not used
+tests/shadow.py:17 Identifier (a) shadows definition in scope <FunctionScope: g>
+tests/shadow.py:17 Identifier (a) shadows definition in scope <ModuleScope: global>
+tests/shadow.py:18 Identifier (b) not used
+tests/shadow.py:18 Identifier (b) shadows definition in scope <FunctionScope: g>
+tests/shadow.py:19 Unknown identifier: c
+tests/shadow.py:19 Unknown identifier: d
+tests/shadow.py:22 Identifier (a) shadows definition in scope <ModuleScope: global>
+
+tests/unused.py:6 Identifier (Test) not used
+
+tests/unusedImport.py:1 Identifier (sys) not used
+



Mime
View raw message