code: def check_mnist_simple(self, display_log=True, use_chx=False):
      (
          updater,
          optimizer,
          train_iter,
          _,
          model,
      ) = self.setup_mnist_trainer(use_chx)
  
      path = tempfile.mkdtemp(dir="/tmp", prefix=__name__ + "-tmp-")
      if display_log:
          print("temporary file:", path)
      checkpointer = create_multi_node_checkpointer(
          name=__name__, comm=self.communicator, path=path
      )
      checkpointer.maybe_load(updater, optimizer)
  
      sum_accuracy = 0
      sum_loss = 0
      stop = 5
      train_count = len(train_iter.dataset)
      while train_iter.epoch < stop:
          batch = train_iter.next()
          x_array, t_array = convert.concat_examples(batch, -1)
          x = chainer.Variable(x_array)
          t = chainer.Variable(t_array)
          optimizer.update(model, x, t)
  
          sum_loss += float(model.loss.data) * len(t.data)
          sum_accuracy += float(model.accuracy.data) * len(t.data)
  
          if train_iter.is_new_epoch:
              if display_log:
                  print(
                      updater.iteration,
                      train_iter.epoch,
                      sum_loss / train_count,
                      sum_accuracy / train_count,
                  )
              sum_loss = 0
              sum_accuracy = 0
  
              checkpointer.save(updater, updater.iteration)
  
      if display_log:
          print(self.communicator.rank, checkpointer.get_stats())
  
      # Allocate totally different set of training tools to avoid leakage
      data_2 = self.setup_mnist_trainer()
      updater2, optimizer2, train_iter2, test_iter2, model2 = data_2
      checkpointer2 = create_multi_node_checkpointer(
          name=__name__, comm=self.communicator, path=path
      )
      checkpointer2.maybe_load(updater2, optimizer2)
  
      # Check data properly resumed
      self.assertEqual(updater.epoch, updater2.epoch)
      self.assertEqual(updater.iteration, updater2.iteration)
      # TODO(kuenishi): find a simple way to assure model equality
      # in terms of float matrix
      # self.assertEqual(model, model2)
  
      # Restart training
      while train_iter2.epoch < stop * 2:
          batch = train_iter2.next()
          x_array, t_array = convert.concat_examples(batch, -1)
          x = chainer.Variable(x_array)
          t = chainer.Variable(t_array)
          optimizer2.update(model2, x, t)
  
          sum_loss += float(model2.loss.data) * len(t.data)
          sum_accuracy += float(model2.accuracy.data) * len(t.data)
  
          if train_iter2.is_new_epoch:
              print(
                  updater2.iteration,
                  train_iter2.epoch,
                  sum_loss / train_count,
                  sum_accuracy / train_count,
              )
              sum_loss = 0
              sum_accuracy = 0
  
              checkpointer2.save(updater2, updater2.iteration)
  
      if display_log:
          print(self.communicator.rank, checkpointer2.get_stats())
      checkpointer2.finalize()
      checkpointer.finalize()
  
      # Validate training
      sum_accuracy = 0
      sum_loss = 0
      test_count = len(test_iter2.dataset)
      for batch in test_iter2:
          x_array, t_array = convert.concat_examples(batch, -1)
          x = chainer.Variable(x_array)
          t = chainer.Variable(t_array)
          loss = model2(x, t)
          sum_loss += float(loss.data) * len(t.data)
          sum_accuracy += float(model2.accuracy.data) * len(t.data)
  
      if display_log:
          print(
              "test mean  loss: {}, accuracy: {}".format(
                  sum_loss / test_count, sum_accuracy / test_count
              )
          )
  
      self.assertGreaterEqual(sum_accuracy / test_count, 0.95)
      os.removedirs(path)
  
imports: import os
  import tempfile
  import unittest
  import warnings
  import numpy
  import chainer
  from chainer.dataset import convert
  import chainer.functions
  import chainer.links
  import chainer.testing
  from chainer import training
  import chainermn
  from chainermn.extensions.checkpoint import _CheckpointStats
  from chainermn.extensions.checkpoint import create_multi_node_checkpointer
  from chainermn.testing.device import get_device
  import chainerx
label_desc: Use image node_id 7 for calling the TestCheckpoint obj's underlying member method code with example usage: obj.check_mnist_simple(display_log, use_chx) without return types