code: def prepare_data(data_path):
      """Preprocesses SST2 data."""
      train_path = os.path.join(data_path, "sst.train.sentences.txt")
      if not tf.gfile.Exists(train_path):
          url = (
              "https://raw.githubusercontent.com/ZhitingHu/"
              "logicnn/master/data/raw/"
          )
          files = [
              "stsa.binary.phrases.train",
              "stsa.binary.dev",
              "stsa.binary.test",
          ]
          for fn in files:
              tx.data.maybe_download(url + fn, data_path, extract=True)
  
      fn_train, _ = transform_raw_sst(
          data_path, "stsa.binary.phrases.train", "sst2.train"
      )
      transform_raw_sst(data_path, "stsa.binary.dev", "sst2.dev")
      transform_raw_sst(data_path, "stsa.binary.test", "sst2.test")
  
      vocab = tx.data.make_vocab(fn_train)
      fn_vocab = os.path.join(data_path, "sst2.vocab")
      with open(fn_vocab, "w", encoding="utf-8") as f_vocab:
          for v in vocab:
              f_vocab.write(v + "\n")
  
      tf.logging.info("Preprocessing done: {}".format(data_path))
  
file_path: texar/examples/sentence_classifier/sst_data_preprocessor.py
imports: import os
  import re
  from io import open
  import tensorflow
  import texar.tf
label_desc: Use image node_id 3 for calling a global function with example usage: prepare_data(data_path) without return types