Reimplement Qt method to allow cyclic behavior.
543632
def keyPressEvent(self, event):
        """"""
        if event.key() == Qt.Key_Down:
            self.select_row(1)
        elif event.key() == Qt.Key_Up:
            self.select_row(-1)
1284508
def keyPressEvent(self, event):
        """"""
        event_key = event.key()
        if not event_key or event_key == Qt.Key_unknown:
            return
        if len(self._qsequences) == 4:
            # QKeySequence accepts a maximum of 4 different sequences.
            return
        if event_key in [Qt.Key_Control, Qt.Key_Shift,
                         Qt.Key_Alt, Qt.Key_Meta]:
            # The event corresponds to just and only a special key.
            return

        translator = ShortcutTranslator()
        event_keyseq = translator.keyevent_to_keyseq(event)
        event_keystr = event_keyseq.toString(QKeySequence.PortableText)
        self._qsequences.append(event_keystr)
        self.update_warning()
702955
def suspend(rq, ctx, duration):
    ""
    ctx.invoke(
        rq_cli.suspend,
        duration=duration,
        **shared_options(rq)
    )
1028925
def keyPressEvent(self, event):
        """"""
        event, text, key, ctrl, shift = restore_keyevent(event)
        cursor_position = self.get_position('cursor')

        if cursor_position < self.header_end_pos:
            self.restrict_cursor_position(self.header_end_pos, 'eof')
        elif key == Qt.Key_Delete:
            if self.has_selected_text():
                self.remove_text()
            else:
                self.stdkey_clear()
        elif key == Qt.Key_Backspace:
            if self.has_selected_text():
                self.remove_text()
            elif self.header_end_pos == cursor_position:
                return
            else:
                self.stdkey_backspace()
        elif key == Qt.Key_X and ctrl:
            self.cut()
        else:
            CodeEditor.keyPressEvent(self, event)
603959
def keyPressEvent(self, event):
        
        if event.key() in (Qt.Key_Enter, Qt.Key_Return):
            self.queryEntered.emit(self.query())
        
        super(XOrbQuickFilterWidget, self).keyPressEvent(event)
758939
def accept(self):
        """"""
        for index in range(self.stack.count()):
            self.stack.widget(index).accept_changes()
        QDialog.accept(self)
250060
def interact(self,
	            msg='SHUTIT PAUSE POINT',
	            shutit_pexpect_child=None,
	            print_input=True,
	            level=1,
	            resize=True,
	            color='32',
	            default_msg=None,
	            wait=-1):
		""""""
		shutit_global.shutit_global_object.yield_to_draw()
		self.pause_point(msg=msg,
		                 shutit_pexpect_child=shutit_pexpect_child,
		                 print_input=print_input,
		                 level=level,
		                 resize=resize,
		                 color=color,
		                 default_msg=default_msg,
		                 interact=True,
		                 wait=wait)
159292
def mousePressEvent(self, event):
        """"""
        if event.button() == Qt.LeftButton:
            self.__drag_start_pos = QPoint(event.pos())
        QTabBar.mousePressEvent(self, event)
1019533
def OnWidget(self, event):
        """'"""

        self.choice_dialects.SetValue(len(self.choices['dialects']) - 1)
        event.Skip()
78892
def toggle_input(self):
        """"""
        current_index = self.input.currentIndex()
        # If current input is not a radio button enabler, disable radio button.
        if self.input.itemData(current_index, Qt.UserRole) != (
                self.radio_button_enabler):
            self.disable_radio_button()
        # Otherwise, enable radio button.
        else:
            self.enable_radio_button()
242864
def qteIsMiniApplet(self, obj):
        
        try:
            ret = obj._qteAdmin.isMiniApplet
        except AttributeError:
            ret = False

        return ret
495506
def set_widgets(self):
        """"""
        self.tblFunctions1.horizontalHeader().setSectionResizeMode(
            QHeaderView.Stretch)
        self.tblFunctions1.verticalHeader().setSectionResizeMode(
            QHeaderView.Stretch)

        self.populate_function_table_1()
1336559
void resetSequential() {
        seq = nextLong(prand, maxSeq);
        inc = minInc + nextLong(prand, maxInc - minInc);
    }
1370746
def mousePressEvent(self, event):
        """"""
        index = self.indexAt(event.pos())
        if index.isValid():
            if index.column() == 0:
                self.edit(index, QtGui.QAbstractItemView.DoubleClicked, event)
            else:
                super(ProtocolView, self).mousePressEvent(event)
1013191
def randomToggle(self, randomize):
        """"""
        if randomize:
            self._stim.setReorderFunc(order_function('random'), 'random')
        else:
            self._stim.reorder = None
64052
def focusInEvent(self, event):
        """"""
        show_status = getattr(self.lineEdit(), 'show_status_icon', None)
        if show_status:
            show_status()
        QComboBox.focusInEvent(self, event)
1333854
def control_force(self,c):
        ''''''
        
        # bring instance variables into local scope
        g = self.g
        s = self.s
        
        return g * (2/π) * arctan((s/g) * c)