code: def create_G(
      kaldi_root: Path, fst_dir: Path, lm_arpa: Path, arpa_base: str
  ) -> (Path, Path):
      out_words_file = fst_dir / f"kaldi_dict.{arpa_base}.txt"
      grammar_graph = fst_dir / f"G_{arpa_base}.fst"
      if not grammar_graph.exists() or not out_words_file.exists():
          logger.info(f"Creating {grammar_graph}")
          arpa2fst = kaldi_root / "src/lmbin/arpa2fst"
          subprocess.run(
              [
                  arpa2fst,
                  "--disambig-symbol=#0",
                  f"--write-symbol-table={out_words_file}",
                  lm_arpa,
                  grammar_graph,
              ],
              check=True,
          )
      return grammar_graph, out_words_file
  
imports: from dataclasses import dataclass
  import hydra
  from hydra.core.config_store import ConfigStore
  import logging
  from omegaconf import MISSING, OmegaConf
  import os
  import os.path
  from pathlib import Path
  import subprocess
  from typing import Optional
  from fairseq.data.dictionary import Dictionary
  from fairseq.dataclass import FairseqDataclass
label_desc: Use image node_id 3 for calling a global function with example usage: create_G(kaldi_root, fst_dir, lm_arpa, arpa_base) and returns: grammar_graph,  out_words_file