def sequence_to_code(sequence, code_dict):
    '''Analogous to sequence_to_text'''
    id_to_code = {i: c for c, i in code_dict.items()}
    return ' '.join([id_to_code[i] for i in sequence])
Analogous to sequence_to_text
examples/textless_nlp/gslm/unit2speech/tacotron2/text.py