code: def history_to_dict(keras_history):
      return {
          "epochs": keras_history.epoch,
          "history": keras_history.history,
          "params": keras_history.params,
          "optimizer_params": keras_history.model.optimizer.get_config(),
      }
  
file_path: lit/lit_nlp/examples/tools/glue_trainer.py
imports: from collections.abc import Sequence
  import os
  from absl import app
  from absl import flags
  from absl import logging
  from lit_nlp.examples.datasets import classification
  from lit_nlp.examples.datasets import glue
  from lit_nlp.examples.models import glue_models
  from lit_nlp.lib import serialize
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: history_to_dict(keras_history) and returns: dict