code: def download_and_process(data_root):
      if not os.path.isdir(data_root):
          os.makedirs(data_root)
          os.makedirs(os.path.join(data_root, "raw"))
  
          tx.data.maybe_download(
              urls="https://drive.google.com/file/d/1Gytd-SSetUkIY6aVVKNrBOxkHjAlSGeU/view?usp=sharing",
              path="./",
              filenames=os.path.join(data_root, "sw1c2r.tar.gz"),
              extract=True,
          )
  
          os.system(
              "mv {} {}".format(
                  os.path.join(data_root, "sw1c2r.tar.gz"),
                  os.path.join(data_root, "raw/sw1c2r.tar.gz"),
              )
          )
          os.system(
              "mv {}/* {}".format(
                  os.path.join(data_root, "switchboard"), data_root
              )
          )
  
          datasets = sw1c2r(os.path.join(data_root, "json_data"))
  
          for stage in ["train", "val", "test"]:
              dts = datasets[stage]
              spk, src, tgt, meta = list(
                  zip(*[dts[i] for i in range(len(dts))])
              )
              src_txt = "\n".join(src)
              tgt_txt = "\n".join(tgt)
  
              spk = list(zip(*spk))
  
              for i in range(len(spk)):
                  with open(
                      os.path.join(
                          data_root,
                          "{}-source-spk-{}.txt".format(stage, i),
                      ),
                      "w",
                  ) as f:
                      f.write("\n".join([str(a) for a in spk[i]]))
  
              spk_tgt = meta
  
              with open(
                  os.path.join(
                      data_root, "{}-target-spk.txt".format(stage)
                  ),
                  "w",
              ) as f:
                  f.write("\n".join([str(a) for a in spk_tgt]))
  
              with open(
                  os.path.join(
                      data_root, "{}-source.txt".format(stage)
                  ),
                  "w",
              ) as f:
                  f.write(src_txt)
              with open(
                  os.path.join(
                      data_root, "{}-target.txt".format(stage)
                  ),
                  "w",
              ) as f:
                  f.write(tgt_txt)
  
              with open(
                  os.path.join(
                      data_root, "{}-target-refs.txt".format(stage)
                  ),
                  "w",
              ) as f:
                  f.write("\n".join(["|||".join(v) for v in dts.refs]))
  
file_path: texar/examples/hierarchical_dialog/sw_loader.py
imports: import os
  import json
  from json_lines import reader
  from nltk.tokenize import WordPunctTokenizer
  from sklearn.feature_extraction.text import TfidfVectorizer
  import texar.tf
  from config_data import data_root
label_desc: Use image node_id 3 for calling a global function with example usage: download_and_process(data_root) without return types