code: def get_batches(tf_dataset, model, batch_size):
      """Provides batches of pileup images from this dataset.
  
      Creates a DeepVariantInput for tf_dataset. It instantiates an iterator
      on the dataset, and returns the images, labels, encoded_variant
      features in batches. This calls model.preprocess_images on the images
      (but note that we will be moving that step into model_fn for the
      Estimator api).
  
      Args:
        tf_dataset: a DeepVariantInput object
        model: a model object
        batch_size: int batch size
  
      Returns:
        (images, labels, encoded_variant)
  
      Raises:
        ValueError: if the dataset has the wrong mode.
      """
      if tf_dataset.mode not in (
          tf_estimator.ModeKeys.TRAIN,
          tf_estimator.ModeKeys.EVAL,
      ):
          raise ValueError(
              "tf_dataset.mode is {} but must be one of TRAIN or EVAL.".format(
                  tf_dataset.mode
              )
          )
  
      params = dict(batch_size=batch_size)
      features, labels = tf.compat.v1.data.make_one_shot_iterator(
          tf_dataset(params)
      ).get_next()
  
      images = features["image"]
      encoded_variant = features["variant"]
  
      images = model.preprocess_images(images)
      return images, labels, encoded_variant
  
imports: import itertools
  from typing import Callable, Optional, Tuple
  from absl import logging
  import ml_collections
  import tensorflow
  from tensorflow import estimator
  from deepvariant import dv_constants
  from deepvariant import dv_utils
  from deepvariant import keras_modeling
  from deepvariant.protos import deepvariant_pb2
  from google.protobuf import text_format
  from third_party.nucleus.io import sharded_file_utils
label_desc: Use image node_id 5 for calling a global function with example usage: get_batches(tf_dataset, model, batch_size) and returns: images,  labels,  encoded_variant