Events successful process by tracker adapter
349551
function EventDevPos (device){
         
        // force push of full device info every 20 positions update
        if (device.aisproxy >= 20) adapter.BroadcastStatic (device);
        if ((new Date().getTime() - device.laststatics) > 900000) adapter.BroadcastStatic (device); // force statics every 15mn
        adapter.BroadcastPos (device);
    }
1185029
private void pushEvent(GobblinTrackingEvent event) throws IOException {

    Map<String, String> metadata = event.getMetadata();
    String name = getMetricName(metadata, event.getName());
    long timestamp = event.getTimestamp() / 1000l;
    MultiPartEvent multipartEvent = MultiPartEvent.getEvent(metadata.get(EventSubmitter.EVENT_TYPE));
    if (multipartEvent == null) {
      graphitePusher.push(JOINER.join(prefix, name), EMTPY_VALUE, timestamp);
    }
    else {
      for (String field : multipartEvent.getMetadataFields()) {
        String value = metadata.get(field);
        if (value == null) {
          graphitePusher.push(JOINER.join(prefix, name, field), EMTPY_VALUE, timestamp);
        } else {
          if (emitAsKey(field)) {
            // metric value is emitted as part of the keys
            graphitePusher.push(JOINER.join(prefix, name, field, value), EMTPY_VALUE, timestamp);
          } else {
            graphitePusher.push(JOINER.join(prefix, name, field), convertValue(field, value), timestamp);
          }
        }
      }
    }
  }
378080
def process_stream(self, tree):
        """"""
        try:
            etype = SENSOR_MAP[tree.find(
                self.element_query('eventType')).text.lower()]
            estate = tree.find(
                self.element_query('eventState')).text
            echid = tree.find(
                self.element_query('channelID'))
            if echid is None:
                # Some devices use a different key
                echid = tree.find(
                    self.element_query('dynChannelID'))
            echid = int(echid.text)
            ecount = tree.find(
                self.element_query('activePostCount')).text
        except (AttributeError, KeyError, IndexError) as err:
            _LOGGING.error('Problem finding attribute: %s', err)
            return

        # Take care of keep-alive
        if len(etype) > 0 and etype == 'Video Loss':
            self.watchdog.pet()

        # Track state if it's in the event list.
        if len(etype) > 0:
            state = self.fetch_attributes(etype, echid)
            if state:
                # Determine if state has changed
                # If so, publish, otherwise do nothing
                estate = (estate == 'active')
                old_state = state[0]
                attr = [estate, echid, int(ecount),
                        datetime.datetime.now()]
                self.update_attributes(etype, echid, attr)

                if estate != old_state:
                    self.publish_changes(etype, echid)
                self.watchdog.pet()
150688
@MainThread
    private void handleEventResult(Event event, EventResult result) {
        if (!activeEvents.contains(event)) {
            Utils.logE(event.getKey(), "Cannot send result of finished event");
            return;
        }

        scheduleResultCallbacks(event, result);
        executeTasks(false);
    }
471281
def event_tracker(func):
    
    @wraps(func)
    async def wrapper(*args, **kwargs):
        """
        Wraps function to provide redis
        tracking
        """
        event = Event(args[0])
        session = kwargs['session']
        service_name = session.name
        await track_event(event, EventState.started, service_name)
        await func(*args, **kwargs)
        await track_event(event, EventState.completed, service_name)
    return wrapper
1212216
@Override
  synchronized boolean processHeartbeat(TaskTrackerStatus trackerStatus,
      boolean initialContact) {
    boolean loggingEnabled = LOG.isDebugEnabled();
    String trackerName = trackerStatus.getTrackerName();
    boolean seenBefore = updateTaskTrackerStatus(trackerName, trackerStatus);
    TaskTracker taskTracker = getTaskTracker(trackerName);
    // update the status of the task tracker. Also updates all aggregate
    // statistics
    if (loggingEnabled) {
      LOG.debug("processing heartbeat for " + trackerName);
      LOG.debug("updating TaskTracker status for " + trackerName);
    }
    if (initialContact) {
      // If it's first contact, then clear out 
      // any state hanging around
      if (seenBefore) {
        lostTaskTracker(taskTracker);
      }
    } else {
      // If not first contact, there should be some record of the tracker
      if (!seenBefore) {
        LOG.warn("Status from unknown Tracker : " + trackerName);
        updateTaskTrackerStatus(trackerName, null);
        return false;
      }
    }

    if (initialContact) {
      if (loggingEnabled) {
        LOG.debug("adding new tracker name = " + trackerName);
      }
      addNewTracker(taskTracker);
    }

    if (loggingEnabled) {
      LOG.debug("updating TaskStatus for " + trackerName);
    }
    // update status of all tasks from heartbeat
    updateTaskStatuses(trackerStatus);

    return true;
  }
