code: def setUpClass(cls):
      tmp_dir = tf.test.get_temp_dir()
      compressed_dir = os.path.join(tmp_dir, "compressed")
      shutil.rmtree(tmp_dir)
      tf.gfile.MakeDirs(compressed_dir)
  
      en_data = [str(i) for i in range(10, 40)]
      de_data = [str(i) for i in range(100, 130)]
      data = list(zip(en_data, de_data))
  
      for i, dataset in enumerate(cls.DATASETS):
          tar_file = dataset[0]
          en_file, de_file = [
              os.path.join(compressed_dir, name) for name in dataset[1]
          ]
          with tf.gfile.Open(en_file, "w") as en_f:
              with tf.gfile.Open(de_file, "w") as de_f:
                  start = i * 10
                  end = start + 10
                  for en_line, de_line in data[start:end]:
                      en_f.write(en_line)
                      en_f.write("\n")
                      de_f.write(de_line)
                      de_f.write("\n")
  
          with tarfile.open(
              os.path.join(tmp_dir, tar_file), "w:gz"
          ) as tar_f:
              tar_f.add(en_file, os.path.basename(en_file))
              tar_f.add(de_file, os.path.basename(de_file))
  
      cls.tmp_dir = tmp_dir
      cls.data = data
  
file_path: tensor2tensor/tensor2tensor/data_generators/translate_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import shutil
  import tarfile
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.data_generators import translate
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the TranslateTest obj's underlying member method code with example usage: obj.setUpClass(cls) without return types