Save the BioPAX model object in an OWL file.

        Parameters
        ----------
        file_name : Optional[str]
            The name of the OWL file to save the model in.
342748
def save_model(self, file_name=None):
        
        if file_name is None:
            logger.error('Missing file name')
            return
        pcc.model_to_owl(self.model, file_name)
1279415
def file_save(self, name, filename=None, folder="", keep_ext=True) -> bool:
        
        if name in self.files:
            file_object = self.files[name]
            clean_filename = secure_filename(file_object.filename)
            if filename is not None and keep_ext:
                clean_filename = filename + ".%s" % \
                    (clean_filename.rsplit('.', 1)[1].lower())
            elif filename is not None and not keep_ext:
                clean_filename = filename
            file_object.save(os.path.join(
                current_app.config['UPLOADS']['FOLDER'],
                folder, clean_filename))
        return None
560571
def save(self, filename=None):
        
        content = self.data.yaml()
        with open(Config.path_expand(ConfigDict.filename), 'w') as f:
            f.write(content)
286093
def save(self, filename):
        
        clibrebound.reb_output_binary(byref(self), c_char_p(filename.encode("ascii")))
1320888
def save(self, filename):
        
        with open(filename, 'wb') as output:
            pickle.dump(self, output, protocol=pickle.HIGHEST_PROTOCOL)
58367
def save(self, model_filename, optimizer_filename):
        
        serializers.save_hdf5(model_filename, self.model)
        serializers.save_hdf5(optimizer_filename, self.optimizer)
202067
def save_to_file(self, filename: str) -> ConfigFile:
        
        newclass = ConfigFile(fd=filename, load_hook=self.normal_class_hook[0],
                              dump_hook=self.normal_class_hook[1], safe_load=self.safe_load)
        return newclass
515640
def pre_save(self, model_instance, add):
        
        file = getattr(model_instance, self.attname)
        if file and not file._committed:
            file.name = self._clean_file_name(model_instance, file.name)
            file.file = self._resize_image(model_instance, file)
            file.save(file.name, file, save=False)
        return file
477250
def save_model(self, file_name='model.cx'):
        
        with open(file_name, 'wt') as fh:
            cx_str = self.print_cx()
            fh.write(cx_str)
217730
def save_sparse_data(self, fname):
        
        data = self.adata_raw.X.T
        if data.getformat()=='csr':
            data=data.tocsc()

        cell_names = np.array(list(self.adata_raw.obs_names))
        gene_names = np.array(list(self.adata_raw.var_names))
        
        pickle.dump((data, cell_names, gene_names), open(fname, 'wb'))
977219
def save(self, name):
        
        with open(name, 'wb+') as f:
            while True:
                buf = self._fileobj.read()
                if not buf:
                    break
                f.write(buf)
530477
def get_new_filename(self, name: str) -> str:
        
        nonce = get_random_string(length=8)
        return '%s-%s/%s/%s.%s.%s' % (
            self.obj._meta.model_name, self.attribute_name,
            self.obj.pk, name, nonce, name.split('.')[-1]
        )
569808
def save_as(self, new_filename):
        

        xfile._save_file(self._filename, self._datasourceTree, new_filename)
1325632
def xmlrpc_save2file(self, filename):
        
        savefile = open(filename,'wb')
        try:
            pickle.dump({'scheduled':self.scheduled_tasks,
                          'reschedule':self.reschedule},savefile)
        except pickle.PicklingError:
            return -1
        savefile.close()
        return 1
1349701
def save(self, filename):
        ''''''
        f = open(filename, mode='w')
        f.write("QGC WPL 110\n")
        for w in self.wpoints:
            if getattr(w, 'comment', None):
                f.write("# %s\n" % w.comment)
            f.write("%u\t%u\t%u\t%u\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%u\n" % (
                w.seq, w.current, w.frame, w.command,
                w.param1, w.param2, w.param3, w.param4,
                w.x, w.y, w.z, w.autocontinue))
        f.close()
164142
def update_model_in_repo_based_on_filename(self, model):
        
        if model._tx_filename is None:
            for fn in self.all_models.filename_to_model:
                if self.all_models.filename_to_model[fn] == model:
                    return fn
            i = 0
            while self.all_models.has_model("anonymous{}".format(i)):
                i += 1
            myfilename = "anonymous{}".format(i)
            self.all_models.filename_to_model[myfilename] = model
        else:
            myfilename = model._tx_filename
            if (not self.all_models.has_model(myfilename)):
                self.all_models.filename_to_model[myfilename] = model
        return myfilename
874873
def save_profile_as(self):
        
        # noinspection PyCallByClass,PyTypeChecker
        file_name_dialog = QFileDialog(self)
        file_name_dialog.setAcceptMode(QFileDialog.AcceptSave)
        file_name_dialog.setNameFilter(self.tr('JSON files (*.json *.JSON)'))
        file_name_dialog.setDefaultSuffix('json')
        dir = os.path.join(QgsApplication.qgisSettingsDirPath(),
                           'inasafe', 'minimum_needs')
        file_name_dialog.setDirectory(expanduser(dir))
        if file_name_dialog.exec_():
            file_name = file_name_dialog.selectedFiles()[0]
        else:
            return
        file_name = basename(file_name)
        file_name = file_name.replace('.json', '')
        minimum_needs = {'resources': []}
        self.mark_current_profile_as_saved()
        for index in range(self.resources_list.count()):
            item = self.resources_list.item(index)
            minimum_needs['resources'].append(item.resource_full)
        minimum_needs['provenance'] = self.provenance.text()
        minimum_needs['profile'] = file_name
        self.minimum_needs.update_minimum_needs(minimum_needs)
        self.minimum_needs.save()
        self.minimum_needs.save_profile(file_name)
        if self.profile_combo.findText(file_name) == -1:
            self.profile_combo.addItem(file_name)
        self.profile_combo.setCurrentIndex(
            self.profile_combo.findText(file_name))