code: def on_batch_end(self, training_state, snapshot=False):
      if snapshot & (self.snapshot_step is not None):
          self.save(training_state.step)
  
      if None not in (
          self.best_snapshot_path,
          self.best_val_accuracy,
          training_state.val_acc,
      ):
          if training_state.val_acc > self.best_val_accuracy:
              self.best_val_accuracy = training_state.val_acc
              self.save_best(
                  int(10000 * round(training_state.val_acc, 4))
              )
  
imports: from __future__ import division, print_function, absolute_import
  import time
  import sys
label_desc: Use image node_id 5 for calling the ModelSaver obj's underlying member method code with example usage: obj.on_batch_end(training_state, snapshot) without return types