code: def test_custom_events_asserts():
      # Dummy engine
      engine = Engine(lambda engine, batch: 0)
  
      class A:
          pass
  
      with pytest.raises(
          TypeError,
          match=r"Value at \d of event_names should be a str or EventEnum",
      ):
          engine.register_events(None)
  
      with pytest.raises(
          TypeError,
          match=r"Value at \d of event_names should be a str or EventEnum",
      ):
          engine.register_events("str", None)
  
      with pytest.raises(
          TypeError,
          match=r"Value at \d of event_names should be a str or EventEnum",
      ):
          engine.register_events(1)
  
      with pytest.raises(
          TypeError,
          match=r"Value at \d of event_names should be a str or EventEnum",
      ):
          engine.register_events(A())
  
      assert Events.EPOCH_COMPLETED != 1
      assert Events.EPOCH_COMPLETED != "abc"
      assert Events.ITERATION_COMPLETED != Events.EPOCH_COMPLETED
      assert Events.ITERATION_COMPLETED != Events.EPOCH_COMPLETED(
          every=2
      )
      # In current implementation, EPOCH_COMPLETED and EPOCH_COMPLETED with event filter are the same
      assert Events.EPOCH_COMPLETED == Events.EPOCH_COMPLETED(every=2)
      assert Events.ITERATION_COMPLETED == Events.ITERATION_COMPLETED(
          every=2
      )
  
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 2 for calling a global function with example usage: test_custom_events_asserts() without return types