save Nucleotide Templates to disk file

@throws java.io.IOException if it can't be saved
505673
public void saveNucleotideTemplates() throws IOException {
    File f = new File(NOTATION_DIRECTORY);
    if (!f.exists()) {
      f.mkdir();
    }
    String nucleotideTemplatesXML = NucleotideParser.getNucleotideTemplatesXML(getNucleotideTemplates());
    FileOutputStream fos = new FileOutputStream(
        LOCAL_NUCLEOTIDE_TEMPLATE_FILE_PATH);
    fos.write(nucleotideTemplatesXML.getBytes());
  }
1344400
public void save() throws IOException {
		muffin.saveFile(numericData, fileName + "_Number");
		muffin.saveFile(stringData, fileName + "_String");
	}
163171
def save(self, *args, **kwargs):
        '''
        
        '''
        if self.send_html:
            self.content = get_text_for_html(self.html_content)
        else:
            self.html_content = None

        super(EmailTemplate, self).save(*args, **kwargs)
243056
def save_snps(self, filename=None):
        
        comment = (
            "# Source(s): {}\n"
            "# Assembly: {}\n"
            "# SNPs: {}\n"
            "# Chromosomes: {}\n".format(
                self.source, self.assembly, self.snp_count, self.chromosomes_summary
            )
        )

        if filename is None:
            filename = self.get_var_name() + "_lineage_" + self.assembly + ".csv"

        return lineage.save_df_as_csv(
            self._snps,
            self._output_dir,
            filename,
            comment=comment,
            header=["chromosome", "position", "genotype"],
        )
748262
public void saveToSetupBean() {

        Map<String, String[]> result = new HashMap<String, String[]>();

        CmsSetupBean bean = m_setupBean;
        if (m_dbCreateUser.isVisible()) {
            bean.setDbCreateUser(m_dbCreateUser.getValue());
        }
        if (m_dbCreatePwd.isVisible()) {
            bean.setDbCreatePwd(m_dbCreatePwd.getValue());
        }
        if (m_dbWorkUser.isVisible()) {
            bean.setDbWorkUser(m_dbWorkUser.getValue());
        }

        if (m_templateDb.isVisible()) {
            setDbProp("templateDb", m_templateDb.getValue());
        }

        if (m_dbWorkPwd.isVisible()) {
            bean.setDbWorkPwd(m_dbWorkPwd.getValue());
        }

        if (m_dbCreateConStr.isVisible()) {
            bean.setDbCreateConStr(m_dbCreateConStr.getValue());
        }

        if (m_dbName.isVisible()) {
            bean.setDb(m_dbName.getValue());
        }

        result.put("dbCreateConStr", new String[] {m_dbCreateConStr.getValue()});

        result.put("dbName", new String[] {bean.getDatabase()});
        result.put("dbProduct", new String[] {bean.getDatabase()});
        result.put("dbProvider", new String[] {"sql"});
        result.put("dbName", new String[] {m_dbName.getValue()});
        result.put("db", new String[] {bean.getDb()});
        result.put("createDb", new String[] {Boolean.toString(m_createDb.getValue().booleanValue())});
        result.put("createTables", new String[] {Boolean.toString(m_createTables.getValue().booleanValue())});
        result.put("jdbcDriver", new String[] {dbProp("driver")});
        result.put("templateDb", new String[] {dbProp("templateDb")});
        result.put("dbCreateUser", new String[] {bean.getDbCreateUser()});
        result.put("dbCreatePwd", new String[] {bean.getDbCreatePwd()});
        result.put("dbWorkUser", new String[] {bean.getDbWorkUser()});
        result.put("dbWorkPwd", new String[] {bean.getDbWorkPwd()});
        result.put("dbDefaultTablespace", new String[] {m_defaultTablespace.getValue()});
        result.put("dbTemporaryTablespace", new String[] {m_temporaryTablespace.getValue()});
        result.put("dbIndexTablespace", new String[] {m_indexTablespace.getValue()});
        // result.put("servletMapping", new String[] {getServeltMapping()});
        result.put("submit", new String[] {Boolean.TRUE.toString()});
        bean.setDbParamaters(result, bean.getDatabase(), null, null);

    }
49529
def write_dna(dna, path):
    '''

    '''
    # Check if path filetype is valid, remember for later
    ext = os.path.splitext(path)[1]
    if ext == '.gb' or ext == '.ape':
        filetype = 'genbank'
    elif ext == '.fa' or ext == '.fasta':
        filetype = 'fasta'
    else:
        raise ValueError('Only genbank or fasta files are supported.')

    # Convert features to Biopython form
    # Information lost on conversion:
    #     specificity of feature type
    #     strandedness
    #     topology
    features = []
    for feature in dna.features:
        features.append(_coral_to_seqfeature(feature))
    # Biopython doesn't like 'None' here
    # FIXME: this is a legacy feature - remove?
    bio_id = dna.id if hasattr(dna, 'id') else ''
    # Maximum length of name is 16
    seq = SeqRecord(Seq(str(dna), alphabet=ambiguous_dna), id=bio_id,
                    name=dna.name[0:16].replace(' ', '_'), features=features,
                    description=dna.name)
    if dna.circular:
        seq.annotations['data_file_division'] = 'circular'
    else:
        seq.annotations['data_file_division'] = 'linear'

    if filetype == 'genbank':
        SeqIO.write(seq, path, 'genbank')
    elif filetype == 'fasta':
        SeqIO.write(seq, path, 'fasta')
1207592
public void save(String saveModelFile) throws IOException {
		System.out.println("save ...");
		ObjectOutputStream out = new ObjectOutputStream(
				new BufferedOutputStream(new GZIPOutputStream(
						new FileOutputStream(saveModelFile))));
		out.writeObject(new Integer(n));
		out.close();
		System.out.println("OK");
	}
