old_contents: class Emitter(object):
      _events = None
  
      def __init__(self, events={}):
          self._events = events
  
      def on(self, name, fn):
          self._events.setdefault(name, []).append(fn)
          return self
  
      def fire(self, name, data):
          for fn in self._events.get("*", []):
              fn(name, data)
  
          for fn in self._events.get(name, []):
              fn(data)
  
          return self
  
new_contents: class Emitter(object):
      _events = None
  
      def __init__(self, events={}):
          self._events = events
  
      def on(self, name, fn):
          self._events.setdefault(name, set([])).add(fn)
          return self
  
      def fire(self, name, data):
          for fn in self._events.get("*", set([])):
              fn(name, data)
  
          for fn in self._events.get(name, set([])):
              fn(data)
  
          return self
  
subject: change event registry to a set to make sure the same function is not called twice