class_docstr: A weakref handle to remove a registered event.
  
  A handle that may be used to remove a registered event handler via the
  remove method, with-statement, or context manager protocol. Returned from
  :meth:`~ignite.engine.engine.Engine.add_event_handler`.
  
  
  Args:
      event_name: Registered event name.
      handler: Registered event handler, stored as weakref.
      engine: Target engine, stored as weakref.
  
  Examples:
      .. code-block:: python
  
          engine = Engine()
  
          def print_epoch(engine):
              print(f"Epoch: {engine.state.epoch}")
  
          with engine.add_event_handler(Events.EPOCH_COMPLETED, print_epoch):
              # print_epoch handler registered for a single run
              engine.run(data)
  
          # print_epoch handler is now unregistered
class_docstr_tok: ["A","weakref","handle","to","remove","a","registered","event",".","A","handle","that","may","be","used","to","remove","a","registered","event","handler","via","the","remove","method",",","with-statement",",","or","context","manager","protocol",".","Returned","from",":","meth",":","`","~ignite.engine.engine.Engine.add_event_handler","`",".","Args",":","event_name",":","Registered","event","name",".","handler",":","Registered","event","handler",",","stored","as","weakref",".","engine",":","Target","engine",",","stored","as","weakref",".","Examples",":","..","code-block",":",":","python","engine","=","Engine","(",")","def","print_epoch","(","engine",")",":","print","(","f","''","Epoch",":","{","engine.state.epoch","}","''",")","with","engine.add_event_handler","(","Events.EPOCH_COMPLETED",",","print_epoch",")",":","#","print_epoch","handler","registered","for","a","single","run","engine.run","(","data",")","#","print_epoch","handler","is","now","unregistered"]
code: def __init__(
      self,
      event_name: Union[
          CallableEventWithFilter, Enum, EventsList, Events
      ],
      handler: Callable,
      engine: "Engine",
  ) -> None:
      self.event_name = event_name
      self.handler = weakref.ref(handler)
      self.engine = weakref.ref(engine)
  
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 to create a new RemovableEventHandle object  with example: obj = RemovableEventHandle(event_name, handler, engine)