code: def phoneme_pipeline(phn, phoneme_encoder=None):
      """Encodes a sequence of phonemes using the encoder
      provided
  
      Arguments
      ---------
      phoneme_encoder: speechbrain.datio.encoder.TextEncoder
          a text encoder instance (optional, if not provided, a new one
          will be created)
  
      Returns
      -------
      phn: list
          the original list of phonemes
      phn_encoded_list: list
          encoded phonemes, as a list
      phn_encoded: torch.Tensor
          encoded phonemes, as a tensor
      """
  
      yield phn
      phn_encoded_list = phoneme_encoder.encode_sequence(phn)
      yield phn_encoded_list
      phn_encoded = torch.LongTensor(phn_encoded_list)
      yield phn_encoded
  
imports: from functools import reduce
  from speechbrain.wordemb.util import expand_to_chars
  import speechbrain
  import torch
  import re
label_desc: Use image node_id 8 for calling a global function with example usage: phoneme_pipeline(phn, phoneme_encoder) without return types