code: def test_restarts_after_interruption(self):
      # Run some initial training first.
      self.run_single_mode(
          TEST_MODE_1,
          target_local_step=TEST_NUM_STEPS,
          target_global_step=TEST_NUM_STEPS,
      )
      global_step = TEST_NUM_STEPS
  
      restarter = Restarter(
          TEST_MODE_2, self.out_dir, target_local_step=2
      )
      with self.assertRaises(RuntimeError):
          global_step += 1
          with restarter.training_loop():
              self.create_checkpoint(global_step)
              # Simulate training interruption after the first step.
              raise RuntimeError
      restarter = Restarter(
          TEST_MODE_2, self.out_dir, target_local_step=2
      )
  
      self.assertFalse(restarter.should_skip)
      self.assertTrue(restarter.restarting)
      # Training should resume after the first step.
      self.assertEqual(restarter.steps_to_go, 1)
  
file_path: tensor2tensor/tensor2tensor/rl/restarter_test.py
imports: import os
  from tensor2tensor.rl.restarter import Restarter
  import tensorflow.compat.v1
label_desc: Use image node_id 8 for calling the RestarterTest obj's underlying member method code with example usage: obj.test_restarts_after_interruption() without return types