Handles incoming raw sensor data
        :param event: Raw sentences incoming data
973125
def raw_data(self, event):
        

        self.log('Received raw data from bus', lvl=events)
        if not parse:
            return

        nmea_time = event.data[0]
        try:
            parsed_data = parse(event.data[1])
        except Exception as e:
            self.log('Unparseable sentence:', event.data[1], e, type(e),
                     exc=True, lvl=warn)
            self.unparsable += event
            return

        bus = event.bus

        sensor_data_package = self._handle(parsed_data)

        self.log("Sensor data:", sensor_data_package, lvl=verbose)

        if sensor_data_package:
            # pprint(sensor_data_package)
            self.fireEvent(sensordata(sensor_data_package, nmea_time, bus),
                           "navdata")
286603
def on_message(self, data):
        
        # Trying to parse response
        data = json.loads(data)
        if not data["name"] is None:
            logging.debug("%s: receiving message %s" % (data["name"], data["data"]))
            fct = getattr(self, "on_" + data["name"])
            try:
                res = fct(Struct(data["data"]))
            except:
                # We try without Struct item (on transaction request this can happend)
                res = fct(data["data"])
            if res is not None:
                self.write_message(res)
        else:
            logging.error("SockJSDefaultHandler: data.name was null")
721322
def _FormatMessage(self, event):
    
    message, _ = self._output_mediator.GetFormattedMessages(event)
    if message is None:
      data_type = getattr(event, 'data_type', 'UNKNOWN')
      raise errors.NoFormatterFound(
          'Unable to find event formatter for: {0:s}.'.format(data_type))

    return message
462903
def handle_events(self):
        
        for event in sys.stdin:
            if event.startswith('['):
                continue
            name = json.loads(event.lstrip(','))['name']
            for obj in self.loader.objects:
                if obj.output_options['name'] == name:
                    obj.on_click(json.loads(event.lstrip(',')))
889758
function onMessage(event) {
    if (!channel._websocket) return

    var message = JSON.parse(event.data)

    channel.emit("message", message)
  }
156451
def process_event(self, event):
        
        # Convert into absolute coordinates if needed.
        new_event = event
        if self._absolute:
            new_event.y -= self._canvas.start_line

        # Process event if needed.
        if self.is_mouse_over(new_event) and event.buttons != 0:
            self._set_pos((new_event.y - self._y) / (self._height - 1))
            return True
        return False
578497
async def handler(event):
    """"""
    await asyncio.wait([
        event.delete(),
        event.respond(
            LEARN_PYTHON, reply_to=event.reply_to_msg_id, link_preview=False)
    ])
823638
def on_data(self, raw_data):
        
        data = json.loads(raw_data)

        message_type = data['meta'].get('type')
        prepare_method = 'prepare_%s' % (message_type)
        args = getattr(self, prepare_method, self.prepare_fallback)(data.get('data'))

        method_name = 'on_%s' % (message_type,)
        func = getattr(self, method_name, self.on_fallback)

        func(*args, meta=StreamingMeta.from_response_data(data.get('meta'), self.api))
337975
def handle_stream(msg):
    """"""
    if not msg.gateway.is_sensor(msg.node_id):
        return None
    stream = msg.gateway.const.Stream(msg.sub_type)
    handler = stream.get_handler(msg.gateway.handlers)
    if handler is None:
        return None
    return handler(msg)
967203
def handle_event(self, event):
        
        result_id, ptr, method, args = event[1]
        obj = None
        result = None
        try:
            obj, handler = bridge.get_handler(ptr, method)
            result = handler(*[v for t, v in args])
        except bridge.BridgeReferenceError as e:
            #: Log the event, don't blow up here
            msg = "Error processing event: {} - {}".format(
                  event, e).encode("utf-8")
            print(msg)
            self.show_error(msg)
        except:
            #: Log the event, blow up in user's face
            msg = "Error processing event: {} - {}".format(
                  event, traceback.format_exc()).encode("utf-8")
            print(msg)
            self.show_error(msg)
            raise
        finally:
            if result_id:
                if hasattr(obj, '__nativeclass__'):
                    sig = getattr(type(obj), method).__returns__
                else:
                    sig = type(result).__name__

                self.send_event(
                    bridge.Command.RESULT,  #: method
                    result_id,
                    bridge.msgpack_encoder(sig, result)  #: args
                )
