class_docstr: A text dataset with one sequence as input and a label.
class_docstr_tok: ["A","text","dataset","with","one","sequence","as","input","and","a","label","."]
docstr: Returns an iterator with padded batches for the provided dataset.
docstr_tok: ["Returns","an","iterator","with","padded","batches","for","the","provided","dataset","."]
code: def get_batches(
      self,
      batch_size: int,
      drop_remainder: bool = False,
      shuffle: bool = False,
      shuffle_seed: Optional[int] = None,
      fixed_pad_length: Optional[int] = None,
      dataset: Optional[tf.data.Dataset] = None,
  ):
      """Returns an iterator with padded batches for the provided dataset."""
      if dataset is None:
          dataset = self.examples
      if shuffle:
          buffer_size = get_num_examples(dataset)
          dataset = dataset.shuffle(
              buffer_size,
              seed=shuffle_seed,
              reshuffle_each_iteration=True,
          )
      padded_shapes = {k: v for k, v in self.padded_shapes.items()}
      if fixed_pad_length is not None:
          padded_shapes["token_ids"] = fixed_pad_length
      return dataset.padded_batch(
          batch_size,
          padded_shapes=padded_shapes,
          drop_remainder=drop_remainder,
      )
  
imports: from typing import Any, Dict, Optional
  from absl import logging
  import numpy
  import tensorflow
  import tensorflow_datasets
  import tensorflow_text
  import vocabulary
label_desc: Use image node_id 6 for calling the TextDataset obj's underlying member method code with example usage: obj.get_batches(batch_size, drop_remainder, shuffle, shuffle_seed, fixed_pad_length, dataset) and returns: dataset