271030
@Override
    public boolean onTouchEvent(MotionEvent ev) {
        try {
            if (ev == null || getAdapter() == null || getAdapter().getCount() == 0) {
                return false;
            }
            return super.onTouchEvent(ev);
        } catch (RuntimeException e) {
            Log.e(TAG, "Exception during WrapContentViewPager onTouchEvent: " +
                    "index out of bound, or nullpointer even if we check the adapter before " + e.toString());
            return false;
        }
    }
1077547
private void processFileNotifications() throws InterruptedException, TTException, IOException {
        while (true) {
            WatchKey key = mWatcher.take();
            Path dir = mKeyPaths.get(key);
            for (WatchEvent<?> evt : key.pollEvents()) {
                WatchEvent.Kind<?> eventType = evt.kind();
                if (eventType == OVERFLOW)
                    continue;
                Object o = evt.context();
                if (o instanceof Path) {
                    Path path = dir.resolve((Path)evt.context());
                    process(dir, path, eventType);
                }
            }
            key.reset();

            processFsnOnHold();
        }
    }
584263
function onPointerMoveCaptured( tracker, event ) {
        var pointsList = tracker.getActivePointersListByType( getPointerType( event ) );
        if ( pointsList.getById( event.pointerId ) ) {
            handlePointerMove( tracker, event );
        }
        $.stopEvent( event );
    }
414658
private void trackListeners(final BundleContext bundleContext) {
		final ServiceTracker<EventListener, ListenerWebElement> listenerTracker = ListenerTracker
				.createTracker(extenderContext, bundleContext);

		listenerTracker.open();
		trackers.add(0, listenerTracker);

		// FIXME needed?
		final ServiceTracker<ListenerMapping, ListenerMappingWebElement> listenerMappingTracker = ListenerMappingTracker
				.createTracker(extenderContext, bundleContext);

		listenerMappingTracker.open();
		trackers.add(0, listenerMappingTracker);
	}
852461
def _process_event(self, data, url, services_incl_filter=None, services_excl_filter=None, custom_tags=None):
        '''
        
        '''
        hostname = data['svname']
        service_name = data['pxname']
        key = "%s:%s" % (hostname, service_name)
        status = self.host_status[url][key]
        custom_tags = [] if custom_tags is None else custom_tags

        if self._is_service_excl_filtered(service_name, services_incl_filter, services_excl_filter):
            return

        data_status = data['status']
        if status is None:
            self.host_status[url][key] = data_status
            return

        if status != data_status and data_status in ('up', 'down'):
            # If the status of a host has changed, we trigger an event
            try:
                lastchg = int(data['lastchg'])
            except Exception:
                lastchg = 0

            # Create the event object
            ev = self._create_event(
                data_status, hostname, lastchg, service_name, data['back_or_front'], custom_tags=custom_tags
            )
            self.event(ev)

            # Store this host status so we can check against it later
            self.host_status[url][key] = data_status
485331
def ga_track_event(category, action, label = nil, value = nil)
      ga_events.push(GoogleAnalytics::Event.new(category, action, label, value))
    end
864969
def get_event_tracking_beacons(self, event_id, **data):
        
        
        return self.get("/events/{0}/tracking_beacons/".format(event_id), data=data)
376572
def leaveEvent( self, event ):
        
        item = self.trackerItem()
        if ( item ):
            item.setVisible(False)
406566
def on_created(self, event):
        
        self._logger.debug('Detected create event on watched path: %s', event.src_path)

        self._process_event(event)
706954
private Events<Event> getEvents(CanalEventStore eventStore, Position start, int batchSize, Long timeout,
                                    TimeUnit unit) {
        if (timeout == null) {
            return eventStore.tryGet(start, batchSize);
        } else {
            try {
                if (timeout <= 0) {
                    return eventStore.get(start, batchSize);
                } else {
                    return eventStore.get(start, batchSize, timeout, unit);
                }
            } catch (Exception e) {
                throw new CanalServerException(e);
            }
        }
    }
469359
def _wire_events(self):
        
        self._device.on_open += self._on_open
        self._device.on_close += self._on_close
        self._device.on_read += self._on_read
        self._device.on_write += self._on_write
        self._zonetracker.on_fault += self._on_zone_fault
        self._zonetracker.on_restore += self._on_zone_restore