class_docstr: Base class for transferring styles problems
class_docstr_tok: ["Base","class","for","transferring","styles","problems"]
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      dataset = self.dataset_url(dataset_split)
  
      url = dataset[0][0]
      compressed_filename = os.path.basename(url)
      compressed_filepath = os.path.join(tmp_dir, compressed_filename)
      generator_utils.maybe_download(tmp_dir, compressed_filename, url)
  
      mode = "r:gz" if compressed_filepath.endswith("gz") else "r"
      with tarfile.open(compressed_filepath, mode) as corpus_tar:
          corpus_tar.extractall(tmp_dir)
  
      if self.vocab_type == text_problems.VocabType.SUBWORD:
          generator_utils.get_or_generate_vocab(
              data_dir,
              tmp_dir,
              self.vocab_filename,
              self.approx_vocab_size,
              self.vocab_data_files(),
          )
  
      source_file, target_file = self.source_target_paths(
          dataset_split, tmp_dir
      )
      return text_problems.text2text_txt_iterator(
          source_file, target_file
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import tarfile
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.utils import registry
label_desc: Use image node_id 8 for calling the StyleTransferProblemShakespeare obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) and returns: text_problems