code: def _test_trigger(
      self, trigger, key, accuracies, expected, resume=None, save=None
  ):
      trainer = testing.get_trainer_with_mock_updater(
          stop_trigger=(len(accuracies), "iteration"),
          iter_per_epoch=self.iter_per_epoch,
      )
      updater = trainer.updater
  
      def _serialize_updater(serializer):
          updater.iteration = serializer("iteration", updater.iteration)
          updater.epoch = serializer("epoch", updater.epoch)
          updater.is_new_epoch = serializer(
              "is_new_epoch", updater.is_new_epoch
          )
  
      trainer.updater.serialize = _serialize_updater
  
      def set_observation(t):
          t.observation = {key: accuracies[t.updater.iteration - 1]}
  
      trainer.extend(
          set_observation,
          name="set_observation",
          trigger=(1, "iteration"),
          priority=2,
      )
  
      invoked_iterations = []
  
      def record(t):
          invoked_iterations.append(t.updater.iteration)
  
      trainer.extend(record, name="record", trigger=trigger, priority=1)
  
      if resume is not None:
          serializers.load_npz(resume, trainer)
  
      trainer.run()
      self.assertEqual(invoked_iterations, expected)
  
      if save is not None:
          serializers.save_npz(save, trainer)
  
file_path: chainer/tests/chainer_tests/training_tests/triggers_tests/test_minmax_trigger.py
imports: import tempfile
  import unittest
  from chainer import serializers
  from chainer import testing
  from chainer.training import triggers
label_desc: Use image node_id 1 for calling the BestValueTriggerTester obj's underlying member method code with example usage: obj._test_trigger(trigger, key, accuracies, expected, resume, save) without return types