code: def clean_decodes(ids, vocab_size, eos_id=1):
    
    ret = []
    for i in ids:
      if i == eos_id:
        break
      if i >= vocab_size:
        break
      ret.append(int(i))
    return ret
docs: Stop at EOS or padding or OOV.
  
    Args:
      ids: a list of integers
      vocab_size: an integer
      eos_id: EOS id
  
    Returns:
      a list of integers