573421
def process_data(self):

        
        self.trigger("process-data", self.received_data)
        self.received_data = ""
        if self.dispatcher:
            self.time = self.dispatcher.time
1286025
def eventdata(payload):
    

    headerinfo, data = payload.split('\n', 1)
    headers = get_headers(headerinfo)
    return headers, data
1369459
def _process_event(self, event, tagged_data):
    """"""
    event_type = event.WhichOneof('what')
    # Handle the most common case first.
    if event_type == 'summary':
      for value in event.summary.value:
        value = data_compat.migrate_value(value)
        tag, metadata, values = tagged_data.get(value.tag, (None, None, []))
        values.append((event.step, event.wall_time, value.tensor))
        if tag is None:
          # Store metadata only from the first event.
          tagged_data[value.tag] = sqlite_writer.TagData(
              value.tag, value.metadata, values)
    elif event_type == 'file_version':
      pass  # TODO: reject file version < 2 (at loader level)
    elif event_type == 'session_log':
      if event.session_log.status == event_pb2.SessionLog.START:
        pass  # TODO: implement purging via sqlite writer truncation method
    elif event_type in ('graph_def', 'meta_graph_def'):
      pass  # TODO: support graphs
    elif event_type == 'tagged_run_metadata':
      pass
460538
def handler(event, context):
    
    records = deserialize_records(event['Records'])

    # Split records into two groups, update and delete.
    # We don't want to query for deleted records.
    update_records, delete_records = group_records_by_type(records)
    capture_delete_records(delete_records)

    # filter out error events
    update_records = [e for e in update_records if not e['detail'].get('errorCode')]

    # group records by account for more efficient processing
    log.debug('Update Records: {records}'.format(records=records))

    capture_update_records(update_records)
438957
def _process_raw_report(self, raw_report):
        ""
        if not self.is_opened():
            return
        if not self.__evt_handlers and not self.__raw_handler:
            return

        if not raw_report[0]  and \
                (raw_report[0] not in self.__input_report_templates):
            # windows sends an empty array when disconnecting
            # but, this might have a collision with report_id = 0
            if not hid_device_path_exists(self.device_path):
                #windows XP sends empty report when disconnecting
                self.__reading_thread.abort() #device disconnected
            return

        if self.__raw_handler:
            #this might slow down data throughput, but at the expense of safety
            self.__raw_handler(helpers.ReadOnlyList(raw_report))
            return

        # using pre-parsed report templates, by report id
        report_template = self.__input_report_templates[raw_report[0]]
        # old condition snapshot
        old_values = report_template.get_usages()
        # parse incoming data
        report_template.set_raw_data(raw_report)
        # and compare it
        event_applies = self.evt_decision
        evt_handlers  = self.__evt_handlers
        for key in report_template.keys():
            if key not in evt_handlers:
                continue
            #check if event handler exist!
            for event_kind, handlers in evt_handlers[key].items():
                #key=event_kind, values=handler set
                new_value = report_template[key].value
                if not event_applies[event_kind](old_values[key], new_value):
                    continue
                #decision applies, call handlers
                for function_handler in handlers:
                    #check if the application wants some particular parameter
                    if handlers[function_handler]:
                        function_handler(new_value,
                                event_kind, handlers[function_handler])
                    else:
                        function_handler(new_value, event_kind)
1344047
function handleMessages(event) {
  if (!isAllowed()) return;
  if (!event || event.source !== window || typeof event.data !== 'object') return;
  const message = event.data;
  if (message.source !== pageSource) return;
  if (message.type === 'DISCONNECT') {
    if (bg) {
      bg.disconnect();
      connected = false;
    }
    return;
  }

  tryCatch(send, message);
}
251291
def _handle_chat_event(self, event: events.ChatMessageWasReceived) -> None:
        
        for subscriber in self._chat_subscribers:
            try:
                subscriber(event)
            except Exception:
                LOG.exception(self._prefix_log_message(
                    f"failed to send chat event {event} to "
                    f"subscriber {subscriber}"
                ))