code: def _create_fake_preprocessed_dataset(
      output_path, seq_length, label_type
  ):
      """Creates a fake dataset."""
      writer = tf.io.TFRecordWriter(output_path)
  
      def create_int_feature(values):
          f = tf.train.Feature(
              int64_list=tf.train.Int64List(value=list(values))
          )
          return f
  
      def create_float_feature(values):
          f = tf.train.Feature(
              float_list=tf.train.FloatList(value=list(values))
          )
          return f
  
      elwc_num = 32
      list_size = 12
      for query_id in range(elwc_num):
          elwc = input_pb2.ExampleListWithContext()
          for doc_id in range(list_size):
              features = {}
              input_ids = np.random.randint(100, size=(seq_length))
              features["input_ids"] = create_int_feature(input_ids)
              features["input_mask"] = create_int_feature(
                  np.ones_like(input_ids)
              )
              features["segment_ids"] = create_int_feature(
                  np.ones_like(input_ids)
              )
  
              if label_type == tf.int64:
                  features["relevance"] = create_int_feature([1])
              elif label_type == tf.float32:
                  features["relevance"] = create_float_feature([0.5])
              else:
                  raise ValueError(
                      "Unsupported label_type: %s" % label_type
                  )
  
              features["query_id"] = create_int_feature([query_id])
              features["document_id"] = create_int_feature([doc_id])
  
              example = tf.train.Example(
                  features=tf.train.Features(feature=features)
              )
              elwc.examples.append(example)
  
          writer.write(elwc.SerializeToString())
      writer.close()
  
imports: import os
  from absl import flags
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from official.nlp.configs import encoders
  from tensorflow_ranking.extension.premade import tfrbert_task
  from tensorflow_ranking.python import data
  from tensorflow_ranking.python.keras import model
  from tensorflow_serving.apis import input_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _create_fake_preprocessed_dataset(output_path, seq_length, label_type) and returns: f, f