Marks event as the last event we have seen.  If event is an int, it is treated
        as an event_id, otherwise it should be an event object whose id will be used.
547127
def events_mark_seen(self, event):
        
        last_seen = event if isinstance(event, int) else event.id
        self.client.post('{}/seen'.format(Event.api_endpoint), model=Event(self.client, last_seen))
294625
function (eventId) {
      var i;
      for (i = 0; i < this._events.length; i++) {
         var evt = this._events[i];
         if (evt.eventId === eventId) {
            return evt;
         }
      }
      return false;
   }
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
376572
def leaveEvent( self, event ):
        
        item = self.trackerItem()
        if ( item ):
            item.setVisible(False)
753243
public function eventAfterDelete()
    {
        $this->updateNavItemTimesamp();
        if (!empty($this->_olds)) {
            $this->reindex($this->_olds['nav_item_page_id'], $this->_olds['placeholder_var'], $this->_olds['prev_id']);
        }
    }
632171
public static function updateLastVisit($event)
    {
        if ($event->isValid) {
            /**
             * @var User $user
             */
            $user = $event->identity;
            $user->last_visit_at = time();
            $user->updateAttributes(['last_visit_at']);
            return true;
        }
        return false;
    }
799954
def _getEventFromUid(self, request, uid):
        """"""
        event = getEventFromUid(request, uid)
        if event.get_ancestors().filter(id=self.id).exists():
            # only return event if it is a descendant
            return event
1203297
def generate_new_id(self):
        
        self.events.append(Event())
        indiv_id = self.indiv_counter
        self.indiv_counter += 1
        return indiv_id
297373
public int lastIndexOf(Object o) {
		int index = -1;
		try {
			for (int i = 0; i < events.size(); i++) {
				if (events.get(i).equals(o)) {
					index = i;
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return index;
	}
505760
def validate_event_and_assign_id(event):
  
  event_time = event.get(TIMESTAMP_FIELD)

  if event_time is None:
    event[TIMESTAMP_FIELD] = event_time = epoch_time_to_kronos_time(time.time())
  elif type(event_time) not in (int, long):
    raise InvalidEventTime(event_time)

  # Generate a uuid1-like sequence from the event time with the non-time bytes
  # set to random values.
  _id = uuid_from_kronos_time(event_time)
  event[ID_FIELD] = str(_id)
  return _id, event
268081
def _notifyDone(self):
        '''
        
        '''
        if self.notified:
            return

        self.doneevent.set()

        for buid in self.mybldgbuids:
            del self.allbldgbuids[buid]

        self.notified = True
574989
synchronized void nextEvent() {
        if (currentPosition > positionOfLastSync) {
            throw new IllegalStateException("Cannot advance past the last" +
                                                    " EV_SYN EV_SYN_REPORT 0");
        }
        currentPosition += eventStruct.getSize();
        if (MonocleSettings.settings.traceEventsVerbose && hasNextEvent()) {
            MonocleTrace.traceEvent("Processing %s [index=%d]",
                                    getEventDescription(), currentPosition);
        }
    }
615711
def post_event_cancel(self, id, **data):
        
        
        return self.post("/events/{0}/cancel/".format(id), data=data)
1010791
protected void checkIdle ()
    {
        long now = getTimeStamp();

        switch (_state) {
        case ACTIVE:
            // check whether they've idled out
            if (now >= (_lastEvent + _toIdleTime)) {
                log.info("User idle for " + (now-_lastEvent) + "ms.");
                _state = IDLE;
                idledOut();
            }
            break;

        case IDLE:
            // check whether they've been idle for too long
            if (now >= (_lastEvent + _toIdleTime + _toAbandonTime)) {
                log.info("User idle for " + (now-_lastEvent) + "ms. " +
                         "Abandoning ship.");
                _state = ABANDONED;
                abandonedShip();
            }
            break;
        }
    }
910470
def write_event(self, etype, code, value):
        """"""
        last_value = self._write_cache.get(code)
        if last_value != value:
            self.device.write(etype, code, value)
            self._write_cache[code] = value
197663
function interpret_events() {

        // Do not prevent default if no event could be interpreted
        var handled_event = interpret_event();
        if (!handled_event)
            return false;

        // Interpret as much as possible
        var last_event;
        do {
            last_event = handled_event;
            handled_event = interpret_event();
        } while (handled_event !== null);

        return last_event.defaultPrevented;

    }
975865
def delete_event(self, calendar_id, event_id):
        
        self.request_handler.delete(endpoint='calendars/%s/events' % calendar_id, data={'event_id': event_id})