class_docstr: Tests utility functions.
      
docstr: Tests :func:`texar.tf.utils.strip_token`
          
docstr_tok: ["Tests",":","func",":","`","texar.tf.utils.strip_token","`"]
code: def test_strip_token(self):
      """Tests :func:`texar.tf.utils.strip_token`"""
      str_ = " <PAD>  <PAD>\t  i am <PAD> \t <PAD>  \t"
      self.assertEqual(utils.strip_token(str_, "<PAD>"), "i am")
      self.assertEqual(
          utils.strip_token(str_, ""), "<PAD> <PAD> i am <PAD> <PAD>"
      )
      self.assertEqual(utils.strip_token([str_], "<PAD>"), ["i am"])
      self.assertEqual(
          utils.strip_token(np.asarray([str_]), "<PAD>"), ["i am"]
      )
      self.assertEqual(
          type(utils.strip_token(np.asarray([str_]), "<PAD>")),
          np.ndarray,
      )
      self.assertEqual(
          utils.strip_token([[[str_]], [""]], "<PAD>"),
          [[["i am"]], [""]],
      )
  
      str_ = str_.split()
      self.assertEqual(
          utils.strip_token(str_, "<PAD>", is_token_list=True),
          ["i", "am"],
      )
      self.assertEqual(
          utils.strip_token([str_], "<PAD>", is_token_list=True),
          [["i", "am"]],
      )
  
file_path: texar/tests/utils/utils_test.py
imports: import tempfile
  import numpy
  import tensorflow
  from texar.tf.utils import utils
  from texar.tf.data.vocabulary import Vocab
label_desc: Use image node_id 2 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_strip_token() without return types