class_docstr: Tests multi aligned text data class.
      
class_docstr_tok: ["Tests","multi","aligned","text","data","class","."]
code: def setUp(self):
      tf.test.TestCase.setUp(self)
  
      # Create test data
      vocab_list = ["This", "is", "a", "word", "词"]
      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)
  
      text_0 = ["This is a sentence from source .", "词 词 。 source"]
      text_0_file = tempfile.NamedTemporaryFile()
      text_0_file.write("\n".join(text_0).encode("utf-8"))
      text_0_file.flush()
      self._text_0_file = text_0_file
  
      text_1 = ["This is a sentence from target .", "词 词 。 target"]
      text_1_file = tempfile.NamedTemporaryFile()
      text_1_file.write("\n".join(text_1).encode("utf-8"))
      text_1_file.flush()
      self._text_1_file = text_1_file
  
      text_2 = [
          "This is a sentence from dialog . ||| dialog ",
          "词 词 。 ||| 词 dialog",
      ]
      text_2_file = tempfile.NamedTemporaryFile()
      text_2_file.write("\n".join(text_2).encode("utf-8"))
      text_2_file.flush()
      self._text_2_file = text_2_file
  
      int_3 = [0, 1]
      int_3_file = tempfile.NamedTemporaryFile()
      int_3_file.write(
          ("\n".join([str(_) for _ in int_3])).encode("utf-8")
      )
      int_3_file.flush()
      self._int_3_file = int_3_file
  
      def _bytes_feature(value):
          """Returns a bytes_list from a string / byte."""
          value = tf.compat.as_bytes(value, encoding="utf-8")
          return tf.train.Feature(
              bytes_list=tf.train.BytesList(value=[value])
          )
  
      def _int64_feature(value):
          """Returns an int64_list from a bool / enum / int / uint."""
          return tf.train.Feature(
              int64_list=tf.train.Int64List(value=[value])
          )
  
      feature = {
          "number1": _int64_feature(128),
          "number2": _int64_feature(512),
          "text": _bytes_feature(
              "This is a sentence for TFRecord 词 词 。"
          ),
      }
      data_example = tf.train.Example(
          features=tf.train.Features(feature=feature)
      )
      tfrecord_file = tempfile.NamedTemporaryFile(suffix=".tfrecord")
      with tf.python_io.TFRecordWriter(tfrecord_file.name) as writer:
          writer.write(data_example.SerializeToString())
      tfrecord_file.flush()
      self._tfrecord_file = tfrecord_file
  
      # Construct database
      self._hparams = {
          "num_epochs": 123,
          "batch_size": 23,
          "datasets": [
              {  # dataset 0
                  "files": [self._text_0_file.name],
                  "vocab_file": self._vocab_file.name,
                  "bos_token": "",
                  "data_name": "0",
              },
              {  # dataset 1
                  "files": [self._text_1_file.name],
                  "vocab_share_with": 0,
                  "eos_token": "<TARGET_EOS>",
                  "data_name": "1",
              },
              {  # dataset 2
                  "files": [self._text_2_file.name],
                  "vocab_file": self._vocab_file.name,
                  "processing_share_with": 0,
                  "variable_utterance": True,
                  "data_name": "2",
              },
              {  # dataset 3
                  "files": self._int_3_file.name,
                  "data_type": "int",
                  "data_name": "label",
              },
              {  # dataset 4
                  "files": self._tfrecord_file.name,
                  "feature_original_types": {
                      "number1": ["tf.int64", "FixedLenFeature"],
                      "number2": ["tf.int64", "FixedLenFeature"],
                      "text": ["tf.string", "FixedLenFeature"],
                  },
                  "feature_convert_types": {
                      "number2": "tf.float32",
                  },
                  "num_shards": 2,
                  "shard_id": 1,
                  "data_type": "tf_record",
                  "data_name": "4",
              },
          ],
      }
  
file_path: texar/tests/data/data/multi_aligned_data_test.py
imports: import sys
  import tempfile
  import copy
  import numpy
  import tensorflow
  import texar.tf
label_desc: Use image node_id 1 for calling the MultiAlignedDataTest obj's underlying member method code with example usage: obj.setUp() and returns: tf, tf