code: def datasets():
      """Creates the datasets."""
      # Create feature specification.
      context_feature_spec = {
          "query_tokens": tf.io.RaggedFeature(dtype=tf.string),
      }
      example_feature_spec = {
          "document_tokens": tf.io.RaggedFeature(dtype=tf.string),
          _LABEL_FEATURE: tf.io.FixedLenFeature(
              shape=[], dtype=tf.int64, default_value=0
          ),
      }
  
      # Load datasets.
      train_dataset = tfr.data.build_ranking_dataset(
          file_pattern=FLAGS.train_input_pattern,
          data_format=tfr.data.ELWC,
          batch_size=FLAGS.train_batch_size,
          context_feature_spec=context_feature_spec,
          example_feature_spec=example_feature_spec,
          mask_feature_name=_MASK,
          num_epochs=1,
          shuffle_buffer_size=1000,
      )
      eval_dataset = tfr.data.build_ranking_dataset(
          file_pattern=FLAGS.eval_input_pattern,
          data_format=tfr.data.ELWC,
          batch_size=FLAGS.eval_batch_size,
          context_feature_spec=context_feature_spec,
          example_feature_spec=example_feature_spec,
          mask_feature_name=_MASK,
          num_epochs=1,
          shuffle_buffer_size=1000,
      )
  
      # This maps the dataset features to a tuple (features, label) where the label
      # is converted to a ragged tensor.
      train_dataset = train_dataset.map(_add_ragged_label)
      eval_dataset = eval_dataset.map(_add_ragged_label)
      return train_dataset, eval_dataset
  
imports: import os
  from typing import List
  from absl import app
  from absl import flags
  from absl import logging
  import tensorflow
  import tensorflow_ranking
label_desc: Use image node_id 2 for calling a global function with example usage: datasets() and returns: train_dataset,  eval_dataset