Retrieves the properties as event data.

    Args:
      data_type (str): event data type.

    Returns:
      EventData: event data.
188367
def GetEventData(self, data_type):
    
    event_data = events.EventData(data_type=data_type)
    for property_name, property_value in iter(self._properties.items()):
      if isinstance(property_value, py2to3.BYTES_TYPE):
        property_value = repr(property_value)
      setattr(event_data, property_name, property_value)

    return event_data
184950
def get_listeners(self, event_type: str) -> List[Callable]:
        """"""
        if event_type not in self.events:
            raise ValueError(f'No event {event_type} in system.')
        return self.events.get_listeners(event_type)
1110959
def processEvents(self, data):
        
        objc = self.objc
        bridge = self.bridge
        #: This must come after the above as it changes the arguments!
        objc.objc_msgSend.argtypes = [ctypes.c_void_p, ctypes.c_void_p,
                                      ctypes.c_char_p, ctypes.c_int]
        objc.objc_msgSend(
            bridge, objc.sel_registerName('processEvents:length:'),
            data, len(data))
1129114
def get_type_data(name):
    
    name = name.upper()
    if name in CALENDAR_TYPES:
        domain = 'Calendar Types'
        calendar_name = CALENDAR_TYPES[name]
    elif name in ANCIENT_CALENDAR_TYPES:
        domain = 'Ancient Calendar Types'
        calendar_name = ANCIENT_CALENDAR_TYPES[name]
    elif name in ALTERNATE_CALENDAR_TYPES:
        domain = 'Alternative Calendar Types'
        calendar_name = ALTERNATE_CALENDAR_TYPES[name]
    else:
        raise NotFound('Calendar Type: ' + name)

    return {
        'authority': 'okapia.net',
        'namespace': 'calendar',
        'identifier': name,
        'domain': domain,
        'display_name': calendar_name + ' Calendar Type',
        'display_label': calendar_name,
        'description': ('The time type for the ' + calendar_name + ' calendar.')
    }
1267707
def get_datatype(self, propid):
        """"""
        if _debug: Object._debug("get_datatype %r", propid)

        # get the property
        prop = self._properties.get(propid)
        if not prop:
            raise PropertyError(propid)

        # return the datatype
        return prop.datatype
246309
public <R> R getData(Class<R> dataType) {
        return GSON.fromJson(data, dataType);
    }
1248029
def _generate_union_class_repr(self, data_type):
        
        self.emit('def __repr__(self):')
        with self.indent():
            self.emit("return '{}(%r, %r)' % (self._tag, self._value)".format(
                class_name_for_data_type(data_type),
            ))
        self.emit()
1225726
def libvlc_event_type_name(event_type):
    '''
    '''
    f = _Cfunctions.get('libvlc_event_type_name', None) or \
        _Cfunction('libvlc_event_type_name', ((1,),), None,
                    ctypes.c_char_p, ctypes.c_uint)
    return f(event_type)
1192080
def event_type(self, event_type):
        
        if event_type is not None and len(event_type) > 100:
            raise ValueError("Invalid value for `event_type`, length must be less than or equal to `100`")

        self._event_type = event_type
297670
def sensordata(self, event):
        

        if len(self.datatypes) == 0:
            return

        data = event.data
        timestamp = event.timestamp
        # bus = event.bus

        # TODO: What about multiple busses? That is prepared, but how exactly
        # should they be handled?

        self.log("New incoming navdata:", data, lvl=verbose)

        for name, value in data.items():
            if name in self.datatypes:
                ref = self.datatypes[name]
                self.sensed[name] = ref

                if ref.lastvalue != str(value):
                    # self.log("Reference outdated:", ref._fields)

                    item = {
                        'value': value,
                        'timestamp': timestamp,
                        'type': name
                    }

                    self.referenceframe[name] = value
                    self.referenceages[name] = timestamp

                    # self.log("Subscriptions:", self.subscriptions, ref.name)
                    if ref.name in self.subscriptions:

                        packet = {
                            'component': 'hfos.navdata.sensors',
                            'action': 'update',
                            'data': item
                        }

                        self.log("Serving update: ", packet, lvl=verbose)
                        for uuid in self.subscriptions[ref.name]:
                            self.log("Serving to ", uuid, lvl=events)
                            self.fireEvent(send(uuid, packet),
                                           'hfosweb')

                    # self.log("New item: ", item)
                    sensordata = objectmodels['sensordata'](item)
                    # self.log("Value entry:", sensordata._fields)

                    if ref.record:
                        self.log("Recording updated reference:",
                                 sensordata._fields)
                        sensordata.save()

                    ref.lastvalue = str(value)
                    ref.timestamp = timestamp
            else:
                self.log("Unknown sensor data received!", data, lvl=warn)
