class_docstr: ### Tiny Shakespeare Dataset
docstr: Return a sample
docstr_tok: ["Return","a","sample"]
code: def __getitem__(self, idx):
      """
      Return a sample
      """
      return (
          self.data[idx : idx + self.seq_len],
          self.data[idx + 1 : idx + self.seq_len + 1],
      )
  
imports: import dataclasses
  import torch
  from labml_helpers.module import Module
  from torch import nn
  from torch.utils.data import Dataset, DataLoader
  from labml import experiment, lab, tracker, monit, logger
  from labml.logger import Text
  from labml.utils.download import download_file
  from labml_nn.experiments.nlp_autoregression import transpose_batch
  from labml_nn.optimizers.noam import Noam
  from labml_nn.transformers import Encoder, MultiHeadAttention
  from labml_nn.transformers.feed_forward import FeedForward
  from labml_nn.transformers.models import EmbeddingsWithPositionalEncoding, TransformerLayer
  from labml_nn.transformers.utils import subsequent_mask
label_desc: Use image node_id 4 for calling the TinyShakespeareDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self,  self