code: def ipa_phonemize(text, lang="en-us", use_g2p=False):
      if use_g2p:
          assert lang == "en-us", "g2pE phonemizer only works for en-us"
          try:
              from g2p_en import G2p
  
              g2p = G2p()
              return " ".join("|" if p == " " else p for p in g2p(text))
          except ImportError:
              raise ImportError(
                  "Please install phonemizer: pip install g2p_en"
              )
      else:
          try:
              from phonemizer import phonemize
              from phonemizer.separator import Separator
  
              return phonemize(
                  text,
                  backend="espeak",
                  language=lang,
                  separator=Separator(word="| ", phone=" "),
              )
          except ImportError:
              raise ImportError(
                  "Please install phonemizer: pip install phonemizer"
              )
  
imports: import io
  import os
  from pathlib import Path
  from typing import Optional, List, Dict
  import zipfile
  import tempfile
  from dataclasses import dataclass
  from itertools import groupby
  import torch
  import torch.nn.functional
  import numpy
  from tqdm import tqdm
  from examples.speech_to_text.data_utils import load_tsv_to_dicts
  from fairseq.data.audio.audio_utils import TTSSpectrogram, TTSMelScale, parse_path, read_from_stored_zip, is_npy_data
label_desc: Use image node_id 6 for calling a global function with example usage: ipa_phonemize(text, lang, use_g2p) and returns: str, phonemize