code: def text_to_sequence(text, cleaner_names, tp=None, add_blank=False):
      """Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
  
      The text can optionally have ARPAbet sequences enclosed in curly braces embedded
      in it. For example, "Turn left on {HH AW1 S S T AH0 N} Street."
  
      Args:
        text: string to convert to a sequence
        cleaner_names: names of the cleaner functions to run the text through
  
      Returns:
        List of integers corresponding to the symbols in the text
      """
      # pylint: disable=global-statement
      global _symbol_to_id, _symbols
      if tp:
          _symbols, _ = make_symbols(**tp)
          _symbol_to_id = {s: i for i, s in enumerate(_symbols)}
  
      sequence = []
      # Check for curly braces and treat their contents as ARPAbet:
      while text:
          m = _CURLY_RE.match(text)
          if not m:
              sequence += _symbols_to_sequence(
                  _clean_text(text, cleaner_names)
              )
              break
          sequence += _symbols_to_sequence(
              _clean_text(m.group(1), cleaner_names)
          )
          sequence += _arpabet_to_sequence(m.group(2))
          text = m.group(3)
  
      if add_blank:
          sequence = intersperse(
              sequence, len(_symbols)
          )  # add a blank token (new), whose id number is len(_symbols)
      return sequence
  
file_path: TTS/TTS/tts/utils/text/__init__.py
imports: import re
  from packaging import version
  import phonemizer
  from phonemizer.phonemize import phonemize
  from TTS.tts.utils.text import cleaners
  from TTS.tts.utils.text.symbols import make_symbols, symbols, phonemes, _phoneme_punctuations, _bos, _eos
label_desc: Use image node_id 6 for calling a global function with example usage: text_to_sequence(text, cleaner_names, tp, add_blank) and returns: sequence