def set_active_grammars(self):
        try:
            self.active_global_grammars = utilities.filter_grammar_list(self.global_grammars, self.process_contexts)
        except __HOLE__:
            self.active_global_grammars = []
        self.active_local_grammars = {}
        self.active_global_grammars.sort(reverse=True)
        for app_pattern, grammar_list in self.local_grammars.items():
            active_list = utilities.filter_grammar_list(grammar_list, self.process_contexts)
            self.active_local_grammars[app_pattern] = active_list + self.active_global_grammars
            self.active_local_grammars[app_pattern].sort(reverse=True)
dataset/ETHPy150Open evfredericksen/pynacea/pynhost/pynhost/grammarhandler.py/GrammarHandler.set_active_grammars