code: def get_single_unk_token(
      src_tokens: List[str],
      word_ids: List[int],
      copy_unk_token: bool,
      unk_idx: int,
  ):
      """Returns the string representation of the first UNK
      we get in our source utterance. We can then use this string instead of
      writing "<UNK>" in our decoding.
      """
      if copy_unk_token:
          for i, x in enumerate(word_ids):
              if x == unk_idx:
                  return src_tokens[i]
      return None
  
file_path: pytext/pytext/torchscript/seq2seq/export_model.py
imports: from typing import List, Optional, Tuple
  import torch
  from pytext.torchscript.vocab import ScriptVocabulary
label_desc: Use image node_id 1 for calling a global function with example usage: get_single_unk_token(src_tokens, word_ids, copy_unk_token, unk_idx) and returns: None, src_tokens