code: def is_nonterminal(self, symbol: str) -> bool:
          
          nonterminal_productions = self.get_nonterminal_productions()
          return symbol in nonterminal_productions
docs: Determines whether an input symbol is a valid non-terminal in the grammar.