code: def get_dataset(path, example_shape):
      """Parse TFRecords, do image preprocessing, and return the image dataset for inference and the variant/alt-allele dataset for writing the variant calls."""
  
      proto_features = {
          "image/encoded": tf.io.FixedLenFeature((), tf.string),
          "variant/encoded": tf.io.FixedLenFeature((), tf.string),
          "alt_allele_indices/encoded": tf.io.FixedLenFeature(
              (), tf.string
          ),
      }
      if FLAGS.debugging_true_label_mode:
          proto_features["label"] = tf.io.FixedLenFeature((1), tf.int64)
  
      def _parse_example(example):
          """Parses a serialized tf.Example."""
          parsed_features = tf.io.parse_single_example(
              serialized=example, features=proto_features
          )
          image_encoded = (
              parsed_features["image/encoded"]
              if FLAGS.include_debug_info
              else b""
          )
          image = tf.io.decode_raw(
              parsed_features["image/encoded"], tf.uint8
          )
          image = tf.reshape(image, example_shape)
          image = tf.cast(image, tf.float32)
          image = dv_utils.preprocess_images(image)
          variant = parsed_features["variant/encoded"]
          alt_allele_indices = parsed_features[
              "alt_allele_indices/encoded"
          ]
          optional_label = None
          if FLAGS.debugging_true_label_mode:
              optional_label = parsed_features["label"]
          return (
              image_encoded,
              image,
              variant,
              alt_allele_indices,
              optional_label,
          )
  
      ds = tf.data.TFRecordDataset.list_files(
          sharded_file_utils.normalize_to_sharded_file_pattern(path),
          shuffle=False,
      )
  
      def load_dataset(filename):
          dataset = tf.data.TFRecordDataset(
              filename,
              buffer_size=_DEFAULT_PREFETCH_BUFFER_BYTES,
              compression_type="GZIP",
          )
          return dataset
  
      ds = ds.interleave(
          load_dataset,
          cycle_length=_DEFAULT_INPUT_READ_THREADS,
          num_parallel_calls=tf.data.AUTOTUNE,
      )
      if _LIMIT.value > 0:
          ds = ds.take(_LIMIT.value)
  
      enc_image_variant_alt_allele_ds = ds.map(
          map_func=_parse_example, num_parallel_calls=tf.data.AUTOTUNE
      )
  
      enc_image_variant_alt_allele_ds = (
          enc_image_variant_alt_allele_ds.batch(
              batch_size=FLAGS.batch_size
          ).prefetch(tf.data.AUTOTUNE)
      )
      return enc_image_variant_alt_allele_ds
  
imports: import multiprocessing
  import os
  import time
  from typing import Any
  from absl import flags
  from absl import logging
  import numpy
  import tensorflow
  from deepvariant import dv_utils
  from deepvariant import keras_modeling
  from deepvariant import logging_level
  from deepvariant.protos import deepvariant_pb2
  from absl import app
  import multiprocessing
  from third_party.nucleus.io import sharded_file_utils
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.util import errors
  from third_party.nucleus.util import proto_utils
  from third_party.nucleus.util import variant_utils
label_desc: Use image node_id 4 for calling a global function with example usage: get_dataset(path, example_shape) and returns: enc_image_variant_alt_allele_ds, image_encoded,  image,  variant,  alt_allele_indices,  optional_label, dataset