def process(module=None):
    """cache out a dictionary of all Parsed and Parser classes, and create token classes"""
    if module:
        # User supplied a module object.
        if isinstance(module, types.ModuleType):
            module_dict = module.__dict__
#        elif isinstance(module, _INSTANCETYPE):
#            _items = [(k,getattr(module,k)) for k in dir(module)]
#            ldict = { }
#            for i in _items:
#                ldict[i[0]] = i[1]
        else:
            raise ValueError,"Expected a module"

    else:
        # No module given.  We might be able to get information from the caller.
        # Throw an exception and unwind the traceback to get the globals

        try:
            raise RuntimeError
        except RuntimeError:
            e,b,t = sys.exc_info()
            f = t.tb_frame
            f = f.f_back           # Walk out to our calling function
            module_dict = f.f_globals    # Grab its globals dictionary

    #_createTokenClasses(ldict, debug=verbose() )

    parserDict = {}
    parsedDict = {}
    tokensDict = {}

    # gather up all tokens, parsers, and parsed
    for name, obj in module_dict.iteritems():
        if isParserClass(obj):
            parserDict[name]=obj
            tokensDict.update( _getTokenPatterns(obj) )


        # find Parsers that are stored on Parsed classes as _parser
        elif isParsedClass(obj):
            parsedDict[name]=obj
            if hasattr(obj, '_parser'):
                if isParserClass(obj._parser):
                    tokensDict.update( _getTokenPatterns(obj._parser) )

    for token in tokensDict :
        pattern = tokensDict[token]
        parsedName = token
        parserName = token+"Parser"


        if verbose() :
            print (parserName, token, pattern) % "adding class %s for token %s of pattern r'%s'"

        class ThisTokenParser(TokenParser):
            """ Token Parser stub class """
        # set the Token Parser class attributes
        ThisTokenParser.__name__ = parserName
        #ThisTokenParser.__doc__ = "Parser for token %s=%r" % (token, pattern)
        ThisTokenParser.__module__ = __name__
        ThisTokenParser._pattern = pattern
        ThisTokenParser._type = token
        # add to the module
        module_dict[parserName] = ThisTokenParser
        parserDict[parserName] = ThisTokenParser

        if verbose() :
            print "adding class %s for token %s of pattern r'%s'" % (parsedName, token, pattern)

        class ThisToken(Token):
            """ Token stub class """
        # set the Token class attributes
        ThisToken.__name__ = parsedName
        # ThisToken.__doc__ = "Parser for token %s=%r" % (token, pattern)
        ThisToken.__module__ = __name__
        ThisToken._parser = ThisTokenParser
        # add to the module
        module_dict[parsedName] = ThisToken
        parsedDict[parsedName] = ThisToken


    Parser.classes = parserDict
    Parsed.classes = parsedDict
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/pymel/util/objectParser.py/process/swapped operands of `%`