code: def print_nodes_recursively(
      self, node: Rule, prefix: str = "", istail: bool = True
  ) -> str:
      children = list(self.children(node))
      value = self.name(node)
  
      line = prefix + ("└──" if istail else "├──") + value + "\n"
      sufix = "   " if istail else "│  "
  
      if not children:
          return line
  
      *children, last = children
      for child in children:
          line += self.print_nodes_recursively(
              child, prefix + sufix, False
          )
      line += self.print_nodes_recursively(last, prefix + sufix, True)
  
      return line
  
file_path: cpython/Tools/peg_generator/pegen/grammar_visualizer.py
imports: import argparse
  import sys
  from typing import Any, Callable, Iterator
  from pegen.build import build_parser
  from pegen.grammar import Grammar, Rule
label_desc: Use image node_id 4 for calling the ASTGrammarPrinter obj's underlying member method code with example usage: obj.print_nodes_recursively(node, prefix, istail) and returns: line, line