code: def test_callable_event_bad_behaviour():
      special_events = [1, 2, 5, 7, 17, 20]
  
      def custom_event_filter(engine, event):
          if event in special_events:
              return True
          return False
  
      # Check bad behaviour
      engine = Engine(lambda e, b: b)
      counter = [0]
  
      # Modify events
      Events.ITERATION_STARTED(event_filter=custom_event_filter)
  
      @engine.on(Events.ITERATION_STARTED)
      def assert_all_iters(engine):
          counter[0] += 1
          assert engine.state.iteration == counter[0]
  
      d = list(range(50))
      engine.run(d, max_epochs=25)
  
      assert counter[0] == engine.state.iteration
  
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 18 for calling a global function with example usage: test_callable_event_bad_behaviour() and returns: False, True