class_docstr: Base class for all :class:`~ignite.engine.events.Events`. User defined custom events should also inherit
  this class.
  
   Examples:
       Custom events based on the loss calculation and backward pass can be created as follows:
  
      .. code-block:: python
  
          from ignite.engine import EventEnum
  
          class BackpropEvents(EventEnum):
              BACKWARD_STARTED = 'backward_started'
              BACKWARD_COMPLETED = 'backward_completed'
              OPTIM_STEP_COMPLETED = 'optim_step_completed'
  
          def update(engine, batch):
              # ...
              loss = criterion(y_pred, y)
              engine.fire_event(BackpropEvents.BACKWARD_STARTED)
              loss.backward()
              engine.fire_event(BackpropEvents.BACKWARD_COMPLETED)
              optimizer.step()
              engine.fire_event(BackpropEvents.OPTIM_STEP_COMPLETED)
              # ...
  
          trainer = Engine(update)
          trainer.register_events(*BackpropEvents)
  
          @trainer.on(BackpropEvents.BACKWARD_STARTED)
          def function_before_backprop(engine):
              # ...
class_docstr_tok: ["Base","class","for","all",":","class",":","`","~ignite.engine.events.Events","`",".","User","defined","custom","events","should","also","inherit","this","class",".","Examples",":","Custom","events","based","on","the","loss","calculation","and","backward","pass","can","be","created","as","follows",":","..","code-block",":",":","python","from","ignite.engine","import","EventEnum","class","BackpropEvents","(","EventEnum",")",":","BACKWARD_STARTED","=","'backward_started'","BACKWARD_COMPLETED","=","'backward_completed'","OPTIM_STEP_COMPLETED","=","'optim_step_completed'","def","update","(","engine",",","batch",")",":","#","...","loss","=","criterion","(","y_pred",",","y",")","engine.fire_event","(","BackpropEvents.BACKWARD_STARTED",")","loss.backward","(",")","engine.fire_event","(","BackpropEvents.BACKWARD_COMPLETED",")","optimizer.step","(",")","engine.fire_event","(","BackpropEvents.OPTIM_STEP_COMPLETED",")","#","...","trainer","=","Engine","(","update",")","trainer.register_events","(","*","BackpropEvents",")","@","trainer.on","(","BackpropEvents.BACKWARD_STARTED",")","def","function_before_backprop","(","engine",")",":","#","..."]
code: def __new__(cls, value: str) -> "EventEnum":
      obj = CallableEventWithFilter.__new__(cls)
      obj._value_ = value
      return obj
  
imports: import numbers
  import warnings
  import weakref
  from collections.abc import Sequence
  from enum import Enum
  from types import DynamicClassAttribute
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, TYPE_CHECKING, Union
  from torch.utils.data import DataLoader
  from ignite.engine.utils import _check_signature
label_desc: Use image node_id 1 for calling the EventEnum obj's underlying member method code with example usage: obj.__new__(cls, value) and returns: obj