1337294
public void save(Path filename, boolean pretty) throws IOException {
        if (filename == null || Files.exists(filename)) {
            throw new IOException("File path not correct, either it is null or file already exists: " + filename);
        }

        String text;
        if (pretty) {
            text = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(variantMetadata);
        } else {
            text = mapper.writeValueAsString(variantMetadata);
        }

        PrintWriter writer = new PrintWriter(new FileOutputStream(filename.toFile()));
        writer.write(text);
        writer.close();
    }
170043
public void save() throws IOException {
        if(BulkChange.contains(this))   return;
        XmlFile config = getConfigXml();
        config.write(this);
        SaveableListener.fireOnChange(this, config);
    }
264266
private void generate(TemplateFile input, List<OutputFile> outputs, TemplateOptions templateOptions) throws IOException {
    final String targetFileName = targetFileName(templatesPath.relativize(input.path).toString(), templateOptions);
    final OutputFile output = new OutputFile(outputPath.resolve(targetFileName).toAbsolutePath().normalize());

    if (incremental &&
        Files.exists(output.path) &&
        Files.getLastModifiedTime(output.path).toMillis() >= Files.getLastModifiedTime(input.path).toMillis()) {
      // No need to re-render but mark as generated.
      output.upToDate = true;
      outputs.add(output);
      return;
    }

    String template = new String(Files.readAllBytes(input.path), StandardCharsets.UTF_8);

    timeVelocity.start();
    template = filterVelocity(input, template, templateOptions);
    timeVelocity.stop();

    // Check if template requested ignoring a given type combination.
    if (templateOptions.isIgnored()) {
      return;
    }

    getLog().debug("Processing: " + input.getFileName() + " => " + output.path);
    try {
      timeIntrinsics.start();
      template = filterIntrinsics(template, templateOptions);
      timeIntrinsics.stop();
  
      timeComments.start();
      template = filterComments(template);
      timeComments.stop();
  
      timeTypeClassRefs.start();
      template = filterTypeClassRefs(template, templateOptions);
      template = filterStaticTokens(template, templateOptions);
      timeTypeClassRefs.stop();
    } catch (RuntimeException e) {
      getLog().error("Error processing: " + input.getFileName() + " => " + output.path + ":\n\t" + e.getMessage());
      throw e;
    }

    Files.createDirectories(output.path.getParent());
    Files.write(output.path, template.getBytes(StandardCharsets.UTF_8));

    outputs.add(output);
  }
978700
public synchronized void save() throws IOException {
        if(BulkChange.contains(this))   return;

        long start=0;
        if(logger.isLoggable(Level.FINE))
            start = System.currentTimeMillis();

        File file = getFingerprintFile(md5sum);
        save(file);
        SaveableListener.fireOnChange(this, getConfigFile(file));

        if(logger.isLoggable(Level.FINE))
            logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
    }
967168
private File saveAsFile(ResponseBody responseBody) {
    if (responseBody == null) {
      return null;
    }

    try {
      File file = new File(destDirectory + File.separator + fileName + retrieveUniqueId() + "." + extension);
      InputStream inputStream = null;
      OutputStream outputStream = null;

      try {
        inputStream = responseBody.byteStream();
        outputStream = new FileOutputStream(file);
        byte[] buffer = new byte[4096];
        int numOfBufferedBytes;

        while ((numOfBufferedBytes = inputStream.read(buffer)) != END_OF_FILE_DENOTER) {
          outputStream.write(buffer, 0, numOfBufferedBytes);
        }

        outputStream.flush();
        return file;

      } catch (IOException exception) {
        return null;

      } catch (Exception exception) {
        return null;

      } finally {
        if (inputStream != null) {
          inputStream.close();
        }

        if (outputStream != null) {
          outputStream.close();
        }
      }

    } catch (IOException exception) {
      return null;
    }
  }
602543
private void saveJsonFile(final List<StepImplementationsDescriptor> classStepTags) {

        Gson gson = new GsonBuilder().create();

        final String json = gson.toJson(classStepTags);

        writeOutputFile(json, "stepimplementations.json");
    }
699752
public void save() throws Exception {

        if (fileName == null || fileName.length() == 0) {
            throw new java.io.FileNotFoundException(
                Error.getMessage(ErrorCode.M_HsqlProperties_load));
        }

        String filestring = fileName + ".properties";

        save(filestring);
    }
1316284
public int writeTemplate(String template, ValueSet vs) {
        int returnCode = htod.writeTemplate(template, vs);
        if (returnCode == HTODDynacache.DISK_EXCEPTION) {
            stopOnError(this.htod.diskCacheException);
        }
        return returnCode;
    }
91235
def save_to_file(cn_topo, filename):
    '''
    
    '''
    jstr = cn_topo.serialize()
    with open(filename, 'w') as outfile:
        outfile.write(jstr)
1161313
public void save() throws IOException {
	if (!file.exists()) file.createFile(true);
	OutputStream out = IOUtil.toBufferedOutputStream(file.getOutputStream());
	Iterator it = sections.keySet().iterator();
	PrintWriter output = new PrintWriter(out);
	try {
	    while (it.hasNext()) {
		String strSection = (String) it.next();
		output.println("[" + strSection + "]");
		Map section = getSectionEL(strSection);
		Iterator iit = section.keySet().iterator();
		while (iit.hasNext()) {
		    String key = (String) iit.next();
		    output.println(key + "=" + section.get(key));
		}
	    }
	}
	finally {
	    IOUtil.flushEL(output);
	    IOUtil.closeEL(output);
	    IOUtil.flushEL(out);
	    IOUtil.closeEL(out);
	}
    }