code: def setUpClass(cls):
      cls.tmp_dir = tf.test.get_temp_dir()
      shutil.rmtree(cls.tmp_dir)
      os.mkdir(cls.tmp_dir)
  
      cls.inputs = [
          "Hello world",
          "Goodbye world",
      ]
      cls.targets = [
          "Hola mundo",
          "Adios mundo",
      ]
      cls.labels = [2, 3]
      cls.labels_strs = ["c", "d"]
  
      cls.inputs_file = os.path.join(cls.tmp_dir, "inputs.train.txt")
      cls.targets_file = os.path.join(cls.tmp_dir, "targets.train.txt")
      cls.labels_file = os.path.join(cls.tmp_dir, "labels.train.txt")
      cls.labels_str_file = os.path.join(
          cls.tmp_dir, "labels_str.train.txt"
      )
      data = [
          (cls.inputs, cls.inputs_file),
          (cls.targets, cls.targets_file),
          (cls.labels, cls.labels_file),
          (cls.labels_strs, cls.labels_str_file),
      ]
  
      for lines, filename in data:
          with tf.gfile.Open(filename, "w") as f:
              for line in lines:
                  f.write(str(line))
                  f.write("\n")
  
      cls.tabbed_file = os.path.join(cls.tmp_dir, "tabbed.train.txt")
      with tf.gfile.Open(cls.tabbed_file, "w") as f:
          for inputs, targets in zip(cls.inputs, cls.targets):
              f.write("%s\t%s\n" % (inputs, targets))
  
      tf.gfile.Copy(
          cls.inputs_file, os.path.join(cls.tmp_dir, "inputs.eval.txt")
      )
      tf.gfile.Copy(
          cls.targets_file,
          os.path.join(cls.tmp_dir, "targets.eval.txt"),
      )
  
      cls.targets_regr = [[1.23, 2.34], [4.56, 5.67]]
      cls.targets_regr_file = os.path.join(
          cls.tmp_dir, "targets_regr.train.txt"
      )
      with tf.gfile.Open(cls.targets_regr_file, "w") as f:
          for targets in cls.targets_regr:
              f.write(" ".join([str(x) for x in targets]) + "\n")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import shutil
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling the TextProblems obj's underlying member method code with example usage: obj.setUpClass(cls) without return types