class_docstr: Base class inheritted by all data classes.
      
class_docstr_tok: ["Base","class","inheritted","by","all","data","classes","."]
code: def _shuffle_dataset(dataset, hparams, dataset_files):
      dataset_size = None
      shuffle_buffer_size = hparams["shuffle_buffer_size"]
      if hparams["shard_and_shuffle"]:
          if shuffle_buffer_size is None:
              raise ValueError(
                  "Dataset hyperparameter 'shuffle_buffer_size' "
                  "must not be `None` if 'shard_and_shuffle'=`True`."
              )
          dataset_size = count_file_lines(dataset_files)
          if shuffle_buffer_size >= dataset_size:
              raise ValueError(
                  "Dataset size (%d) <= shuffle_buffer_size (%d). Set "
                  "shuffle_and_shard to `False`."
                  % (dataset_size, shuffle_buffer_size)
              )
          # TODO(zhiting): Use a different seed?
          dataset = dataset.apply(
              dsutils.random_shard_dataset(
                  dataset_size, shuffle_buffer_size, hparams["seed"]
              )
          )
          dataset = dataset.shuffle(
              shuffle_buffer_size + 16,  # add a margin
              seed=hparams["seed"],
          )
      elif hparams["shuffle"]:
          if shuffle_buffer_size is None:
              dataset_size = count_file_lines(dataset_files)
              shuffle_buffer_size = dataset_size
          dataset = dataset.shuffle(
              shuffle_buffer_size, seed=hparams["seed"]
          )
  
      return dataset, dataset_size
  
file_path: texar/texar/tf/data/data/data_base.py
imports: import tensorflow
  from texar.tf.hyperparams import HParams
  from texar.tf.data.data import dataset_utils
  from texar.tf.data.data_utils import count_file_lines
label_desc: Use image node_id 4 for calling the DataBase obj's underlying member method code with example usage: obj._shuffle_dataset(dataset, hparams, dataset_files) and returns: dataset,  dataset_size