code: def validate_rule(self, rulename: str, node: Rule) -> None:
      self.rulename = rulename
      self.visit(node)
      self.rulename = None
  
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 2 for calling the GrammarValidator obj's underlying member method code with example usage: obj.validate_rule(rulename, node) without return types