code: def test_restart_training():
      data = range(10)
      engine = Engine(lambda e, b: 1)
      state = engine.run(data, max_epochs=5)
      with pytest.raises(
          ValueError,
          match=r"Argument max_epochs should be greater than or equal to the start epoch defined in the state: 2 vs 5. "
          r"Please, .+ "
          r"before calling engine.run\(\) in order to restart the training from the beginning.",
      ):
          state = engine.run(data, max_epochs=2)
      state.max_epochs = None
      engine.run(data, max_epochs=2)
  
file_path: ignite/tests/ignite/engine/test_engine_state_dict.py
imports: from collections.abc import Mapping
  import pytest
  import torch
  from ignite.engine import Engine, Events, State
  from tests.ignite.engine import BatchChecker, EpochCounter, IterationCounter
label_desc: Use image node_id 14 for calling a global function with example usage: test_restart_training() without return types