code: def build_python_generator(
      grammar: Grammar,
      grammar_file: str,
      output_file: str,
      skip_actions: bool = False,
  ) -> ParserGenerator:
      with open(output_file, "w") as file:
          gen: ParserGenerator = PythonParserGenerator(
              grammar, file
          )  # TODO: skip_actions
          gen.generate(grammar_file)
      return gen
  
imports: import itertools
  import logging
  import os
  import pathlib
  import sys
  import sysconfig
  import tempfile
  import tokenize
  from typing import IO, Any, Dict, List, Optional, Set, Tuple
  from pegen.c_generator import CParserGenerator
  from pegen.grammar import Grammar
  from pegen.grammar_parser import GeneratedParser
  from pegen.parser import Parser
  from pegen.parser_generator import ParserGenerator
  from pegen.python_generator import PythonParserGenerator
  from pegen.tokenizer import Tokenizer
label_desc: Use image node_id 7 for calling a global function with example usage: build_python_generator(grammar, grammar_file, output_file, skip_actions) and returns: gen