code: def paths_and_labels_to_dataset(
      image_paths,
      image_size,
      num_channels,
      labels,
      label_mode,
      num_classes,
      interpolation,
      data_format,
      crop_to_aspect_ratio=False,
  ):
      """Constructs a dataset of images and labels."""
      # TODO(fchollet): consider making num_parallel_calls settable
      path_ds = tf.data.Dataset.from_tensor_slices(image_paths)
      args = (
          image_size,
          num_channels,
          interpolation,
          data_format,
          crop_to_aspect_ratio,
      )
      img_ds = path_ds.map(
          lambda x: load_image(x, *args),
          num_parallel_calls=tf.data.AUTOTUNE,
      )
      if label_mode:
          label_ds = dataset_utils.labels_to_dataset(
              labels, label_mode, num_classes
          )
          img_ds = tf.data.Dataset.zip((img_ds, label_ds))
      return img_ds
  
file_path: keras/keras/utils/image_dataset_utils.py
imports: import numpy
  from keras.api_export import keras_export
  from keras.backend.config import standardize_data_format
  from keras.utils import dataset_utils
  from keras.utils import image_utils
  from keras.utils.module_utils import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: paths_and_labels_to_dataset(image_paths, image_size, num_channels, labels, label_mode, num_classes, interpolation, data_format, crop_to_aspect_ratio) and returns: img_ds