code: def test_list_of_events():
      def _test(event_list, true_iterations):
          engine = Engine(lambda e, b: b)
  
          iterations = []
  
          num_calls = [0]
  
          @engine.on(event_list)
          def execute_some_handler(e):
              iterations.append(e.state.iteration)
              num_calls[0] += 1
  
          engine.run(range(3), max_epochs=5)
  
          assert iterations == true_iterations
          assert num_calls[0] == len(true_iterations)
  
      _test(
          Events.ITERATION_STARTED(once=1)
          | Events.ITERATION_STARTED(once=1),
          [1, 1],
      )
      _test(
          Events.ITERATION_STARTED(once=1)
          | Events.ITERATION_STARTED(once=10),
          [1, 10],
      )
      _test(
          Events.ITERATION_STARTED(once=1)
          | Events.ITERATION_STARTED(every=3),
          [1, 3, 6, 9, 12, 15],
      )
      _test(
          Events.ITERATION_STARTED(once=8)
          | Events.ITERATION_STARTED(before=3),
          [1, 2, 8],
      )
      _test(
          Events.ITERATION_STARTED(once=1)
          | Events.ITERATION_STARTED(after=12),
          [1, 13, 14, 15],
      )
  
imports: from enum import Enum
  from unittest.mock import MagicMock
  import pytest
  import torch
  import ignite.distributed
  from ignite.engine import Engine, Events
  from ignite.engine.events import CallableEventWithFilter, EventEnum, EventsList
label_desc: Use image node_id 26 for calling a global function with example usage: test_list_of_events() without return types