code: def is_terminal(self, symbol: str) -> bool:
          
          # We special-case 'lambda' here because it behaves weirdly in action sequences.
          return (symbol in self.global_name_mapping or
                  symbol in self.local_name_mapping or
                  'lambda' in symbol)
docs: This function will be called on nodes of a logical form tree, which are either non-terminal
          symbols that can be expanded or terminal symbols that must be leaf nodes.  Returns ``True``
          if the given symbol is a terminal symbol.