class_docstr: Single Event containing a filter, specifying whether the event should
  be run at the current event (if the event type is correct)
  
  Args:
      value: The actual enum value. Only needed for internal use. Do not touch!
      event_filter: A function taking the engine and the current event value as input and returning a
          boolean to indicate whether this event should be executed. Defaults to None, which will result to a
          function that always returns `True`
      name: The enum-name of the current object. Only needed for internal use. Do not touch!
class_docstr_tok: ["Single","Event","containing","a","filter",",","specifying","whether","the","event","should","be","run","at","the","current","event","(","if","the","event","type","is","correct",")","Args",":","value",":","The","actual","enum","value",".","Only","needed","for","internal","use",".","Do","not","touch","!","event_filter",":","A","function","taking","the","engine","and","the","current","event","value","as","input","and","returning","a","boolean","to","indicate","whether","this","event","should","be","executed",".","Defaults","to","None",",","which","will","result","to","a","function","that","always","returns","`","True","`","name",":","The","enum-name","of","the","current","object",".","Only","needed","for","internal","use",".","Do","not","touch","!"]
docstr: Makes the event class callable and accepts either an arbitrary callable as filter
  (which must take in the engine and current event value and return a boolean) or an every or once value
  
  Args:
      event_filter: a filter function to check if the event should be executed when
          the event type was fired
      every: a value specifying how often the event should be fired
      once: a value or list of values specifying when the event should be fired (if only once)
      before: a value specifying the number of occurrence that event should be fired before
      after: a value specifying the number of occurrence that event should be fired after
  
  Returns:
      CallableEventWithFilter: A new event having the same value but a different filter function
docstr_tok: ["Makes","the","event","class","callable","and","accepts","either","an","arbitrary","callable","as","filter","(","which","must","take","in","the","engine","and","current","event","value","and","return","a","boolean",")","or","an","every","or","once","value","Args",":","event_filter",":","a","filter","function","to","check","if","the","event","should","be","executed","when","the","event","type","was","fired","every",":","a","value","specifying","how","often","the","event","should","be","fired","once",":","a","value","or","list","of","values","specifying","when","the","event","should","be","fired","(","if","only","once",")","before",":","a","value","specifying","the","number","of","occurrence","that","event","should","be","fired","before","after",":","a","value","specifying","the","number","of","occurrence","that","event","should","be","fired","after","Returns",":","CallableEventWithFilter",":","A","new","event","having","the","same","value","but","a","different","filter","function"]
code: def __call__(
      self,
      event_filter: Optional[Callable] = None,
      every: Optional[int] = None,
      once: Optional[Union[int, List]] = None,
      before: Optional[int] = None,
      after: Optional[int] = None,
  ) -> "CallableEventWithFilter":
      """
      Makes the event class callable and accepts either an arbitrary callable as filter
      (which must take in the engine and current event value and return a boolean) or an every or once value
  
      Args:
          event_filter: a filter function to check if the event should be executed when
              the event type was fired
          every: a value specifying how often the event should be fired
          once: a value or list of values specifying when the event should be fired (if only once)
          before: a value specifying the number of occurrence that event should be fired before
          after: a value specifying the number of occurrence that event should be fired after
  
      Returns:
          CallableEventWithFilter: A new event having the same value but a different filter function
      """
  
      if (
          sum(
              (
                  event_filter is not None,
                  once is not None,
                  (
                      every is not None
                      or before is not None
                      or after is not None
                  ),
              )
          )
          != 1
      ):
          raise ValueError(
              "Only one of the input arguments should be specified, except before, after and every"
          )
  
      if (event_filter is not None) and not callable(event_filter):
          raise TypeError("Argument event_filter should be a callable")
  
      if (every is not None) and not (
          isinstance(every, numbers.Integral) and every > 0
      ):
          raise ValueError(
              "Argument every should be integer and greater than zero"
          )
  
      if once is not None:
          c1 = isinstance(once, numbers.Integral) and once > 0
          c2 = (
              isinstance(once, Sequence)
              and len(once) > 0
              and all(isinstance(e, int) and e > 0 for e in once)
          )
          if not (c1 or c2):
              raise ValueError(
                  f"Argument once should either be a positive integer or a list of positive integers, got {once}"
              )
  
      if (before is not None) and not (
          isinstance(before, numbers.Integral) and before >= 0
      ):
          raise ValueError(
              "Argument before should be integer and greater or equal to zero"
          )
  
      if (after is not None) and not (
          isinstance(after, numbers.Integral) and after >= 0
      ):
          raise ValueError(
              "Argument after should be integer and greater or equal to zero"
          )
  
      if every is not None:
          if every == 1:
              # Just return the event itself
              event_filter = None
          else:
              event_filter = self.every_event_filter(every)
  
      if once is not None:
          event_filter = self.once_event_filter(
              [once] if isinstance(once, int) else once
          )
  
      if before is not None or after is not None:
          if every is not None:
              event_filter = self.every_before_and_after_event_filter(
                  every, before, after
              )
          else:
              event_filter = self.before_and_after_event_filter(
                  before, after
              )
  
      # check signature:
      if event_filter is not None:
          _check_signature(
              event_filter, "event_filter", "engine", "event"
          )
  
      return CallableEventWithFilter(
          self.value, event_filter, self.name
      )
  
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 4 for calling the CallableEventWithFilter obj's underlying member method code with example usage: obj.__call__(event_filter, every, once, before, after) and returns: CallableEventWithFilter