code: def _token_mask(text_wd, sent_max_len):
      token_mask_list = []
      for sent_wd in text_wd:
          token_num = len(sent_wd)
          if token_num < sent_max_len:
              mask = [1] * token_num + [0] * (sent_max_len - token_num)
          else:
              mask = [1] * sent_max_len
          token_mask_list.append(mask)
      return token_mask_list
  
imports: import os
  import numpy
  from functools import partial
  from .pipe import Pipe
  from .utils import _drop_empty_instance
  from ..loader.summarization import ExtCNNDMLoader
  from ..data_bundle import DataBundle
  from ...core.vocabulary import Vocabulary
label_desc: Use image node_id 5 for calling a global function with example usage: _token_mask(text_wd, sent_max_len) and returns: token_mask_list