code: def untokenized_tfds_dataset(
      dataset_name=gin.REQUIRED,
      text2self=gin.REQUIRED,
      tfds_data_dir=gin.REQUIRED,
      dataset_split=gin.REQUIRED,
      batch_size=None,
      sequence_length=gin.REQUIRED,
      vocabulary=gin.REQUIRED,
      pack=gin.REQUIRED,
  ):
      """Reads a tensorflow_datasets dataset.
  
      Returns a tf.data.Dataset containing single tokenized examples where each
      feature ends in EOS=1.
  
      Args:
        dataset_name: a string
        text2self: a boolean, if true, run unsupervised LM-style training. if false,
          the dataset must support supervised mode.
        tfds_data_dir: a boolean
        dataset_split: a string
        batch_size: an integer
        sequence_length: an integer
        vocabulary: a vocabulary.Vocabulary
        pack: if True, multiple examples emitted by load_internal() are concatenated
            to form one combined example.
      Returns:
        a tf.data.Dataset of batches
      """
      del batch_size
      dataset = tfds.load(
          dataset_name,
          split=dataset_split,
          as_supervised=not text2self,
          data_dir=tfds_data_dir,
      )
      if dataset_split == "train":
          dataset = dataset.repeat()
          dataset = dataset.shuffle(1000)
      if not text2self:
          dataset = supervised_to_dict(dataset, text2self)
      dataset = encode_all_features(dataset, vocabulary)
      return pack_or_pad(dataset, sequence_length, pack)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  import gin
  import tensorflow.compat.v1
  import tensorflow_datasets
label_desc: Use image node_id 9 for calling a global function with example usage: untokenized_tfds_dataset(dataset_name, text2tfds_data_dir, dataset_split, batch_size, sequence_length, vocabulary, pack) and returns: pack_or_pad