def load_grammars_from_module(self, module):
        clsmembers = inspect.getmembers(sys.modules[module.__name__], inspect.isclass)
        for member in clsmembers:
            # screen for objects with grammarbase.GrammarBase ancestor
            class_hierarchy = inspect.getmro(member[1])
            if len(class_hierarchy) > 2 and class_hierarchy[-2] == grammarbase.GrammarBase:
                grammar = self.initialize_grammar(member[1])
                app_pattern = grammar.app_context
                if grammar.app_context != '':
                    app_pattern = re.compile(grammar.app_context)
                    try:
                        self.local_grammars[app_pattern].append(grammar)
                    except __HOLE__:
                        self.local_grammars[app_pattern] = [grammar]
                else:
                    self.global_grammars.append(grammar)
dataset/ETHPy150Open evfredericksen/pynacea/pynhost/pynhost/grammarhandler.py/GrammarHandler.load_grammars_from_module