code: def map_to_ids(tokens, vocab):
      ids = [
          vocab[t] if t in vocab else constant.UNK_ID for t in tokens
      ]
      return ids
  
file_path: stanza/stanza/models/common/data.py
imports: import logging
  import random
  import torch
  import stanza.models.common.seq2seq_constant
  from stanza.models.common.doc import HEAD, ID, UPOS
label_desc: Use image node_id 1 for calling a global function with example usage: map_to_ids(tokens, vocab) and returns: ids