code: def list_strip_eos(list_, eos_token):
      """Strips EOS token from a list of lists of tokens."""
      list_strip = []
      for elem in list_:
          if eos_token in elem:
              elem = elem[: elem.index(eos_token)]
          list_strip.append(elem)
      return list_strip
  
file_path: texar/examples/transformer/utils/utils.py
imports: import random
  import math
  import logging
  import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: list_strip_eos(list_, eos_token) and returns: list_strip