Implement an event emitter from scratch.
Implement event_emitter(operations) using only data structures. Support registering persistent listeners with on, registering one-time listeners with once, removing listeners with off, and dispatching events with emit.
Each operation is an array. Listener identifiers are strings, and each emit operation returns the listener identifiers invoked in registration order. Return the outputs from all emit operations.
off operation removes all registrations matching the event and listener identifierdef event_emitter(operations):