code: def test_args_and_kwargs_are_passed_to_event():
      engine = DummyEngine()
      kwargs = {"a": "a", "b": "b"}
      args = (1, 2, 3)
      handlers = []
      for event in [Events.STARTED, Events.COMPLETED]:
          handler = create_autospec(
              spec=lambda e, x1, x2, x3, a, b: None
          )
          engine.add_event_handler(event, handler, *args, **kwargs)
          handlers.append(handler)
  
      engine.run(1)
      called_handlers = [handle for handle in handlers if handle.called]
      assert len(called_handlers) == 2
  
      for handler in called_handlers:
          handler_args, handler_kwargs = handler.call_args
          assert handler_args[0] == engine
          assert handler_args[1::] == args
          assert handler_kwargs == kwargs
  
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 11 for calling a global function with example usage: test_args_and_kwargs_are_passed_to_event() without return types