Get event data from an emitter. Lazily create it if it isn't there.
5519
function eventData(emitter) {
	return emitter[eventEmitter.EVENT_DATA_PROPERTY] || Object.defineProperty(emitter, eventEmitter.EVENT_DATA_PROPERTY, {
		value: {},
		enumerable: false
	})[eventEmitter.EVENT_DATA_PROPERTY];
}
1286025
def eventdata(payload):
    

    headerinfo, data = payload.split('\n', 1)
    headers = get_headers(headerinfo)
    return headers, data
145260
def get_events(self, **kwargs):
        """"""
        force = kwargs.pop('force', False)
        response = api.request_sync_events(self.blink,
                                           self.network_id,
                                           force=force)
        try:
            return response['event']
        except (TypeError, KeyError):
            _LOGGER.error("Could not extract events: %s",
                          response,
                          exc_info=True)
            return False
978413
def _make_event(self, event_type, code, value):
        """"""
        secs, msecs = convert_timeval(time.time())
        data = struct.pack(EVENT_FORMAT,
                           secs,
                           msecs,
                           event_type,
                           code,
                           value)
        self._write_device.write(data)
        self._write_device.flush()
356910
def event_return(events):
    '''
    
    '''

    for event in events:
        ret = event.get('data', False)

        if ret:
            returner(ret)
1079040
function eventPromise (emitter, eventName) {
  return new Promise((resolve, reject) => {
    emitter.on(eventName, (...args) => {
      return resolve(args)
    })
  })
}
1360630
function emit(eventName, params) {

            //jshint unused:false
            var args    = Array.prototype.slice.call(arguments),
                scope   = $ember.get(this, 'socket');

            scope.emit.apply(scope, args);

        }
189369
def event_later(self, delay, data_tuple):
        
        return self._base.event_later(delay, self.make_event_data(*data_tuple))
724908
function PostEmitter() {
	var _this = this;
	//might be global
	this._listener = function(ev) {
		//check origin
		//then
		var data = ev.data;
		_this.emit.apply(_this, data instanceof Array ? data : [data]);
	};
	window[attach](prefix + 'message', this._listener);
}
575655
def _get_events(self, result):
        """""""
        events = []

        for event_data in result:
            event = Event.factory(event_data)

            if event is not None:
                events.append(event)

                if isinstance(event, DeviceStateChangedEvent):
                    # change device state
                    if self.__devices[event.device_url] is None:
                        raise Exception(
                            "Received device change " +
                            "state for unknown device '" +
                            event.device_url + "'")

                    self.__devices[event.device_url].set_active_states(
                        event.states)

        return events
1280869
def get_events(self):
        
        res = self.con.get('_events', wait=False)
        logger.debug("Got events from %s: %s", self.name, res)
        return unserialize(res, True)
558971
def get_intercom_data(self):
        """"""
        data = {
            "event_name": self.get_type_display(),  # event type
            "created_at": calendar.timegm(self.created.utctimetuple()),  # date
            "metadata": self.metadata
        }
        if self.user:
            data["user_id"] = self.user.intercom_id
        return data
1183506
public EventBus emitAsync(EventObject event, Object... args) {
        return _emitWithOnceBus(eventContextAsync(event, args));
    }
377011
async def consume_events(self):
        ''' '''
        # begin by making sure the channel is created
        await self.create_channel()
        # get cursor method
        def create_cursor():
            now = datetime.datetime.utcnow()
            dummy_id = ObjectId.from_datetime(now)
            return self._collection.find({'_id': {'$gte': dummy_id}}, cursor_type=CursorType.TAILABLE_AWAIT)
        # get cursor and start the loop
        cursor = create_cursor()
        while self.active:
            if cursor.alive:
                if (await cursor.fetch_next):
                    message = cursor.next_object()
                    event = message['key']
                    data = message['data']
                    logger.debug('event: %s - %s', event, data)
                    for sub in self._subscribers[event]:
                        await sub.deliver({'type': 'event', 'payload': {'name': event, 'data': data}})
            else:
                await asyncio.sleep(0.1)
                cursor = create_cursor()
214207
def emit(self, event, data=None, room=None, include_self=True,
             namespace=None, callback=None):
        """"""
        return self.socketio.emit(event, data, room=room,
                                  include_self=include_self,
                                  namespace=namespace or self.namespace,
                                  callback=callback)
514430
def get(self, params, **options):
        """"""
        options = self.client._merge_options({ 'full_payload': True })
        return self.client.get('/events', params, **options)
386361
def _event(self, event):
    """"""
    result = dict(
        pid=event.device_id,
        tid=event.resource_id,
        name=event.name,
        ts=event.timestamp_ps / 1000000.0)
    if event.duration_ps:
      result['ph'] = _TYPE_COMPLETE
      result['dur'] = event.duration_ps / 1000000.0
    else:
      result['ph'] = _TYPE_INSTANT
      result['s'] = _SCOPE_THREAD
    for key in dict(event.args):
      if 'args' not in result:
        result['args'] = {}
      result['args'][key] = event.args[key]
    return result