code: def validate_grammar(the_grammar: grammar.Grammar) -> None:
      for validator_cls in GrammarValidator.__subclasses__():
          validator = validator_cls(the_grammar)
          for rule_name, rule in the_grammar.rules.items():
              validator.validate_rule(rule_name, rule)
  
file_path: cpython/Tools/peg_generator/pegen/validator.py
imports: from typing import Optional
  from pegen import grammar
  from pegen.grammar import Alt, GrammarVisitor, Rhs, Rule
label_desc: Use image node_id 1 for calling a global function with example usage: validate_grammar(the_grammar) without return types