Saves the xml data to the inputed filename.
        
        :param      filename | <str>
343211
def save(self, filename):
        
        projex.text.xmlindent(self.xmlElement())
        
        try:
            f = open(filename, 'w')
        except IOError:
            logger.exception('Could not save file: %s' % filename)
            return False
            
        f.write(self.toString())
        f.close()
        return True
1022049
def save(self, filename=None):
        
        if filename is None:
            filename = self.filename
        with open(filename, 'wb') as f:
            f.write(self.data)
287917
def addFilename( self, filename ):
        
        filename = os.path.normpath(nativestring(filename))
        
        if filename in self._filenames:
            self._filenames.remove(filename)
        
        self._filenames.insert(0, filename)
        self._filenames = self._filenames[:self.maximumLength()]
        
        self.refresh()
1266230
def to_file(self, filename):
		
		with open(filename, 'wb') as f:
			f.write(self.to_bytes())
433802
def save(self, filename):
        
        gz = filename.endswith('.gz')
        ligolw_utils.write_filename(self.outdoc, filename, gz=gz)
422884
def save_as(self, new_filename):
        
        xfile._save_file(
            self._filename, self._workbookTree, new_filename)
493881
def save_as(self, filename: str) -> None:
        
        lib.TCOD_image_save(self.image_c, filename.encode("utf-8"))
842143
def save_model(model, filename):
    
    with open(filename, 'w') as f:
        f.write(serialize_model(model))
873305
def save(self, filename):
        """"""
        filename = pathlib.Path(filename)
        out = []
        keys = sorted(list(self.keys()))
        for key in keys:
            out.append("[{}]".format(key))
            section = self[key]
            ikeys = list(section.keys())
            ikeys.sort()
            for ikey in ikeys:
                var, val = keyval_typ2str(ikey, section[ikey])
                out.append("{} = {}".format(var, val))
            out.append("")

        with filename.open("w") as f:
            for i in range(len(out)):
                # win-like line endings
                out[i] = out[i]+"\n"
            f.writelines(out)
139357
def save(filename, html):
    
    try:
        out_file = open(filename, "w")
        out_file.write(html)
        out_file.close()
    except IOError as ex:
        parser.error("Could not write baked HTML to local file {name}. ({ex})".format(name=filename, ex=ex))
981276
def save_to(self, nameprefix, switch=False):
        
        if not nameprefix or not isinstance(nameprefix, basestring):
            raise _Error('filename prefix must be a nonempty string')

        if nameprefix == self.default_prefix:
            raise _Error('cannot save to default name "' + nameprefix + '...", chose another name')

        if nameprefix == self.name_prefix:
            return

        for name in self.file_names:
            open(nameprefix + name + '.dat', 'w').write(open(self.name_prefix + name + '.dat').read())

        if switch:
            self.name_prefix = nameprefix
210594
def writeprettyxml(self, filename_or_file=None, indent="  ", newl=os.linesep, 
                       encoding="UTF-8"):
        
        if not filename_or_file:
            filename_or_file = self.filename
        if isinstance(filename_or_file, (str, unicode)):
            filename_or_file = open(filename_or_file, "wb")
        xmlstr = self.toprettyxml(indent, newl, encoding)
        filename_or_file.write(xmlstr)
        filename_or_file.close()
1115862
def to_file(self, filename):
        

        # save compressed file
        xml = self.to_xml()
        f = gzip.open(filename, 'wb')
        try:
            f.write(xml.encode('utf-8'))
        finally:
            f.close()
827699
def save(self, name, content):
        
        # Get the proper name for the file, as it will actually be saved.
        if name is None:
            name = content.name

        name = self.get_available_name(name)
        name = self._save(name, content)

        # Store filenames with forward slashes, even on Windows
        return name.replace("\\", "/")
1032457
def save(self, name, file):
        
        # Get the proper name for the file, as it will actually be saved.
        if name is None:
            name = file.name

        if not hasattr(file, 'chunks'):
            file = File(file, name=name)

        name = self.get_available_name(name)
        name = self._save(name, file)

        # Store filenames with forward slashes, even on Windows
        return name.replace('\\', '/')
447089
def save(self, filename=None):
        
        if filename is None:
            raise IOError('Converter#save: Undefined filename')
        cnt = self.output()
        with (open(filename, 'wb+')) as f:
            f.write(cnt.encode('utf-8'))
231644
def add_input_file(self, filename):
    
    if filename not in self.__input_files:
      self.__input_files.append(filename)