code: def pipeline_train_and_eval():
      """Train and evaluate ranking model."""
      train_dataset, eval_dataset = datasets()
      pipeline_hparams = tfr.keras.pipeline.PipelineHparams(
          model_dir=FLAGS.model_dir,
          num_epochs=FLAGS.num_epochs,
          steps_per_epoch=(FLAGS.num_train_steps // FLAGS.num_epochs),
          validation_steps=FLAGS.num_valid_steps,
          loss=FLAGS.loss,
          loss_reduction=tf.losses.Reduction.AUTO,
          optimizer="adagrad",
          learning_rate=FLAGS.learning_rate,
          steps_per_execution=10,
          export_best_model=True,
          strategy="MirroredStrategy",
      )
  
      ranking_pipeline = RaggedPipeline(
          model_builder=MyModelBuilder(),
          dataset_builder=tfr.keras.pipeline.NullDatasetBuilder(
              train_dataset, eval_dataset
          ),
          hparams=pipeline_hparams,
      )
      ranking_pipeline.train_and_validate()
  
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 4 for calling a global function with example usage: pipeline_train_and_eval() without return types