code: def train(args, params):
      """
      Train model
      """
      x_train, y_train, x_test, y_test = load_mnist_data(args)
      model = create_mnist_model(params)
  
      model.fit(
          x_train,
          y_train,
          batch_size=args.batch_size,
          epochs=args.epochs,
          verbose=1,
          validation_data=(x_test, y_test),
          callbacks=[
              SendMetrics(),
              TensorBoard(log_dir=TENSORBOARD_DIR),
          ],
      )
  
      _, acc = model.evaluate(x_test, y_test, verbose=0)
      LOG.debug("Final result is: %d", acc)
      nni.report_final_result(acc)
  
file_path: nni/examples/trials/mnist-keras/mnist-keras.py
imports: import argparse
  import logging
  import os
  import keras
  import numpy
  from keras import backend
  from keras.callbacks import TensorBoard
  from keras.datasets import mnist
  from keras.layers import Conv2D, Dense, Flatten, MaxPooling2D
  from keras.models import Sequential
  import nni
label_desc: Use image node_id 3 for calling a global function with example usage: train(args, params) without return types