code: def decode_tf_record_batch(
      tf_record_batch: pd.DataFrame,
  ) -> pd.DataFrame:
      def process_images():
          for image_buffer in tf_record_batch["image/encoded"]:
              image_buffer = tf.reshape(image_buffer, shape=[])
              image_buffer = tf.io.decode_jpeg(
                  image_buffer, channels=NUM_CHANNELS
              )
              yield image_buffer
  
      # Subtract one so that labels are in [0, 1000), and cast to float32 for
      # Keras model.
      # TODO(swang): Do we need to support one-hot encoding?
      labels = (tf_record_batch["image/class/label"] - 1).astype(
          "float32"
      )
      df = pd.DataFrame.from_dict(
          {"image": process_images(), "label": labels}
      )
  
      return df
  
imports: from collections import defaultdict
  import tensorflow
  import numpy
  import os
  import pandas
  import time
  import logging
  import csv
  import json
  import torchvision
  import torch
  import ray
  from ray.train.tensorflow import prepare_dataset_shard, TensorflowTrainer
  from ray.train import DataConfig, ScalingConfig
  from ray import train, tune
  from ray.tune import Tuner
  from ray.data.datasource.partitioning import Partitioning
  from tf_utils import DEFAULT_IMAGE_SIZE, NUM_CHANNELS, preprocess_image, build_tf_dataset
  from metric_utils import determine_if_memory_monitor_is_enabled_in_latest_session, get_ray_spilled_and_restored_mb, MaxMemoryUtilizationTracker
label_desc: Use image node_id 5 for calling a global function with example usage: decode_tf_record_batch(tf_record_batch) and returns: df