Saves the current document to the inputed filename.  If no filename \
        is supplied, then the user will be prompted to supply a filename.
        
        :param      filename | <str>
        
        :return     <bool> | success
167871
def saveAs( self, filename = '' ):
        
        if ( not (filename and isinstance(filename, basestring)) ):
            langTypes = XLanguage.pluginFileTypes()
            filename = QFileDialog.getSaveFileName( None,
                                                    'Save File As...',
                                                    QDir.currentPath(),
                                                    langTypes)
            
            if type(filename) == tuple:
                filename = nativestring(filename[0])
        
        if ( not filename ):
            return False
        
        docfile = QFile(filename)
        if ( not docfile.open(QFile.WriteOnly) ):
            logger.warning('Could not open %s for writing.' % filename)
            return False
        
        success = self.write(docfile)
        docfile.close()
        
        if success:
            filename = nativestring(filename)
            self._filename = filename
            
            self.setModified(False)
            
            # set the language
            lang = XLanguage.byFileType(os.path.splitext(filename)[1])
            if ( lang != self.language() ):
                self.setLanguage(lang)
        
        return success
1365964
def save(self, filename):
        """"""
        proxies = {'http': [], 'https': []}
        for protocol in ['http', 'https']:
            for proxy in self.proxies[protocol]:
                serializable_proxy = self.proxies[protocol][proxy].to_dict()
                proxies[protocol].append(serializable_proxy)
        with open(filename, 'w') as fout:
            json.dump(proxies, fout)
521705
def save(self, filename, garbage=0, clean=0, deflate=0, incremental=0, ascii=0, expand=0, linear=0, pretty=0, decrypt=1):
        """"""

        if self.isClosed or self.isEncrypted:
            raise ValueError("operation illegal for closed / encrypted doc")
        if type(filename) == str:
            pass
        elif type(filename) == unicode:
            filename = filename.encode('utf8')
        else:
            raise TypeError("filename must be a string")
        if filename == self.name and not incremental:
            raise ValueError("save to original must be incremental")
        if self.pageCount < 1:
            raise ValueError("cannot save with zero pages")
        if incremental:
            if self.name != filename or self.stream:
                raise ValueError("incremental needs original file")


        return _fitz.Document_save(self, filename, garbage, clean, deflate, incremental, ascii, expand, linear, pretty, decrypt)
1353611
public void save(String fileName)
      throws FileNotFoundException, UnsupportedEncodingException {
    try (PrintWriter writer = new PrintWriter(fileName, "UTF-8")) {
      for (Map.Entry<String, Integer> entry : data.entrySet()) {
        writer.println(String.format("%d;%s", entry.getValue(), entry.getKey()));
      }
    }
  }
1245549
def save(self, filename=None):
        
        if not filename:
            filename = self.filename
        if not filename:
            raise Exception("No filename specified")
        if filename[-4:].lower() == '.bz2':
            f = bz2.BZ2File(filename,'wb')
            f.write(self.xmlstring().encode('utf-8'))
            f.close()
        elif filename[-3:].lower() == '.gz':
            f = gzip.GzipFile(filename,'wb') #pylint: disable=redefined-variable-type
            f.write(self.xmlstring().encode('utf-8'))
            f.close()
        else:
            f = io.open(filename,'w',encoding='utf-8')
            f.write(self.xmlstring())
            f.close()
849639
def save(self, filename=None, ignore_discard=False, ignore_expires=False):
        ''''''
        if filename is None:
            if self.filename is not None:
                filename = self.filename
            else:
                raise ValueError(cookiejar.MISSING_FILENAME_TEXT)

        # TODO: obtain file lock, read contents of file, and merge with
        # current content.
        go_cookies = []
        now = time.time()
        for cookie in self:
            if not ignore_discard and cookie.discard:
                continue
            if not ignore_expires and cookie.is_expired(now):
                continue
            go_cookies.append(py_to_go_cookie(cookie))
        with open(filename, "w") as f:
            f.write(json.dumps(go_cookies))
301779
public function save($filename)
    {
        $this->setFilename($filename);

        call_user_func_array($this->getFunctionName(), [$this->getImage(), $filename]);

        return $filename;
    }
685586
def save(self, filename):
        
        self.doc.save(os.path.expanduser(filename))
734606
def save(self, filename, encoding ='ISO-8859-1', standalone='no'):
        
        f = codecs.open(filename, 'w', encoding)
        s = self.wrap_xml(self.getXML(), encoding, standalone)
        #s = s.replace("&", "&amp;")
        f.write(s)
        f.close()
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'))
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
1187944
def saveFile(self, filename):
        
        ret = libxml2mod.xmlSaveFile(filename, self._o)
        return ret
977219
def save(self, name):
        
        with open(name, 'wb+') as f:
            while True:
                buf = self._fileobj.read()
                if not buf:
                    break
                f.write(buf)
867417
def htmlSaveFile(self, filename):
        
        ret = libxml2mod.htmlSaveFile(filename, self._o)
        return ret
816088
def save(filename)
      speech = bytes_wav
      res = IO.popen(lame_command(filename, command_options), 'r+') do |process|
        process.write(speech)
        process.close_write
        process.read
      end
      res.to_s
    end
988075
def save(self, name):
        
        self.finalize()
        with open(name, 'wb+') as f:
            if six.PY3:
                f.write(self.fileobj.getbuffer())
            else:
                f.write(self.fileobj.getvalue().encode('utf-8'))
298192
def savefig(self, filename, **kwargs):
        
        filename = os.path.expanduser(filename)
        kwargs.setdefault('show', False)
        kwargs.setdefault('save', filename)
        kwargs.setdefault('animate', False)
        return self._show_or_save(**kwargs)