class_docstr: Predict next line of poetry from the last line. From Gutenberg texts.
code: def generate_samples(self, data_dir, tmp_dir, dataset_split):
      del data_dir
      del tmp_dir
      del dataset_split
  
      # pylint: disable=g-import-not-at-top
      from gutenberg import acquire
      from gutenberg import cleanup
  
      # pylint: enable=g-import-not-at-top
  
      books = [
          # bookid, skip N lines
          (19221, 223),
          (15553, 522),
      ]
  
      for book_id, toskip in books:
          text = cleanup.strip_headers(
              acquire.load_etext(book_id)
          ).strip()
          lines = text.split("\n")[toskip:]
          prev_line = None
          ex_count = 0
          for line in lines:
              # Any line that is all upper case is a title or author name
              if not line or line.upper() == line:
                  prev_line = None
                  continue
  
              line = re.sub("[^a-z]+", " ", line.strip().lower())
              if prev_line and line:
                  yield {
                      "inputs": prev_line,
                      "targets": line,
                  }
                  ex_count += 1
              prev_line = line
  
file_path: tensor2tensor/tensor2tensor/test_data/example_usr_dir/my_submodule.py
imports: import re
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.utils import registry
label_desc: Use image node_id 4 for calling the PoetryLines obj's underlying member method code with example usage: obj.generate_samples(data_dir, tmp_dir, dataset_split) without return types