docstr: generate a phoneme sequence from text.
  since the usage is for subsequent caching, we never add bos and
  eos chars here. Instead we add those dynamically later; based on the
  config option.
docstr_tok: ["generate","a","phoneme","sequence","from","text",".","since","the","usage","is","for","subsequent","caching",",","we","never","add","bos","and","eos","chars","here",".","Instead","we","add","those","dynamically","later",";","based","on","the","config","option","."]
code: def _generate_and_cache_phoneme_sequence(
      text, cache_path, cleaners, language, tp, add_blank
  ):
      """generate a phoneme sequence from text.
      since the usage is for subsequent caching, we never add bos and
      eos chars here. Instead we add those dynamically later; based on the
      config option."""
      phonemes = phoneme_to_sequence(
          text,
          [cleaners],
          language=language,
          enable_eos_bos=False,
          tp=tp,
          add_blank=add_blank,
      )
      phonemes = np.asarray(phonemes, dtype=np.int32)
      np.save(cache_path, phonemes)
      return phonemes
  
imports: import collections
  import os
  import random
  from multiprocessing import Manager, Pool
  import numpy
  import torch
  import tqdm
  from torch.utils.data import Dataset
  from TTS.tts.utils.data import prepare_data, prepare_stop_target, prepare_tensor
  from TTS.tts.utils.text import pad_with_eos_bos, phoneme_to_sequence, text_to_sequence
label_desc: Use image node_id 4 for calling the MyDataset obj's underlying member method code with example usage: obj._generate_and_cache_phoneme_sequence(text, cache_path, cleaners, language, tp, add_blank) and returns: phonemes