code: def test_attach_wrong_event_name():
      trainer = Engine(lambda b, e: None)
      logger = DummyLogger()
      mock_log_handler = MagicMock()
  
      with pytest.raises(RuntimeError, match="Unknown event name"):
          logger.attach(
              trainer,
              log_handler=mock_log_handler,
              event_name="unknown",
          )
  
      events_list = EventsList()
      events_list._events = ["unknown"]
  
      with pytest.raises(RuntimeError, match="Unknown event name"):
          logger.attach(
              trainer,
              log_handler=mock_log_handler,
              event_name=events_list,
          )
  
imports: from typing import Any, Union
  from unittest.mock import call, MagicMock
  import pytest
  import torch
  from ignite.contrib.handlers.base_logger import BaseLogger, BaseOptimizerParamsHandler, BaseOutputHandler, BaseWeightsHandler, BaseWeightsScalarHandler
  from ignite.engine import Engine, Events, EventsList, State
  from tests.ignite.contrib.handlers import MockFP16DeepSpeedZeroOptimizer
label_desc: Use image node_id 6 for calling a global function with example usage: test_attach_wrong_event_name() without return types