code: def paths_and_labels_to_dataset(
      file_paths,
      labels,
      label_mode,
      num_classes,
      sampling_rate,
      output_sequence_length,
      ragged,
  ):
      """Constructs a fixed-size dataset of audio and labels."""
      path_ds = tf.data.Dataset.from_tensor_slices(file_paths)
      audio_ds = path_ds.map(
          lambda x: read_and_decode_audio(
              x, sampling_rate, output_sequence_length
          ),
          num_parallel_calls=tf.data.AUTOTUNE,
      )
  
      if ragged:
          audio_ds = audio_ds.map(
              lambda x: tf.RaggedTensor.from_tensor(x),
              num_parallel_calls=tf.data.AUTOTUNE,
          )
  
      if label_mode:
          label_ds = dataset_utils.labels_to_dataset(
              labels, label_mode, num_classes
          )
          audio_ds = tf.data.Dataset.zip((audio_ds, label_ds))
      return audio_ds
  
file_path: keras/keras/utils/audio_dataset_utils.py
imports: import numpy
  from keras.api_export import keras_export
  from keras.utils import dataset_utils
  from keras.utils.module_utils import tensorflow
  from keras.utils.module_utils import tensorflow_io
label_desc: Use image node_id 6 for calling a global function with example usage: paths_and_labels_to_dataset(file_paths, labels, label_mode, num_classes, sampling_rate, output_sequence_length, ragged) and returns: audio_ds