code: def encode_ids(spm_model, text, sample=False):
      """turn sentences into word pieces."""
      pieces = encode_pieces(
          spm_model, text, return_unicode=False, sample=sample
      )
      ids = [spm_model.PieceToId(piece) for piece in pieces]
      return ids
  
imports: import collections
  import sentencepiece
  import unicodedata
  from .args import str2bool
label_desc: Use image node_id 4 for calling a global function with example usage: encode_ids(spm_model, text, sample) and returns: ids