Save the state of the output mode so it can be reset at the end of the session.
426972
def _retrieve_output_mode(self):
        """"""
        reg_mode = re.compile(r"output\s+:\s+(?P<mode>.*)\s+\n")
        output = self.send_command("get system console")
        result_mode_re = reg_mode.search(output)
        if result_mode_re:
            result_mode = result_mode_re.group("mode").strip()
            if result_mode in ["more", "standard"]:
                self._output_mode = result_mode
1054087
def do_save(self, fp=None):
        
        if fp is None:
            fp = sys.stdout
        data = {
            'settings': self.settings,
            'nodes': self.nodes,
            'backward': self.backward
        }
        json.dump(data, fp, ensure_ascii=False)
304663
def save(self, output=None):
        
        if output is None:
            if self.dbfile is None:
                return
            output = self.dbfile

        with open(output, 'w') as f:
            f.write(self._dump())
908982
def set_output(self, output):
        
        self.output = output
        self.logger.info("assigning output to %s", self.output)
94451
def savestate(self, state):
        """"""
        oldstate = np.get_printoptions()
        np.set_printoptions(threshold=1e6)
        try:
            with open(os.path.join(self._directory, 'state.txt'), 'w') as f:
                print_(state, file=f)
        finally:
            np.set_printoptions(**oldstate)
112047
public function saveState()
    {
        $this->stateService->setByKey(
            self::IDENTIFIER,
            [
                $this->total,
                $this->status,
                $this->updateRequested
            ]
        );
    }
960211
def save(self):
        
        resp = self.r_session.put(
            self.document_url,
            data=self.json(),
            headers={'Content-Type': 'application/json'}
        )
        resp.raise_for_status()
920289
def save_state(self):
        
        try:
            self.db.savestate(self.get_state())
        except:
            print_('Warning, unable to save state.')
            print_('Error message:')
            traceback.print_exc()
1297162
def save(self):
        
        res = self.cloud_manager._modify_storage(self, self.size, self.title)
        self._reset(**res['storage'])
1134293
def save(self):
        
        out = Outgest(self.output, self.selection_array.astype('uint8'), self.headers, self.config_path)
        out.save()
        out.upload()
284729
def save_session(self, outfolder, override=None):
        """"""
        filename = '%s_%s' % (self.protname.upper(), "_".join(
            [self.hetid, self.plcomplex.chain, self.plcomplex.position]))
        if override is not None:
            filename = override
        cmd.save("/".join([outfolder, "%s.pse" % filename]))
974762
function save()
    {
        if (!$this->blnChanged) {
            return;
        }
        $flags = JSON_PRETTY_PRINT;
        $strContent = json_encode($this->options, $flags);

        file_put_contents(__CODEGEN_OPTION_FILE__, $strContent);
        $this->blnChanged = false;
    }
1046475
void saveAndExit() {

        boolean unlock = shouldUnlockAutomatically();
        // store the scroll position
        final int scrollTop = RootPanel.getBodyElement().getOwnerDocument().getScrollTop();
        saveAndDeleteEntities(unlock, new I_CmsSimpleCallback<Boolean>() {

            public void execute(final Boolean hasChangedSettings) {

                setSaved();
                if (m_onClose != null) {
                    m_onClose.execute(Boolean.valueOf(m_hasChangedSettings || hasChangedSettings.booleanValue()));
                }
                clearEditor();
                // restore the scroll position
                RootPanel.getBodyElement().getOwnerDocument().setScrollTop(scrollTop);
            }
        });
    }
118698
public function save(): void
        {
            if ($this->active() && session_name() == $this->name()) {
                $_SESSION = $this->all();
                session_write_close();
            }
        }
1343430
public void setOutput(Writer output, boolean close)
	{
		reset();
		w = new BufferedWriter(output);
		closeWriter = close;
	}
1155572
protected function saveToSession()
    {
        if ($this->session !== null) {
            $this->session->set(self::SESSION_ID, $this->loginData);
        }
    }
756538
def save(self, *args, **kwargs):
        '''  '''
        if not self.status:
            self.status == Event.RegStatus.hidden
        super(PrivateLessonEvent,self).save(*args,**kwargs)