77016
def publish_event(self, data, suffix=''):
        
        try:
            event_type = data.pop('event_type')
        except KeyError:
            return {'result': 'error', 'message': 'Missing event_type in JSON data'}

        return self.publish_event_from_dict(event_type, data)
435726
def get_event(self, event_key):
    

    event = self.event_key_map.get(event_key)

    if event:
      return event

    self.logger.error('Event "%s" is not in datafile.' % event_key)
    self.error_handler.handle_error(exceptions.InvalidEventException(enums.Errors.INVALID_EVENT_KEY_ERROR))
    return None
1286025
def eventdata(payload):
    

    headerinfo, data = payload.split('\n', 1)
    headers = get_headers(headerinfo)
    return headers, data
77389
def GetDataAsObject(self):
    
    if not self._data:
      return None

    if self._data_type in self._STRING_VALUE_TYPES:
      try:
        return self._data.decode('utf-16-le')

      # AttributeError is raised when self._data has no decode method.
      except AttributeError as exception:
        raise errors.WinRegistryValueError((
            'Unsupported data type: {0!s} of value: {1!s} with error: '
            '{2!s}').format(type(self._data), self._name, exception))

      except UnicodeError as exception:
        raise errors.WinRegistryValueError(
            'Unable to decode data of value: {0!s} with error: {1!s}'.format(
                self._name, exception))

    elif (self._data_type == definitions.REG_DWORD and
          self._data_size == 4):
      return self._INT32_LITTLE_ENDIAN.MapByteStream(self._data)

    elif (self._data_type == definitions.REG_DWORD_BIG_ENDIAN and
          self._data_size == 4):
      return self._INT32_BIG_ENDIAN.MapByteStream(self._data)

    elif (self._data_type == definitions.REG_QWORD and
          self._data_size == 8):
      return self._INT64_LITTLE_ENDIAN.MapByteStream(self._data)

    elif self._data_type == definitions.REG_MULTI_SZ:
      try:
        utf16_string = self._data.decode('utf-16-le')
        # TODO: evaluate the use of filter here is appropriate behavior.
        return list(filter(None, utf16_string.split('\x00')))

      # AttributeError is raised when self._data has no decode method.
      except AttributeError as exception:
        raise errors.WinRegistryValueError((
            'Unsupported data type: {0!s} of value: {1!s} with error: '
            '{2!s}').format(type(self._data), self._name, exception))

      except UnicodeError as exception:
        raise errors.WinRegistryValueError(
            'Unable to read data from value: {0!s} with error: {1!s}'.format(
                self._name, exception))

    return self._data
661712
function EventData(eventId, type, isJson, data, metadata) {
  if (!isValidId(eventId)) throw new TypeError("eventId must be a string containing a UUID.");
  if (typeof type !== 'string' || type === '') throw new  TypeError("type must be a non-empty string.");
  if (isJson && typeof isJson !== 'boolean') throw new TypeError("isJson must be a boolean.");
  if (data && !Buffer.isBuffer(data)) throw new TypeError("data must be a Buffer.");
  if (metadata && !Buffer.isBuffer(metadata)) throw new TypeError("metadata must be a Buffer.");

  this.eventId = eventId;
  this.type = type;
  this.isJson = isJson || false;
  this.data = data || new Buffer(0);
  this.metadata = metadata || new Buffer(0);
  Object.freeze(this);
}
189813
def record(self,
               event_type: str,
               event_data: Mapping = None,
               instance: Any = None,
               **kwargs) -> 'Event':
        
        if not self.is_setup:
            return
        if not self.can_handle(event_type=event_type):
            return

        event = self.get_event(event_type=event_type,
                               event_data=event_data,
                               instance=instance,
                               **kwargs)
        self.record_event(event)
        return event
189981
def gt(self, event_property, value):
        
        c = self.copy()
        c.filters.append(filters.GT(event_property, value))
        return c