code: def _maybe_shuffle_and_repeat(
      dataset, num_epochs, shuffle, shuffle_buffer_size, shuffle_seed
  ):
      """Optionally shuffle and repeat dataset, as requested."""
      if num_epochs != 1 and shuffle:
          # Use shuffle_and_repeat for perf
          return dataset.apply(
              tf.data.experimental.shuffle_and_repeat(
                  shuffle_buffer_size, num_epochs, shuffle_seed
              )
          )
      if shuffle:
          return dataset.shuffle(shuffle_buffer_size, shuffle_seed)
      if num_epochs != 1:
          return dataset.repeat(num_epochs)
      return dataset
  
imports: import tensorflow
  from tensorflow_io.python.experimental.avro_record_dataset_ops import AvroRecordDataset
  from tensorflow_io.python.experimental.parse_avro_ops import parse_avro
label_desc: Use image node_id 2 for calling a global function with example usage: _maybe_shuffle_and_repeat(dataset, num_epochs, shuffle, shuffle_buffer_size, shuffle_seed) and returns: dataset, dataset, dataset, dataset