code: def data_pipeline(
      original_ds,
      image_size,
      width_ratio,
      batch_size,
      num_classes,
      one_hot,
      num_examples,
  ):
      """Pipeline for pre-processing the data."""
      norm_args = {
          "image_size": image_size,
          "width_ratio": width_ratio,
          "num_classes": num_classes,
          "one_hot": one_hot,
      }
      ds = original_ds.map(
          lambda image, label: normalize_img_and_label(
              image, label, **norm_args
          ),
          num_parallel_calls=tf.data.experimental.AUTOTUNE,
      )
      ds = ds.cache()
      ds = ds.shuffle(min(num_examples, 1000))
      ds = ds.batch(batch_size, drop_remainder=True)
      ds = ds.prefetch(tf.data.experimental.AUTOTUNE)
      return ds
  
imports: import os
  import pickle
  from typing import Any, Dict, Optional
  import uuid
  from ..None import machine_config
  from ..None import run
  import tensorflow
  import tensorflow_datasets
  from official.legacy.image_classification.efficientnet import efficientnet_model
  from official.legacy.image_classification.resnet import resnet_model
label_desc: Use image node_id 10 for calling a global function with example usage: data_pipeline(original_ds, image_size, width_ratio, batch_size, num_classes, one_hot, num_examples) and returns: ds