code: def test_on_decorator_raises_with_invalid_event():
      engine = DummyEngine()
      with pytest.raises(ValueError):
  
          @engine.on("incorrect")
          def f(engine):
              pass
  
imports: import functools
  import gc
  from unittest.mock import call, create_autospec, MagicMock
  import pytest
  from pytest import raises
  from ignite.engine import Engine, Events, State
  from ignite.engine.events import EventsList
label_desc: Use image node_id 12 for calling a global function with example usage: test_on_decorator_raises_with_invalid_event() without return types