class_docstr: Encapsulates a list of event callbacks.
  
  Each instance of EventEmitter represents the source of a stream of similar
  events, such as mouse click events or timer activation events. For
  example, the following diagram shows the propagation of a mouse click
  event to the list of callbacks that are registered to listen for that
  event::
  
     User clicks    |Canvas creates
     mouse on       |MouseEvent:                |'mouse_press' EventEmitter:         |callbacks in sequence: # noqa
     Canvas         |                           |                                    |  # noqa
                 -->|event = MouseEvent(...) -->|Canvas.events.mouse_press(event) -->|callback1(event)  # noqa
                    |                           |                                 -->|callback2(event)  # noqa
                    |                           |                                 -->|callback3(event)  # noqa
  
  Callback functions may be added or removed from an EventEmitter using
  :func:`connect() <vispy.event.EventEmitter.connect>` or
  :func:`disconnect() <vispy.event.EventEmitter.disconnect>`.
  
  Calling an instance of EventEmitter will cause each of its callbacks
  to be invoked in sequence. All callbacks are invoked with a single
  argument which will be an instance of :class:`Event <vispy.event.Event>`.
  
  EventEmitters are generally created by an EmitterGroup instance.
  
  Parameters
  ----------
  source : object
      The object that the generated events apply to. All emitted Events will
      have their .source property set to this value.
  type : str or None
      String indicating the event type (e.g. mouse_press, key_release)
  event_class : subclass of Event
      The class of events that this emitter will generate.
class_docstr_tok: ["Encapsulates","a","list","of","event","callbacks",".","Each","instance","of","EventEmitter","represents","the","source","of","a","stream","of","similar","events",",","such","as","mouse","click","events","or","timer","activation","events",".","For","example",",","the","following","diagram","shows","the","propagation","of","a","mouse","click","event","to","the","list","of","callbacks","that","are","registered","to","listen","for","that","event",":",":","User","clicks","|Canvas","creates","mouse","on","|MouseEvent",":","|'mouse_press","'","EventEmitter",":","|callbacks","in","sequence",":","#","noqa","Canvas","|","|","|","#","noqa","--",">","|event","=","MouseEvent","(","...",")","--",">","|Canvas.events.mouse_press","(","event",")","--",">","|callback1","(","event",")","#","noqa","|","|","--",">","|callback2","(","event",")","#","noqa","|","|","--",">","|callback3","(","event",")","#","noqa","Callback","functions","may","be","added","or","removed","from","an","EventEmitter","using",":","func",":","`","connect","(",")","<","vispy.event.EventEmitter.connect",">","`","or",":","func",":","`","disconnect","(",")","<","vispy.event.EventEmitter.disconnect",">","`",".","Calling","an","instance","of","EventEmitter","will","cause","each","of","its","callbacks","to","be","invoked","in","sequence",".","All","callbacks","are","invoked","with","a","single","argument","which","will","be","an","instance","of",":","class",":","`","Event","<","vispy.event.Event",">","`",".","EventEmitters","are","generally","created","by","an","EmitterGroup","instance",".","Parameters","--","--","--","--","--","source",":","object","The","object","that","the","generated","events","apply","to",".","All","emitted","Events","will","have","their",".source","property","set","to","this","value",".","type",":","str","or","None","String","indicating","the","event","type","(","e.g",".","mouse_press",",","key_release",")","event_class",":","subclass","of","Event","The","class","of","events","that","this","emitter","will","generate","."]
docstr: __call__(**kwargs)
  Invoke all callbacks for this emitter.
  
  Emit a new event object, created with the given keyword
  arguments, which must match with the input arguments of the
  corresponding event class. Note that the 'type' argument is
  filled in by the emitter.
  
  Alternatively, the emitter can also be called with an Event
  instance as the only argument. In this case, the specified
  Event will be used rather than generating a new one. This allows
  customized Event instances to be emitted and also allows EventEmitters
  to be chained by connecting one directly to another.
  
  Note that the same Event instance is sent to all callbacks.
  This allows some level of communication between the callbacks
  (notably, via Event.handled) but also requires that callbacks
  be careful not to inadvertently modify the Event.
docstr_tok: ["__call__","(","*","*","kwargs",")","Invoke","all","callbacks","for","this","emitter",".","Emit","a","new","event","object",",","created","with","the","given","keyword","arguments",",","which","must","match","with","the","input","arguments","of","the","corresponding","event","class",".","Note","that","the","'type","'","argument","is","filled","in","by","the","emitter",".","Alternatively",",","the","emitter","can","also","be","called","with","an","Event","instance","as","the","only","argument",".","In","this","case",",","the","specified","Event","will","be","used","rather","than","generating","a","new","one",".","This","allows","customized","Event","instances","to","be","emitted","and","also","allows","EventEmitters","to","be","chained","by","connecting","one","directly","to","another",".","Note","that","the","same","Event","instance","is","sent","to","all","callbacks",".","This","allows","some","level","of","communication","between","the","callbacks","(","notably",",","via","Event.handled",")","but","also","requires","that","callbacks","be","careful","not","to","inadvertently","modify","the","Event","."]
code: def __call__(self, *args, **kwargs):
      """__call__(**kwargs)
      Invoke all callbacks for this emitter.
  
      Emit a new event object, created with the given keyword
      arguments, which must match with the input arguments of the
      corresponding event class. Note that the 'type' argument is
      filled in by the emitter.
  
      Alternatively, the emitter can also be called with an Event
      instance as the only argument. In this case, the specified
      Event will be used rather than generating a new one. This allows
      customized Event instances to be emitted and also allows EventEmitters
      to be chained by connecting one directly to another.
  
      Note that the same Event instance is sent to all callbacks.
      This allows some level of communication between the callbacks
      (notably, via Event.handled) but also requires that callbacks
      be careful not to inadvertently modify the Event.
      """
      # This is a VERY highly used method; must be fast!
      blocked = self._blocked
  
      # create / massage event as needed
      event = self._prepare_event(*args, **kwargs)
  
      # Add our source to the event; remove it after all callbacks have been
      # invoked.
      event._push_source(self.source)
      self._emitting += 1
      try:
          if (
              blocked.get(None, 0) > 0
          ):  # this is the same as self.blocked()
              return event
  
          rem = []
          for cb in self._callbacks[:]:
              if isinstance(cb, tuple):
                  obj = cb[0]()
                  if obj is None:
                      rem.append(cb)
                      continue
                  cb = getattr(obj, cb[1], None)
                  if cb is None:
                      continue
  
              if blocked.get(cb, 0) > 0:
                  continue
  
              if self._emitting > 1:
                  raise RuntimeError("EventEmitter loop detected!")
  
              self._invoke_callback(cb, event)
              if event.blocked:
                  break
  
          # remove callbacks to dead objects
          for cb in rem:
              self.disconnect(cb)
      finally:
          self._emitting -= 1
          if event._pop_source() != self.source:
              raise RuntimeError("Event source-stack mismatch.")
  
      return event
  
imports: from __future__ import division
  from collections import OrderedDict
  import inspect
  import traceback
  import weakref
  from .logs import logger, _handle_exception
label_desc: Use image node_id 13 for calling the EventEmitter obj's underlying member method code with example usage: obj.__call__() and returns: event, event