code: def make_dataset(file_path, training, include_nbr_features, hparams):
      """Returns a `tf.data.Dataset` instance based on data in `file_path`."""
  
      def parse_example(example_proto):
          """Extracts relevant fields from the `example_proto`.
  
          Args:
            example_proto: An instance of `tf.train.Example`.
  
          Returns:
            A pair whose first value is a dictionary containing relevant features
            and whose second value contains the ground truth labels.
          """
          # The 'words' feature is a multi-hot, bag-of-words representation of the
          # original raw text. A default value is required for examples that don't
          # have the feature.
          feature_spec = {
              "id": tf.io.FixedLenFeature(
                  (), tf.string, default_value=""
              ),
              "words": tf.io.FixedLenFeature(
                  [hparams.max_seq_length],
                  tf.int64,
                  default_value=tf.constant(
                      0, dtype=tf.int64, shape=[hparams.max_seq_length]
                  ),
              ),
              "label": tf.io.FixedLenFeature(
                  (), tf.int64, default_value=-1
              ),
          }
          if include_nbr_features:
              for i in range(hparams.num_neighbors):
                  nbr_feature_key = "{}{}_{}".format(
                      NBR_FEATURE_PREFIX, i, "words"
                  )
                  nbr_weight_key = "{}{}{}".format(
                      NBR_FEATURE_PREFIX, i, NBR_WEIGHT_SUFFIX
                  )
                  nbr_id_key = "{}{}_{}".format(
                      NBR_FEATURE_PREFIX, i, "id"
                  )
                  feature_spec[nbr_feature_key] = tf.io.FixedLenFeature(
                      [hparams.max_seq_length],
                      tf.int64,
                      default_value=tf.constant(
                          0,
                          dtype=tf.int64,
                          shape=[hparams.max_seq_length],
                      ),
                  )
                  feature_spec[nbr_weight_key] = tf.io.FixedLenFeature(
                      [1], tf.float32, default_value=tf.constant([0.0])
                  )
                  feature_spec[nbr_id_key] = tf.io.FixedLenFeature(
                      (), tf.string, default_value=""
                  )
  
          features = tf.io.parse_single_example(
              example_proto, feature_spec
          )
  
          labels = features.pop("label")
          return features, labels
  
      # If the dataset is sharded, the following code may be required:
      # filenames = tf.data.Dataset.list_files(file_path, shuffle=True)
      # dataset = filenames.interleave(load_dataset, cycle_length=1)
      dataset = load_dataset(file_path)
      if training:
          dataset = dataset.shuffle(10000)
      dataset = dataset.map(parse_example)
      dataset = dataset.batch(hparams.batch_size)
      return dataset
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import threading
  from absl import app
  from absl import flags
  from absl import logging
  import attr
  import neural_structured_learning
  from research.carls import dynamic_embedding_config_pb2
  from research.carls import dynamic_embedding_neighbor_cache
  from research.carls import graph_regularization
  from research.carls import kbs_server_helper_pybind
  import tensorflow
  from google.protobuf import text_format
label_desc: Use image node_id 3 for calling a global function with example usage: make_dataset(file_path, training, include_nbr_features, hparams) and returns: dataset, features,  labels