Event emitter class for python