code: def create_event(msg: EventMsgDict) -> Event:
      
      proto = msg.get('proto', '')
      cls = proto_dict.get(proto, Event)
      e = cls(msg['type'], msg)
      return e
docs: Create Event from JSOM msg and set target nodes.
  
      :arg EventTarget currentTarget: Current event target node.
      :arg EventTarget target: Node which emitted this event first.
      :arg dict init: Event options.