class_docstr: Tests data iterators.
      
class_docstr_tok: ["Tests","data","iterators","."]
code: def setUp(self):
      tf.test.TestCase.setUp(self)
  
      # Create data
      train_text = list(np.linspace(1, 1000, num=1000, dtype=np.int64))
      train_text = [str(x) for x in train_text]
      train_text_file = tempfile.NamedTemporaryFile()
      train_text_file.write("\n".join(train_text).encode("utf-8"))
      train_text_file.flush()
      self._train_text_file = train_text_file
  
      test_text = list(
          np.linspace(1001, 2000, num=1000, dtype=np.int64)
      )
      test_text = [str(x) for x in test_text]
      test_text_file = tempfile.NamedTemporaryFile()
      test_text_file.write("\n".join(test_text).encode("utf-8"))
      test_text_file.flush()
      self._test_text_file = test_text_file
  
      vocab_list = train_text + test_text
      vocab_file = tempfile.NamedTemporaryFile()
      vocab_file.write("\n".join(vocab_list).encode("utf-8"))
      vocab_file.flush()
      self._vocab_file = vocab_file
      self._vocab_size = len(vocab_list)
  
      self._train_hparams = {
          "num_epochs": 2,
          "batch_size": 1,
          "shuffle": False,
          "dataset": {
              "files": self._train_text_file.name,
              "vocab_file": self._vocab_file.name,
              "bos_token": "",
              "eos_token": "",
          },
          "name": "train",
      }
  
      self._test_hparams = {
          "num_epochs": 1,
          "batch_size": 1,
          "shuffle": False,
          "dataset": {
              "files": self._test_text_file.name,
              "vocab_file": self._vocab_file.name,
              "bos_token": "",
              "eos_token": "",
          },
          "name": "test",
      }
  
file_path: texar/tests/data/data/data_iterators_test.py
imports: import tempfile
  import numpy
  import tensorflow
  import texar.tf
label_desc: Use image node_id 1 for calling the DataIteratorTest obj's underlying member method code with example usage: obj.setUp() without return types