Switches the team for the dropped agent to the other team
        :param dropped_listwidget: The listwidget belonging to the new team for the agent
        :param event: The QDropEvent containing the source
        :return:
517677
def bot_item_drop_event(self, dropped_listwidget, event):
        
        dragged_listwidget = event.source()
        if dragged_listwidget is dropped_listwidget:  # drops in the same widget
            return
        self.current_bot.set_team(0 if dropped_listwidget == self.blue_listwidget else 1)
        self.update_teams_listwidgets()
1346913
def dropEvent( self, event ):
        
        filt = self.dragDropFilter()
        if ( not filt ):
            super(XCalendarWidget, self).dropEvent(event)
            return
        
        filt(self, event)
395861
def handle_events(self):
        
        for event in pymlgame.get_events():
            if event.type == E_NEWCTLR:
                #print(datetime.now(), '### new player connected with uid', event.uid)
                self.players[event.uid] = {'name': 'alien_{}'.format(event.uid), 'score': 0}
            elif event.type == E_DISCONNECT:
                #print(datetime.now(), '### player with uid {} disconnected'.format(event.uid))
                self.players.pop(event.uid)
            elif event.type == E_KEYDOWN:
                #print(datetime.now(), '###', self.players[event.uid]['name'], 'pressed', event.button)
                self.colors.append(self.colors.pop(0))
            elif event.type == E_KEYUP:
                #print(datetime.now(), '###', self.players[event.uid]['name'], 'released', event.button)
                self.colors.append(self.colors.pop(0))
            elif event.type == E_PING:
                #print(datetime.now(), '### ping from', self.players[event.uid]['name'])
                pass
382955
def hoverMoveEvent(self, event):
        
        # process the parent event
        super(XNode, self).hoverMoveEvent(event)
        
        self._hovered = True
        
        # hover over a hotspot
        hotspot = self.hotspotAt(event.pos())
        if not hotspot:
            hotspot = self.dropzoneAt(event.pos())
        
        old_spot = self._hoverSpot
        
        if hotspot and hotspot != old_spot:
            # update the new hotspot
            self._hoverSpot = hotspot
            
            if old_spot:
                old_spot.hoverLeaveEvent(event)
            
            if hotspot.hoverEnterEvent(event):
                self.update()
        
        elif old_spot and not hotspot:
            self._hoverSpot = None
            
            if old_spot.hoverLeaveEvent(event):
                self.update()

        if hotspot and hotspot.toolTip():
            super(XNode, self).setToolTip(hotspot.toolTip())
        else:
            super(XNode, self).setToolTip(self._toolTip)
110518
def dragEnterEvent( self, event ):
        
        filt = self.dragDropFilter()
        if ( not filt ):
            super(XCalendarWidget, self).dragEnterEvent(event)
            return
        
        filt(self, event)
50543
def dragEnterEvent( self, event ):
        
        filt = self.dragDropFilter()
        if not filt:
            super(XTreeWidget, self).dragEnterEvent(event)
            return
            
        filt(self, event)
1163787
function onPieceDrop(event, ui) {
    var col = $(this).data().col;
    var row = $(this).data().row;
    var piece = $(ui.draggable).data().piece;
    $.ajax({
        type: 'POST',
        url: "/games/" + enc($.cookie("game")) + "/board",
        data: {
            shape: piece.shape,
            color: piece.color,
            row: row,
            column: col
        },
        success: function() {
            $(ERRORS).empty();
        },
        error: function (jqXHR, textStatus, errorThrown) {
            $(ERRORS).empty();
            $(ERRORS).append("<div class='error'>&#9888; "+jqXHR.responseText+"</div>");
        },
        complete: function() {
            $.getJSON("/games/" + enc($.cookie("game")) +
                      "/players", drawTurnInfo);
        }
    });
}
655487
def team_settings_edit_event(self, value=None):
        
        sender = self.sender()
        if value is None:
            value = sender.text()

        if sender is self.blue_name_lineedit:
            self.overall_config.set_value(TEAM_CONFIGURATION_HEADER, "Team Blue Name", value)
        elif sender is self.orange_name_lineedit:
            self.overall_config.set_value(TEAM_CONFIGURATION_HEADER, "Team Orange Name", value)
        elif sender is self.blue_color_spinbox:
            self.overall_config.set_value(TEAM_CONFIGURATION_HEADER, "Team Blue Color", value)
        elif sender is self.orange_color_spinbox:
            self.overall_config.set_value(TEAM_CONFIGURATION_HEADER, "Team Orange Color", value)

        if self.cfg_autosave_checkbutton.isChecked() and os.path.isfile(self.overall_config_path):
            self.save_overall_config(10)
886007
public static void switchFocus (Stage stage, Focusable widget) {
		if (focusedWidget == widget) return;
		if (focusedWidget != null) focusedWidget.focusLost();
		focusedWidget = widget;
		if (stage != null) stage.setKeyboardFocus(null);
		focusedWidget.focusGained();
	}
626397
def send_events(self, events):
        
        for event in events:
            self.queue.events.add().MergeFrom(event)
        return None
771934
def dropped(self, param, event):
        
        if event.source() == self or isinstance(param, AddLabel):
            index = self.indexAt(event.pos())
            self.model().insertRows(index.row(),1)
            if event.source() == self:
                self.model().setData(index, param)
            else:
                self.hintRequested.emit('Select Components in view to modify -- click to toggle membership of component in auto-parameter')
                row = index.row()
                # select rows doesn't work with -ve indexes
                if row == -1:
                    row = self.model().rowCount() - 1
                self.selectRow(row)
                self.parameterChanged.emit(self.model().selection(index))
        self.dragActive.emit(False)
945819
def task_dropped(self):
		
		tracker = self.task().tracker_storage()
		if tracker is not None and self.track_drop() is True:
			details = self.task().event_details(WTrackerEvents.drop)
			tracker.register_drop(self.task(), event_details=details)
		WScheduleRecord.task_dropped(self)
624019
def get_event_team(self, id, team_id, **data):
        
        
        return self.get("/events/{0}/teams/{0}/".format(id,team_id), data=data)
207423
def dropEvent(self, event):
        """"""
        super(TrashWidget, self).dropEvent(event)
        self.itemTrashed.emit()
881074
def manage_event(self, event) -> None:
        
        name = EVENT_NAME.format(
            topic=event[EVENT_TOPIC], source=event.get(EVENT_SOURCE_IDX))

        if event[EVENT_OPERATION] == 'Initialized' and name not in self.events:

            for event_class in EVENT_CLASSES:
                if event_class.TOPIC in event[EVENT_TOPIC]:
                    self.events[name] = event_class(event)
                    self.signal('add', name)
                    return

            _LOGGER.debug('Unsupported event %s', event[EVENT_TOPIC])

        elif event[EVENT_OPERATION] == 'Changed' and name in self.events:
            self.events[name].state = event[EVENT_VALUE]
1292707
def hook_drop(self):
        
        widget = self.widget
        widget.setAcceptDrops(True)
        widget.dragEnterEvent = self.dragEnterEvent
        widget.dragMoveEvent = self.dragMoveEvent
        widget.dragLeaveEvent = self.dragLeaveEvent
        widget.dropEvent = self.dropEvent
1211519
def get_event_teams(self, id, **data):
        
        
        return self.get("/events/{0}/teams/".format(id), data=data)