Save the conf file
424359
def save_config(self):
        
        if not os.path.exists(self._conf_dir):
            os.makedirs(self._conf_dir)
        conf_file = os.path.join(self._conf_dir, "dql.json")
        with open(conf_file, "w") as ofile:
            json.dump(self.conf, ofile, indent=2)
547493
def save_config(
        self,
        cmd="copy running-config startup-config",
        confirm=True,
        confirm_response="y",
    ):
        """"""
        return super(ExtremeSlxSSH, self).save_config(
            cmd=cmd, confirm=confirm, confirm_response=confirm_response
        )
629568
def dump_conf(self, conf=None):
        
        if conf is None:
            conf = configparser.ConfigParser()

        tab = self.__class__.__name__

        conf[tab] = {}

        for key, val in self.__dict__.items():
            if key.endswith('_alt'):
                continue
            conf[tab][key] = str(val)

        return conf
106680
def save(self):
        
        with open(self._user_config_file, 'w', encoding='utf-8') as f:
            self.write(f)
124021
def save(self, config=None):
        
        if config is not None:
            clist = [config]
        else:
            clist = [
                self._system_config,
                self._global_config,
                self._repo_config,
                self._local_config,
            ]

        for conf in clist:
            if conf.filename is None:
                continue

            try:
                logger.debug("Writing '{}'.".format(conf.filename))
                dname = os.path.dirname(os.path.abspath(conf.filename))
                try:
                    os.makedirs(dname)
                except OSError as exc:
                    if exc.errno != errno.EEXIST:
                        raise
                conf.write()
            except Exception as exc:
                msg = "failed to write config '{}'".format(conf.filename)
                raise ConfigError(msg, exc)
560571
def save(self, filename=None):
        
        content = self.data.yaml()
        with open(Config.path_expand(ConfigDict.filename), 'w') as f:
            f.write(content)
1184882
def save_config(self):
        """"""
        self.config_section['match_fuzzy'] = self.model_completer.match_fuzzy
        self.config_section['enable_vi_bindings'] = self.enable_vi_bindings
        self.config_section['show_completion_columns'] = \
            self.show_completion_columns
        self.config_section['show_help'] = self.show_help
        self.config_section['theme'] = self.theme
        self.config_obj.write()
1111815
def save(self):
        """"""
        file_name = fd.asksaveasfilename()
        if file_name is "" or file_name is None:
            return
        with open(file_name, "w") as f:
            f.write(self.text.get("1.0", tk.END))
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)
236678
def save_config(self, cmd="write", confirm=False, confirm_response=""):
        """"""
        return super(IpInfusionOcNOSBase, self).save_config(
            cmd=cmd, confirm=confirm, confirm_response=confirm_response
        )
651406
def save(self, filename="temp.pkl"):
    
    output = open(filename, 'wb')
    cPickle.dump(self.tm, output, protocol=cPickle.HIGHEST_PROTOCOL)
442804
def save(self):
        
        with open(self.config_file, "w") as f:
            f.write(dump(self.config, default_flow_style=False))
1069122
def save(self):
        ""
        with open(self.state_file, "w") as fh:
            json.dump({
                "hosts": self.hosts,
                "stats": self.stats,
            }, fh)
411995
function save_config(path, config) {
	debug.assert(path).is('string');
	debug.assert(config).is('object');
	return $Q.fcall(function stringify_json() {
		return JSON.stringify(config, null, 2);
	}).then(function write_to_file(data) {
		return FS.writeFile(path, data, {'encoding':'utf8'});
	});
}
838760
def save(file)
      path = case file
        when :global then GLOBAL_CONFS.first
        when :user then USER_CONFS.first
        else Pathname.new(file)
      end

      raise JSS::MissingDataError, "No HOME environment variable, can't write to user conf file." if path.nil?

      # file already exists? read it in and update the values.
      if path.readable?
        data = path.read

        # go thru the known attributes/keys
        CONF_KEYS.keys.sort.each do |k|

          # if the key exists, update it.
          if data =~ /^#{k}:/
            data.sub!(/^#{k}:.*$/, "#{k}: #{self.send k}")

          # if not, add it to the end unless it's nil
          else
            data += "\n#{k}: #{self.send k}" unless self.send(k).nil?
          end # if data =~ /^#{k}:/
        end #each do |k|

      else # not readable, make a new file
        data = ""
        CONF_KEYS.keys.sort.each do |k|
          data << "#{k}: #{self.send k}\n" unless self.send(k).nil?
        end
      end # if path readable

      # make sure we end with a newline, the save it.
      data << "\n" unless data.end_with?("\n")
      path.jss_save data
    end
339399
def save(self, file=CONFIG_FILE):
        
        os.makedirs(os.path.dirname(file), exist_ok=True)
        with open(file, "w") as f:
            yaml.dump(self._settings, f, Dumper=yaml.RoundTripDumper, width=float("inf"))
740475
def save(filename=None, family='ipv4'):
    '''
    
    '''
    if _conf() and not filename:
        filename = _conf()

    nft_families = ['ip', 'ip6', 'arp', 'bridge']
    rules = "#! nft -f\n"
    for family in nft_families:
        out = get_rules(family)
        if out:
            rules += '\n'
        rules = rules + '\n'.join(out)
    rules = rules + '\n'

    try:
        with salt.utils.files.fopen(filename, 'wb') as _fh:
            # Write out any changes
            _fh.writelines(salt.utils.data.encode(rules))
    except (IOError, OSError) as exc:
        raise CommandExecutionError(
            'Problem writing to configuration file: {0}'.format(exc)
        )
    return rules