code: def train_and_evaluate(
      model, model_desc, train_dataset, test_dataset, hparams
  ):
      """Compiles, trains, and evaluates a `Keras` model.
  
      Args:
        model: An instance of `tf.Keras.Model`.
        model_desc: A description of the model.
        train_dataset: An instance of `tf.data.Dataset` representing training data.
        test_dataset: An instance of `tf.data.Dataset` representing test data.
        hparams: An instance of `Hparams`.
      """
      model.compile(
          optimizer="adam",
          loss=tf.keras.losses.SparseCategoricalCrossentropy(
              from_logits=False
          ),
          metrics=["accuracy"],
      )
      model.fit(train_dataset, epochs=hparams.train_epochs, verbose=1)
      eval_results = dict(
          zip(
              model.metrics_names,
              model.evaluate(test_dataset, steps=hparams.eval_steps),
          )
      )
      log_metrics(model_desc, eval_results)
  
file_path: neural-structured-learning/neural_structured_learning/examples/graph_keras_mlp_cora.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import app
  from absl import flags
  from absl import logging
  import attr
  import neural_structured_learning
  import tensorflow
label_desc: Use image node_id 8 for calling a global function with example usage: train_and_evaluate(model, model_desc, train_dataset, test_dataset, hparams) without return types