code: def get_input_fn_from_dataset(
      dataset_config_filename, mode, **kwargs
  ):
      """Creates an input_fn from the dataset config file.
  
      Args:
        dataset_config_filename: str. Path to the dataset config pbtxt file.
        mode: one of tf.estimator.ModeKeys.{TRAIN,EVAL,PREDICT}
        **kwargs: Additional keyword arguments for DeepVariantInput.
  
      Returns:
        An input_fn from the specified split in the dataset_config file.
  
      Raises:
        ValueError: if the dataset config doesn't have the necessary information.
      """
      # Get the metadata.
      dataset_config = read_dataset_config(dataset_config_filename)
      # Return a reader for the data.
      return get_input_fn_from_filespec(
          input_file_spec=dataset_config.tfrecord_path,
          mode=mode,
          num_examples=dataset_config.num_examples,
          name=dataset_config.name,
          **kwargs,
      )
  
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 3 for calling a global function with example usage: get_input_fn_from_dataset(dataset_config_filename, mode) and returns: get_input_fn_from_filespec