code: def train_eval():
      """train and eval the model"""
  
      global trainloader
      global testloader
      global net
  
      (x_train, y_train) = trainloader
      (x_test, y_test) = testloader
  
      # train procedure
      net.fit(
          x=x_train,
          y=y_train,
          batch_size=args.batch_size,
          validation_data=(x_test, y_test),
          epochs=args.epochs,
          shuffle=True,
          callbacks=[
              SendMetrics(),
              EarlyStopping(min_delta=0.001, patience=10),
              TensorBoard(log_dir=TENSORBOARD_DIR),
          ],
      )
  
      # trial report final acc to tuner
      _, acc = net.evaluate(x_test, y_test)
      logger.debug("Final result is: %.3f", acc)
      nni.report_final_result(acc)
  
file_path: nni/examples/trials/network_morphism/FashionMNIST/FashionMNIST_keras.py
imports: import argparse
  import logging
  import os
  import tensorflow
  import keras
  from keras.callbacks import EarlyStopping, TensorBoard
  from keras.datasets import fashion_mnist
  from keras.optimizers import SGD, Adadelta, Adagrad, Adam, Adamax, RMSprop
  from keras.utils import multi_gpu_model, to_categorical
  import keras.backend.tensorflow_backend
  import nni
  from nni.networkmorphism_tuner.graph import json_to_graph
label_desc: Use image node_id 4 for calling a global function with example usage: train_eval() without return types