Close the candidate config, be ready for voting (optional)
979789
public function setStateToVote () : bool
    {
        if ( $this->_State === 1 ) :
                if (empty($this->_Candidates)) :
                    throw new CondorcetException(20);
                endif;

                $this->_State = 2;

        // If voting continues after a first set of results
        elseif ( $this->_State > 2 ) :
                $this->cleanupResult();
        endif;

        return true;
    }
926462
def closeEvent(self, event):
        
        logger.debug("closeEvent")
        self.argosApplication.saveSettingsIfNeeded()
        self.finalize()
        self.argosApplication.removeMainWindow(self)
        event.accept()
        logger.debug("closeEvent accepted")
802045
function handleRemovedConfigItems(_a) {
    var fileInitialState = _a.fileInitialState, memoryInitialState = _a.memoryInitialState;
    var removedItems = memoryInitialState.filter(function (bsItem) {
        var removedItem = !fileInitialState.find(function (fileItem) { return bsItem.key === fileItem.key; });
        return removedItem;
    });
    if (removedItems.length > 0) {
        console.log('REMOVED CONFIG: ', removedItems);
    }
    removedItems.forEach(function (removedItem) {
        removeItemFromBrowserStorage(removedItem);
    });
}
259575
function (rep, callback) {
                if (_.isFunction(config.prepare)) {
                    config.prepare(rep, wrap(callback));
                } else {
                    callback(null, rep);
                }
            }
979923
def closeEvent( self, event ):
        
        if ( XConfigDialog._instance == self ):
            XConfigDialog._instance = None
        
        super(XConfigDialog, self).closeEvent(event)
674599
def clean(self):
        
        super().clean()

        # At least a poster (user) or a session key must be associated with
        # the vote instance.
        if self.voter is None and self.anonymous_key is None:
            raise ValidationError(_('A user id or an anonymous key must be used.'))
        if self.voter and self.anonymous_key:
            raise ValidationError(_('A user id or an anonymous key must be used, but not both.'))
44151
def clean(self, *args, **kwargs):
        
        if not self.pk:
            # ensure voting for this node is allowed
            if self.node.participation_settings.voting_allowed is not True:
                raise ValidationError("Voting not allowed for this node")

            if 'nodeshot.core.layers' in settings.INSTALLED_APPS:
                layer = self.node.layer

                # ensure voting for this layer is allowed
                if layer.participation_settings.voting_allowed is not True:
                    raise ValidationError("Voting not allowed for this layer")
72724
void cancelEdit() {

        m_handler.enableToolbarButtons();
        m_handler.activateSelection();
        m_handler.m_controller.setContentEditing(false);
        m_handler.m_controller.reInitInlineEditing();
        m_replaceElement = null;
        m_dependingElementId = null;
        m_currentElementId = null;
        m_editorOpened = false;
    }
244271
function OnTimeoutPrevote(){
    if(h_prevote_timeout === h_p && p_prevote_timeout === p_p && step_p === constants.BYZANTINE_PREVOTE){
        console.log("byllllogg broadcastPrecommit timeout OnTimeoutPrevote:" + h_p + ":" + p_p + ":" + h_prevote_timeout + ":" + p_prevote_timeout + ": null");
        pushByzantinePrecommit(h_prevote_timeout, p_prevote_timeout, null, address_p, null, 0);
        broadcastPrecommit(h_prevote_timeout, p_prevote_timeout, null, null);
        step_p = constants.BYZANTINE_PRECOMMIT;
    }
    h_prevote_timeout   = -1;
    p_prevote_timeout   = -1;

    handleByzantine();

    // if proposer down
    // if(!assocByzantinePhase[h_p].phase[p_p].proposal || 
    //     typeof assocByzantinePhase[h_p].phase[p_p].proposal === 'undefined' || 
    //     Object.keys(assocByzantinePhase[h_p].phase[p_p].proposal).length === 0 ||
    //     !assocByzantinePhase[h_p].phase[p_p].proposal.idv ||
    //     typeof assocByzantinePhase[h_p].phase[p_p].proposal.idv === 'undefined'){
    //     console.log("byllllogg timeout startPhase OnTimeoutPrevote:" + h_p + ":" + p_p + ":" + h_precommit_timeout + ":" + p_precommit_timeout);
    //     h_propose_timeout = -1;
    //     p_propose_timeout = -1; 
    //     h_precommit_timeout = -1;
    //     p_precommit_timeout = -1; 
    //     startPhase(h_p, p_p+1);        
    // }
}
1046817
function reset_poll()
	{
		global $db;

		$db->sql_transaction('begin');
		$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
			SET poll_option_total = 0
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$this->poll_start = time();
		$this->poll_last_vote = 0;
		$sql = 'UPDATE ' . TOPICS_TABLE . '
			SET poll_start = ' . $this->poll_start . ',
				poll_last_vote = 0
			WHERE topic_id = ' . $this->topic_id;
		$db->sql_query($sql);

		$db->sql_transaction('commit');
	}
338370
def delete_candidate(self, candidate):
        """"""
        CandidateElection.objects.filter(
            candidate=candidate, election=self
        ).delete()
779474
function _endSession() {
        if (!hintList) {
            return;
        }
        hintList.close();
        hintList = null;
        codeHintOpened = false;
        keyDownEditor = null;
        sessionProvider = null;
        sessionEditor = null;
        if (deferredHints) {
            deferredHints.reject();
            deferredHints = null;
        }
    }
1129855
def unlock(self):
    """"""
    if not hasattr(self, 'session'):
      raise RuntimeError('Error detected! The session that you want to close does not exist any more!')
    logger.debug("Closed database session of '%s'" % self._database)
    self.session.close()
    del self.session
828601
def _on_cancel_button_clicked(self, *args):
        
        self.core_config_model.preliminary_config.clear()
        self.gui_config_model.preliminary_config.clear()
        self.__destroy()
426359
void callOnClose() {
        if (projectChanged && !SystemProperties.getBoolean("findbugs.skipSaveChangesWarning")) {
            Object[] options = {
                    L10N.getLocalString("dlg.save_btn", "Save"),
                    L10N.getLocalString("dlg.dontsave_btn", "Don't Save"),
                    L10N.getLocalString("dlg.cancel_btn", "Cancel"),
            };
            int value = JOptionPane.showOptionDialog(this, getActionWithoutSavingMsg("closing"),
                    L10N.getLocalString("msg.confirm_save_txt", "Do you want to save?"),
                    JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);

            if (value == 2 || value == JOptionPane.CLOSED_OPTION) {
                return;
            } else if (value == 0) {

                if (saveFile == null) {
                    if (!mainFrameLoadSaveHelper.saveAs()) {
                        return;
                    }
                } else {
                    mainFrameLoadSaveHelper.save();
                }
            }
        }

        GUISaveState guiSaveState = GUISaveState.getInstance();
        guiLayout.saveState();
        guiSaveState.setFrameBounds(getBounds());
        guiSaveState.setExtendedWindowState(getExtendedState());
        guiSaveState.save();
        System.exit(0);
    }
142454
def discard_config(self):
        """"""
        self.device.cu.rollback(rb_id=0)
        if not self.lock_disable and not self.session_config_lock:
            self._unlock()
867931
protected function freeResult()
	{
		if (!empty($this->cursor) && $this->cursor instanceof \PDOStatement)
		{
			$this->cursor->closeCursor();
		}
	}