Handles the restoration of any potential global state set.
964718
def _teardown(self):
        ""
        self.example.after(self.context)
        if self.is_root_runner:
            run.after_all.execute(self.context)
        #self.context = self.context._parent
        self.has_ran = True
548244
def reset():
    
    global _handlers, python_signal
    for sig, (previous, _) in _handlers.iteritems():
        if not previous:
            previous = SIG_DFL
        python_signal.signal(sig, previous)
    _handlers = dict()
98562
def restore(self, state):
        

        reading = state.get(u'reading')
        if reading is not None:
            reading = IOTileReading.FromDict(reading)

        selector = DataStreamSelector.FromString(state.get(u'selector'))
        if self.selector != selector:
            raise ArgumentError("Attempted to restore a VirtualStreamWalker with a different selector",
                                selector=self.selector, serialized_data=state)

        self.reading = reading
815923
def restore_state(scan_codes):
    
    _listener.is_replaying = True

    with _pressed_events_lock:
        current = set(_pressed_events)
    target = set(scan_codes)
    for scan_code in current - target:
        _os_keyboard.release(scan_code)
    for scan_code in target - current:
        _os_keyboard.press(scan_code)

    _listener.is_replaying = False
1288134
public void restoreState(FacesContext facesContext, Object state)
    {
        if (state != null)
        {
            Object[] values = (Object[])state;
            _dateStyle = (String)values[0];
            _locale = (Locale)values[1];
            _pattern = (String)values[2];
            _timeStyle = (String)values[3];
            _timeZone = (TimeZone)values[4];
            _type = (String)values[5];
        }
    }
1336728
function restore() {
    if (isOriginal) return;
    else isOriginal = true;
    ['log', 'debug', 'info', 'warn', 'error'].forEach((item) => {
        console[item] = originalConsoleFunctions[item];
    });
}
1092224
protected void restore(BaseState state) {
    if (state.buffer != null) {
      this.buffer = state.buffer.clone();
      this.limit = state.buffer.length;
    }
    this.position = state.position;
    this.isOpen = state.isOpen;
    this.chunkSize = state.chunkSize;
  }
983890
def _restore(name, fields, value):
    
    k = (name, fields)
    cls = __cls.get(k)
    if cls is None:
        cls = collections.namedtuple(name, fields)
        __cls[k] = cls
    return cls(*value)
416259
function restoreState(top_err) {
		if (previous_state === true) {
			that.pause(function madePaused(err) {
				// Ignore errors?
				callback(top_err);
			});
		} else {
			callback(top_err);
		}
	}
1209178
def fixup_state(self, from_str, state):
        
        result = self.get_local_final_result()
        if from_str == fw_const.FW_CR_OP:
            if result == fw_const.RESULT_FW_DELETE_INIT:
                return state + 1
        if from_str == fw_const.FW_DEL_OP:
            if result == fw_const.RESULT_FW_CREATE_INIT:
                return state - 1
        return state
803214
def restore_state(self):
        """"""
        if self.state is None:
            return
        for myCount in range(0, self.exposure_layer_combo.count()):
            item_text = self.exposure_layer_combo.itemText(myCount)
            if item_text == self.state['exposure']:
                self.exposure_layer_combo.setCurrentIndex(myCount)
                break
        for myCount in range(0, self.hazard_layer_combo.count()):
            item_text = self.hazard_layer_combo.itemText(myCount)
            if item_text == self.state['hazard']:
                self.hazard_layer_combo.setCurrentIndex(myCount)
                break
        for myCount in range(0, self.aggregation_layer_combo.count()):
            item_text = self.aggregation_layer_combo.itemText(myCount)
            if item_text == self.state['aggregation']:
                self.aggregation_layer_combo.setCurrentIndex(myCount)
                break
        self.results_webview.setHtml(self.state['report'])
74748
def preserve_batch_state():
    
    with LOCK:
        old = ROOT.gROOT.IsBatch()
        try:
            yield
        finally:
            ROOT.gROOT.SetBatch(old)
272340
def globals(self):
        """"""
        defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL)

        while defglobal != ffi.NULL:
            yield Global(self._env, defglobal)

            defglobal = lib.EnvGetNextDefglobal(self._env, defglobal)
204934
function () {
            // do nothing if there is no saved states
            if (this._matrixStack.length !== 0) {
                var color = this._colorStack.pop();
                var matrix = this._matrixStack.pop();

                // restore the previous context
                this.currentColor.copy(color);
                this.currentTransform.copy(matrix);

                // recycle objects
                me.pool.push(color);
                me.pool.push(matrix);
            }

            if (this._scissorStack.length !== 0) {
                // FIXME : prevent `scissor` object realloc and GC
                this.currentScissor.set(this._scissorStack.pop());
            } else {
                // turn off scissor test
                this.gl.disable(this.gl.SCISSOR_TEST);
                this.currentScissor[0] = 0;
                this.currentScissor[1] = 0;
                this.currentScissor[2] = this.backBufferCanvas.width;
                this.currentScissor[3] = this.backBufferCanvas.height;
            }
        }
1003143
public void restoreState() {
    h0=s0;
    h1=s1;
    h2=s2;
    h3=s3;
    h4=s4;
    
    length = saveLength;
    
    finalBuffer.clear();
    finalBuffer.put(saveBuffer);
  }
40756
public function restoreState()
    {
        if ($data = $this->stateService->getByKey(self::IDENTIFIER)) {
            list($this->total, $this->status, $this->updateRequested) = $data;
        }
    }
134715
protected function backupGlobals() {
		$this->globalsBackup = array();
		foreach($GLOBALS as $key => $value) {
			if($key != 'GLOBALS') {
				$this->globalsBackup[$key] = $value;
			}
		}
	}