Save the state to the JSON file in the config dir.
493351
def save(self):
        """"""
        logger.debug("Save the GUI state to `%s`.", self.path)
        _save_json(self.path, {k: v for k, v in self.items()
                               if k not in ('config_dir', 'name')})
832273
def save(self, path):
        
        with open(path, 'w') as out_file:
            json.dump(self.to_dict(), out_file, indent=4)
1129974
def save(self, filename):
        ''' 
        '''
        with open(filename, 'w') as outfile:
            json.dump(self.to_json(), outfile)
185406
def save(self, filename=None, debug=False):
        """"""
        if not filename: filename = self.name
        with open(filename, "w") as f: # save config data file
            f.write(self.toJson(self.attrs))
        if self.debug or debug:
            print("saved configuration %s"%(self.name))
            for k,v in sorted(iteritems(self.attrs)):
                print("%15s : %s"%(k,v))
236341
def save(self):
        """"""
        if self.save_option == 'curdir':
            model_path = os.path.join(
                os.getcwd(),
                '{}.lcopt'.format(self.name)
            )
        else: # default to appdir
            model_path = os.path.join(
                storage.model_dir,
                '{}.lcopt'.format(self.name)
            )
        
        model_path = fix_mac_path_escapes(model_path)

        with open(model_path, 'wb') as model_file:
            pickle.dump(self, model_file)
682268
def save(self, filename=None):
        """"""
        if self.__fname is None and filename is None:
            raise ValueError('Config loaded from string, no filename specified')
        conf = self.__config
        cpa = dict_to_cp(conf)
        with open(self.__fname if filename is None else filename, 'w') as f:
            cpa.write(f)
1265334
function() {
        try {
            this.set(fs.existsSync(this._stateFile) ? JSON.parse(fs.readFileSync(this._stateFile)) : {});
        } catch (e) {}
    }
993006
def _save_archive(self):
        
        import json
        from utility import json_serial
        with open(self.archpath, 'w') as f:
            json.dump(self.archive, f, default=json_serial)
749972
def save_state(self, out_path):
        

        state = self.dump_state()

        # Remove all IntEnums from state since they cannot be json-serialized on python 2.7
        # See https://bitbucket.org/stoneleaf/enum34/issues/17/difference-between-enum34-and-enum-json
        state = _clean_intenum(state)

        with open(out_path, "w") as outfile:
            json.dump(state, outfile, indent=4)
546417
def saveConfig(self, request):
        """"""
        res = yield self.assertAllowed(request)
        if res:
            defer.returnValue(res)
        request.setHeader('Content-Type', 'application/json')
        if self._in_progress:
            defer.returnValue(json.dumps({'success': False, 'errors': ['reconfig already in progress']}))
        self._in_progress = True
        cfg = json.loads(request.content.read())
        if cfg != self._cfg:
            try:
                err = yield self.saveCfg(cfg)
            except Exception as e:  # noqa
                err = [repr(e)]
            if err is not None:
                self._in_progress = False
                yield self.saveCfg(self._cfg)
                defer.returnValue(json.dumps({'success': False, 'errors': err}))

        yield self.ep.master.reconfig()
        defer.returnValue(json.dumps({'success': True}))
785137
def save(self, fp=None):
        
        self.storage.settings['markov'] = self.get_settings_json()
        self.storage.save(fp)
1303446
def load_state(self, in_path):
        

        with open(in_path, "r") as infile:
            state = json.load(infile)

        self.restore_state(state)
702418
def dump(self, file, sort_keys: bool = True, **kwargs) -> None:
        """"""
        json.dump(self.to_json(), file, sort_keys=sort_keys, **kwargs)
240786
def save(self) -> 'Configuration':
        

        data = self.load().persistent
        if data is None:
            return self

        directory = os.path.dirname(self._source_path)
        if not os.path.exists(directory):
            os.makedirs(directory)

        path = self._source_path
        with open(path, 'w+') as f:
            json.dump(data, f)

        return self
580246
def save(self, filename, config):
        """"""
        return open(os.path.expanduser(filename), 'w').write(json.dumps(config, cls=HCEncoder, sort_keys=True, indent=2, separators=(',', ': ')))
1042980
def save_save_state(self, data_dict: Dict[str, LinkItem]):  # TODO: add progressbar
        
        json_data = json_format.MessageToJson(self._create_save_state(data_dict).to_protobuf())
        with self._save_state_file.open(mode='w', encoding="utf8") as writer:
            writer.write(json_data)
590946
def save(self):
		
		with open(self.configuration_file, 'w') as file_h:
			file_h.write(self._serializer('dumps', self._storage))