Write the first sections file.
761963
def wr_py_sections_new(self, fout_py, doc=None):
        """"""
        sections = self.grprobj.get_sections_2d()
        return self.wr_py_sections(fout_py, sections, doc)
933118
def write_file(path, data):
    """"""
    with open(path, 'w') as f:
        log.debug('setting %s contents:\n%s', path, data)
        f.write(data)
    return f
32452
private void writeFileForm(OutputStream out) throws IOException {
		for (Entry<String, Resource> entry : this.fileForm.entrySet()) {
			appendPart(entry.getKey(), entry.getValue(), out);
		}
	}
799411
private function write()
	{
		$content = '';

		foreach ($this->getFiles() as $file)
		{
			$content .= '$this->call(\'' . str_replace('.php', '', $file) . '\');';	
		}
		
		$databaseSeeder = str_replace('{calls}', $content, $this->getPattern());

		$this->getFilesystem()->put(app_path() . '/database/seeds/DatabaseSeeder.php', $databaseSeeder);
	}
859363
def _write_init_fetchers(self, filenames):
        
        destination = "%s%s" % (self.output_directory, self.fetchers_path)
        self.write(destination=destination, filename="__init__.py", template_name="__init_fetcher__.py.tpl",
                   filenames=self._prepare_filenames(filenames, suffix='Fetcher'),
                   class_prefix=self._class_prefix,
                   product_accronym=self._product_accronym,
                   header=self.header_content)
1016244
public void write(Collection<? extends E> elements) throws IOException {
		final Progression progressBar = getTaskProgression();
		Progression subTask = null;

		if (progressBar != null) {
			progressBar.setProperties(0, 0, (elements.size() + 1) * 100, false);
		}

		if (this.fileBounds == null) {
			this.fileBounds = getFileBounds();
		}

		if (this.fileBounds != null) {
			writeHeader(this.fileBounds, this.elementType, elements);

			if (progressBar != null) {
				progressBar.setValue(100);
				subTask = progressBar.subTask(elements.size() * 100);
				subTask.setProperties(0, 0, elements.size(), false);
			}

			for (final E element : elements) {

				writeElement(this.recordIndex, element, this.elementType);

				if (subTask != null) {
					subTask.setValue(this.recordIndex + 1);
				}

				++this.recordIndex;

			}
		} else {
			throw new BoundsNotFoundException();
		}

		if (progressBar != null) {
			progressBar.end();
		}
	}
380649
static function write_sections($file, $data)
	{
		$content = "";
		foreach($data as $section => $section_data)
		{
			$content .= "[".$section."]\n";
			foreach($section_data as $key => $value)
			{
				if(is_array($value))
				{
					for($i=0; $i<count($value); $i++)
						$content .= $key."[] = \"".addslashes($value[$i])."\"\n";
				}
				elseif($value)
					$content .= $key." = \"".addslashes($value)."\"\n";
				else
					$content .= $key." = \n";
			}
		}

		bors_function_include('fs/file_put_contents_lock');
		file_put_contents_lock($file, $content);
	}
590159
public void writeAll() throws IOException {
    this.layoutVersion = FSConstants.LAYOUT_VERSION;
    for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) {
      it.next().write();
    }
  }
721067
void writeStartDocument(final Writer output) throws SAXException {
        try {
            output.write(XML_HEAD);
        } catch (IOException e) {
            throw new SAXException(e);
        }
    }
