def pad_with_eos_bos(phoneme_sequence, tp=None):
    global _phonemes_to_id, _bos, _eos
    if tp:
        _bos = tp['bos']
        _eos = tp['eos']
        (_, _phonemes) = make_symbols(**tp)
        _phonemes_to_id = {s: i for (i, s) in enumerate(_phonemes)}
    return (([_phonemes_to_id[_bos]] + list(phoneme_sequence)) + [_phonemes_to_id[_eos]])
def pad_with_eos_bos(phoneme_sequence, tp=None):
    global _phonemes_to_id, _bos, _eos
    if tp:
        _bos = tp['bos']
        _eos = tp['eos']
        (_, _phonemes) = make_symbols(**tp)
        _phonemes_to_id = {s: i for (i, s) in enumerate(_phonemes)}
    return (([_phonemes_to_id[_bos]] + list(phoneme_sequence)) + [_phonemes_to_id[_eos]])