write the contents of this config to fn or its __filename__.
429871
def write(self, fn=None, sorted=False, wait=0):
        
        config = ConfigParser(interpolation=None)
        if sorted==True: keys.sort()
        for key in self.__dict__.get('ordered_keys') or self.keys():
            config[key] = {}
            ks = self[key].keys()
            if sorted==True: ks.sort()
            for k in ks:
                if type(self[key][k])==list and self.__join_list__ is not None:
                    config[key][k] = self.__join_list__.join([v for v in self[key][k] if v!=''])
                else:
                    config[key][k] = str(self[key][k])
        fn = fn or self.__dict__.get('__filename__')
        # use advisory locking on this file
        i = 0
        while os.path.exists(fn+'.LOCK') and i < wait:
            i += 1
            time.sleep(1)
        if os.path.exists(fn+'.LOCK'):
            raise FileExistsError(fn + ' is locked for writing')
        else:
            with open(fn+'.LOCK', 'w') as lf:
                lf.write(time.strftime("%Y-%m-%d %H:%M:%S %Z"))
            with open(fn, 'w') as f:
                config.write(f)
            os.remove(fn+'.LOCK')
1079531
def write(self, filename, encoding='utf-8'):
        
        with io.open(str(filename), 'w', encoding=encoding) as fp:
            for entry in self:
                fp.write(entry.__unicode__())
                fp.write('\n\n')
1160867
def write(self, path):
        
        with open(path, "w") as fh_:
            fh_.write(self.config())
1299378
def to_text(self, fn:str):
        ""
        with open(self.path/fn, 'w') as f: f.writelines([f'{o}\n' for o in self._relative_item_paths()])
93250
def write(self):
        
        if not os.path.isdir(self._dirs['source_dir']):
            os.mkdir(self._dirs['source_dir'])

        fout = codecs.open(self._dirs['source_filename'], 'w', encoding="utf-8", errors="xmlcharrefreplace")
        fout.write(self._config_to_text())
        if self._content:
            fout.write('\n')
            fout.write(self._content)
            fout.write('\n')
        fout.close()
977170
def write_config(self):
        
        template = util.render_template(
            self._get_config_template(), config_options=self.config_options)
        util.write_file(self.config_file, template)
1064413
def write_file(self, filename, content):
        
        with open(filename, 'wb') as f:
            self.log.debug(content)
            f.write(content)
638814
function writeFile(config, isJson, callback) {
  try {
    fs.writeFile('./.nplintrc', isJson ? JSON.stringify(config, null, 4) : yaml.safeDump(config), callback);
  } catch (e) {
    return callback(e);
  }
}
253760
def writetofile(self, filename):
        ''''''
        f = open(filename, "w")
        f.write(self.read())
        f.close()
956152
def save(self):
        """"""
        with open(self._config_file_path, 'w') as file:
            self._config_parser.write(file)
580739
def read_config_file(filename)
      contents = ""
      File.open(filename, "r") { |f| contents = f.read() } if File.exists?(filename)
      contents
    end
408073
def write(self, fn=None):
        """"""
        fn = fn or self.fn
        if not os.path.exists(os.path.dirname(fn)):
            os.makedirs(os.path.dirname(fn))
        f = open(self.fn, 'rb')
        b = f.read()
        f.close()
        f = open(fn, 'wb')
        f.write(b)
        f.close()
1276269
def _write_config(self):
        """"""

        if not self.config:
            self.log("Unable to write non existing configuration", lvl=error)
            return

        self.config.save()
        self.log("Configuration stored.")
1218153
def write_config_value_to_file(key, value, config_path=None):
    
    if config_path is None:
        config_path = DEFAULT_CONFIG_PATH

    # Get existing config.
    config = _get_config_dict_from_file(config_path)

    # Add/update the key/value pair.
    config[key] = value

    # Create parent directories if they are missing.
    mkdir_parents(os.path.dirname(config_path))

    # Write the content
    with open(config_path, "w") as fh:
        json.dump(config, fh, sort_keys=True, indent=2)

    # Set 600 permissions on the config file.
    os.chmod(config_path, 33216)

    return get_config_value_from_file(key, config_path)
614931
def write(self, file_or_filename):
        
        if isinstance(file_or_filename, basestring):
            self._fcn_name, _ = splitext(basename(file_or_filename))
        else:
            self._fcn_name = self.case.name

        self._fcn_name = self._fcn_name.replace(",", "").replace(" ", "_")

        super(MATPOWERWriter, self).write(file_or_filename)
331350
def writeConfig(self):
        
        with self.writeSharedFileStream('config.pickle', isProtected=False) as fileHandle:
            pickle.dump(self.__config, fileHandle, pickle.HIGHEST_PROTOCOL)
955983
def write_config(configfile, content):
    
    with open(configfile, 'w+') as ymlfile:
        yaml.dump(
            content,
            ymlfile,
            default_flow_style=False,
        )