827411
def write(self, fout_xlsx=None, fout_txt=None, verbose=False):
        """"""
        sortby = self._get_fncsortnt(self.objgrpd.grprobj.gosubdag.prt_attr['flds'])
        kws_sort = {'sortby' if verbose else 'section_sortby': sortby}
        sortobj = Sorter(self.objgrpd.grprobj, **kws_sort)
        # KWS: hdrgo_prt=True section_prt=None top_n=None use_sections=True
        # RET: {sortobj, sections, hdrgo_prt} or {sortobj flat hdrgo_prt}
        desc2nts = sortobj.get_desc2nts_fnc(
            hdrgo_prt=verbose,
            section_prt=True,
            top_n=None,
            use_sections=True)
        # print('FFFF', desc2nts['flds'])
        # Write user GO IDs in sections
        objgowr = WrXlsxSortedGos("init", sortobj, self.objgrpd.ver_list)
        if fout_xlsx is not None:
            kws_xlsx = {'shade_hdrgos':verbose}
            if not verbose:
                kws_xlsx['prt_flds'] = [f for f in desc2nts['flds'] if f not in self.excl_flds]
            objgowr.wr_xlsx_nts(fout_xlsx, desc2nts, **kws_xlsx)
            fout_desc = '{BASE}_desc.txt'.format(BASE=os.path.splitext(fout_xlsx)[0])
            self._wr_ver_n_key(fout_desc, verbose)
        if fout_txt is not None:
            self._wr_txt_nts(fout_txt, desc2nts, objgowr, verbose)
        if fout_xlsx is None and fout_txt is None:
            self._prt_ver_n_key(sys.stdout, verbose)
            prtfmt = self._get_prtfmt(objgowr, verbose)
            summary_dct = objgowr.prt_txt_desc2nts(sys.stdout, desc2nts, prtfmt)
            self._prt_ver_n_key(sys.stdout, verbose)
            if summary_dct:
                print("\n{N} GO IDs in {S} sections".format(
                    N=desc2nts['num_items'], S=desc2nts['num_sections']))
800993
def write_membership(filename,config,srcfile,section=None):
    
    source = Source()
    source.load(srcfile,section=section)
    loglike = createLoglike(config,source)
    loglike.write_membership(filename)
982679
def write(self):
        """"""
        for entry in self._instream:
            if isinstance(entry, Feature):
                for feature in entry:
                    if feature.num_children > 0 or feature.is_multi:
                        if feature.is_multi and feature != feature.multi_rep:
                            continue
                        self.feature_counts[feature.type] += 1
                        fid = '{}{}'.format(feature.type,
                                            self.feature_counts[feature.type])
                        feature.add_attribute('ID', fid)
                    else:
                        feature.drop_attribute('ID')
            if isinstance(entry, Sequence) and not self._seq_written:
                print('##FASTA', file=self.outfile)
                self._seq_written = True
            print(repr(entry), file=self.outfile)
1121897
def write(self):
        """"""
        if self.dirty:
            with open(self._cache_path, "w") as output_file:
                self._config.write(output_file)
37651
public function fileStart() : void
    {
        if ($this->isSilent()) {
            return;
        }

        fwrite($this->file, '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL);
        fwrite($this->file, '<browsercaps>' . PHP_EOL);
    }
4653
def _WritePartial(self, data):
    """"""

    chunk = self.offset // self.chunksize
    chunk_offset = self.offset % self.chunksize
    data = utils.SmartStr(data)

    available_to_write = min(len(data), self.chunksize - chunk_offset)

    fd = self._GetChunkForWriting(chunk)
    fd.seek(chunk_offset)

    fd.write(data[:available_to_write])
    self.offset += available_to_write

    return data[available_to_write:]
1192832
def write_file(fname_parts, content):
    

    fname_parts = [str(part) for part in fname_parts]
    # try to create the directory
    if len(fname_parts) > 1:
        try:
            os.makedirs(os.path.join(*fname_parts[:-1]))
        except OSError:
            pass
    # write file
    fhandle = open(os.path.join(*fname_parts), "w")
    fhandle.write(content)
    fhandle.close()
1007727
def write_config_file(self, f, comments):
        
        if len(self.elements) < 1:
            return
        super(_Section, self).write_config_file(f, comments)

        for e in self.elements.values():
            e.write_config_file(f, comments)
        f.write("\n")