On event.

@param event the event
@return true, if successful
773582
public boolean process(ContentEvent event) {
		InstanceContentEvent inEvent = (InstanceContentEvent) event; //((s4Event) event).getContentEvent();
		//InstanceEvent inEvent = (InstanceEvent) event;

		if (inEvent.getInstanceIndex() < 0) {
			// End learning
			predictionStream.put(event);
			return false;
		}


                if (inEvent.isTesting()){ 
			Instance trainInst = inEvent.getInstance();
			for (int i = 0; i < sizeEnsemble; i++) {
				Instance weightedInst = trainInst.copy();
				//weightedInst.setWeight(trainInst.weight() * k);
				InstanceContentEvent instanceContentEvent = new InstanceContentEvent(
						inEvent.getInstanceIndex(), weightedInst, false, true);
				instanceContentEvent.setClassifierIndex(i);
				instanceContentEvent.setEvaluationIndex(inEvent.getEvaluationIndex());	
				predictionStream.put(instanceContentEvent);
			}
		}
                
                		/* Estimate model parameters using the training data. */
		if (inEvent.isTraining()) {
			train(inEvent);
		} 
		return false;
	}
131137
public function off(string $event): bool
    {
        if ($this->hasEvent($event)) {
            unset(self::$events[$event], self::$eventHandlers[$event]);

            return true;
        }

        return false;
    }
826575
public boolean add(SimulatorEvent event) {
    if (lastEvent != null && event.getTimeStamp() < lastEvent.getTimeStamp())
      throw new IllegalArgumentException("Event happens in the past: "
          + event.getClass());

    event.setInternalCount(eventCount++);
    return events.add(event);
  }
1301744
def on_event(self, event):
        ''''''
        state = self.state
        if isinstance(event, wx.MouseEvent):
            self.on_mouse_event(event)
        if isinstance(event, wx.KeyEvent):
            self.on_key_event(event)
        if (isinstance(event, wx.MouseEvent) and
            not event.ButtonIsDown(wx.MOUSE_BTN_ANY) and
            event.GetWheelRotation() == 0):
            # don't flood the queue with mouse movement
            return
        evt = mp_util.object_container(event)
        pt = self.image_coordinates(wx.Point(evt.X,evt.Y))
        evt.X = pt.x
        evt.Y = pt.y
        state.out_queue.put(evt)
304542
protected void onMove(Event event) {

        m_clientX = event.getClientX();
        m_clientY = event.getClientY();
        checkTargets();
        positionHelper();
        scrollAction();
    }
57492
def handle(self, event):
        
        callback = getattr(self, 'on_{event}'.format(event=event.event), None)
        callback(event)
701895
public void processEvent(EventObject event) {
    if (event instanceof RequestEvent) {
      processRequestEvent((RequestEvent) event);
    } else {
      LOG.error("invalid event type received: " + event.getClass().getName() + ": "
          + event.toString());
    }
  }
995456
@Override
  public void onNext(final T event) {
    final EventHandler<T> handler = (EventHandler<T>) map.get(event.getClass());
    if (handler == null) {
      throw new WakeRuntimeException("No event " + event.getClass() + " handler");
    }
    handler.onNext(event);
  }
267849
public static void on(String op, OnListener listener) {
        getInstance().mEvents.add(new Event(op, listener));
    }
146897
function on (el, event, handler) {
  if (el.addEventListener) {
    el.addEventListener(event, handler)
  } else {
    el.attachEvent('on' + event, function () {
      handler.call(el)
    })
  }
}
195039
public void processEvent(EventObject event) {
    if (event instanceof RequestEvent) {
      processRequest((RequestEvent) event);
    } else if (event instanceof ResponseEvent) {
      processResponse((ResponseEvent) event);
    } else if (event instanceof TimeoutEvent) {
      processTimeout((TimeoutEvent) event);
    } else {
      LOG.error("invalid event type received: {}: {}", event.getClass().getName(), event.toString());
    }
  }
402916
@EventHandler("command")
    private void onCommand(CommandEvent event) {
        if (isEnabled()) {
            for (BaseComponent child : container.getChildren()) {
                EventUtil.send(event, child);

                if (event.isStopped()) {
                    break;
                }
            }
        }
    }
38999
function(event) {
                if(event.preventDefault && event.cancelable)
                    event.preventDefault();
                else
                    event.returnValue = false;
            }
501165
private void onMessageSent(MessageSentEvent event) {
        handler.post(() -> listener.onMessageSent(event));
        log("Event published " + event.toString());
    }
730610
protected void fireEvent(E event) {

    for (L listener : this.listeners) {
      try {
        fireEvent(event, listener);
      } catch (RuntimeException e) {
        handleListenerError(listener, event, e);
      }
    }
  }
758327
function( event ) {
            event = $.getEvent( event );

            if ( event.preventDefault ) {
                $.cancelEvent = function( event ){
                    // W3C for preventing default
                    event.preventDefault();
                };
            } else {
                $.cancelEvent = function( event ){
                    event = $.getEvent( event );
                    // legacy for preventing default
                    event.cancel = true;
                    // IE for preventing default
                    event.returnValue = false;
                };
            }
            $.cancelEvent( event );
        }
974466
@Override
    public void onBrowserEvent(Event event) {

        super.onBrowserEvent(event);

        switch (DOM.eventGetType(event)) {
            case Event.ONMOUSEUP:
                Event.releaseCapture(m_slider.getElement());
                m_capturedMouse = false;
                break;
            case Event.ONMOUSEDOWN:
                Event.setCapture(m_slider.getElement());
                m_capturedMouse = true;
                //$FALL-THROUGH$
            case Event.ONMOUSEMOVE:
                if (m_capturedMouse) {
                    event.preventDefault();
                    float x = ((event.getClientX() - (m_colorUnderlay.getAbsoluteLeft())) + Window.getScrollLeft());
                    float y = ((event.getClientY() - (m_colorUnderlay.getAbsoluteTop())) + Window.getScrollTop());

                    if (m_parent != null) {
                        m_parent.onMapSelected(x, y);
                    }

                    setSliderPosition(x, y);
                }
                //$FALL-THROUGH$
            default:

        }
    }