class_docstr: Tiny Shakespeare dataset builder.
docstr: Returns SplitGenerators.
docstr_tok: ["Returns","SplitGenerators","."]
code: def _split_generators(self, dl_manager):
      """Returns SplitGenerators."""
      download_path = dl_manager.download(
          "https://raw.githubusercontent.com/karpathy/char-rnn/master/data/tinyshakespeare/input.txt"
      )
      if tf.io.gfile.isdir(download_path):
          # During testing the download manager mock gives us a directory
          txt_path = os.path.join(download_path, "input.txt")
      else:
          txt_path = download_path
      with tf.io.gfile.GFile(txt_path, "r") as f:
          text = f.read()
  
      # 90/5/5 split
      i = int(len(text) * 0.9)
      train_text, text = text[:i], text[i:]
      i = int(len(text) * 0.5)
      validation_text, text = text[:i], text[i:]
      test_text = text
  
      return [
          tfds.core.SplitGenerator(
              name=tfds.Split.TRAIN,
              # These kwargs will be passed to _generate_examples
              gen_kwargs={
                  "split_key": "train",
                  "split_text": train_text,
              },
          ),
          tfds.core.SplitGenerator(
              name=tfds.Split.VALIDATION,
              gen_kwargs={
                  "split_key": "validation",
                  "split_text": validation_text,
              },
          ),
          tfds.core.SplitGenerator(
              name=tfds.Split.TEST,
              gen_kwargs={"split_key": "test", "split_text": test_text},
          ),
      ]
  
file_path: datasets/tensorflow_datasets/datasets/tiny_shakespeare/tiny_shakespeare_dataset_builder.py
imports: from __future__ import annotations
  import os
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling the Builder obj's underlying member method code with example usage: obj._split_generators(dl_manager) and returns: list