Save the file as a PDF.

        Parameters
        ----------
        filelike: path or file-like object
            The filename or file-like object to save the labels under. Any
            existing contents will be overwritten.
972333
def save(self, filelike):
        
        # Shade any remaining missing labels if desired.
        self._shade_remaining_missing()

        # Create a canvas.
        canvas = Canvas(filelike, pagesize=self._pagesize)

        # Render each created page onto the canvas.
        for page in self._pages:
            renderPDF.draw(page, canvas, 0, 0)
            canvas.showPage()

        # Done.
        canvas.save()
579336
def save_mlf(mlf, output_filename):
    
    with codecs.open(output_filename, 'w', 'utf-8') as f:
        f.write(u'#!MLF!#\n')
        for k, v in mlf.items():
            f.write(u'"{}"\n'.format(k))
            for labels in v:
                for label in labels:
                    line = u'{start} {end} {symbol} ' \
                           u'{loglikelihood} {word}'.format(start=label.start or '',
                                                            end=label.end or '',
                                                            symbol=label.symbol or '',
                                                            loglikelihood=label.log_likelihood or '',
                                                            word=label.word or '')
                    f.write(u'{}\n'.format(line.strip()))

                f.write(u'.\n')
262202
def save_as(self):
        """"""
        filename = splitext(self.filename)[0]
        filename, _ = QFileDialog.getSaveFileName(self, 'Export events',
                                                  filename)
        if filename == '':
            return

        self.filename = filename
        short_filename = short_strings(basename(self.filename))
        self.idx_filename.setText(short_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()
108264
def _save_file(self, filename, contents):
        """"""
        with open(filename, 'w') as f:
            f.write(contents)
291063
def save(self, outfname):
        
        f = BZ2File(outfname, 'w')
        self.doc.writexml(f, addindent='  ', newl='\n')
        f.close()
867221
def save(self):
        
        # GH21227 internal compression is not used when file-like passed.
        if self.compression and hasattr(self.path_or_buf, 'write'):
            msg = ("compression has no effect when passing file-like "
                   "object as input.")
            warnings.warn(msg, RuntimeWarning, stacklevel=2)

        # when zip compression is called.
        is_zip = isinstance(self.path_or_buf, ZipFile) or (
            not hasattr(self.path_or_buf, 'write')
            and self.compression == 'zip')

        if is_zip:
            # zipfile doesn't support writing string to archive. uses string
            # buffer to receive csv writing and dump into zip compression
            # file handle. GH21241, GH21118
            f = StringIO()
            close = False
        elif hasattr(self.path_or_buf, 'write'):
            f = self.path_or_buf
            close = False
        else:
            f, handles = _get_handle(self.path_or_buf, self.mode,
                                     encoding=self.encoding,
                                     compression=self.compression)
            close = True

        try:
            writer_kwargs = dict(lineterminator=self.line_terminator,
                                 delimiter=self.sep, quoting=self.quoting,
                                 doublequote=self.doublequote,
                                 escapechar=self.escapechar,
                                 quotechar=self.quotechar)
            if self.encoding == 'ascii':
                self.writer = csvlib.writer(f, **writer_kwargs)
            else:
                writer_kwargs['encoding'] = self.encoding
                self.writer = UnicodeWriter(f, **writer_kwargs)

            self._save()

        finally:
            if is_zip:
                # GH17778 handles zip compression separately.
                buf = f.getvalue()
                if hasattr(self.path_or_buf, 'write'):
                    self.path_or_buf.write(buf)
                else:
                    f, handles = _get_handle(self.path_or_buf, self.mode,
                                             encoding=self.encoding,
                                             compression=self.compression)
                    f.write(buf)
                    close = True
            if close:
                f.close()
                for _fh in handles:
                    _fh.close()
1022049
def save(self, filename=None):
        
        if filename is None:
            filename = self.filename
        with open(filename, 'wb') as f:
            f.write(self.data)
422884
def save_as(self, new_filename):
        
        xfile._save_file(
            self._filename, self._workbookTree, new_filename)
628055
def save(self, path):
        
        (folder, filename) = os.path.split(path)
        (name, extension) = os.path.splitext(filename)

        if not name:
            raise ValueError, "name is required"

        if extension:
            format = Image.image_format(extension)
        else:
            format = self.format
            filename = name + self.extension
            path = os.path.join(folder, filename)

        image = self.convert(format)
        if image._contents:
            f = open(path, "wb")
            f.write(image._contents)
            f.close()
        else:
            image.pil_image.save(path, format)

        return path
540196
def save_as_pdf(self, dest_path):
        
        dest_path = self._add_extension('pdf', dest_path)
        build_dir = tempfile.mkdtemp()
        build_path = os.path.join(build_dir, 'document.tex')
        self.save_assets(build_path)
        with open(build_path, 'w') as f:
            f.write(self.render())
        pdf_path = self._build_document(build_path)
        shutil.copyfile(pdf_path, dest_path)
        shutil.rmtree(build_dir)
174453
def save(self, path):
        
        for relative_path_and_filename, content in self.files.items():
            full_path_and_filename = os.path.join(path, relative_path_and_filename)
            full_path = os.path.dirname(full_path_and_filename)

            if not os.path.isdir(full_path):
                os.makedirs(full_path)

            with open(full_path_and_filename, 'wb') as handle:
                handle.write(b64decode(content))
318166
def save_file(self, filename, text):
        """"""
        if not filename.endswith('.py'):
            filename += '.py'
        path = os.path.join(self.currentpath, filename)
        with open(path, 'w', encoding="utf-8") as file_:
            file_.write(text)
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)
1273367
def save(self, filename, content):
        
        with open(filename, "w") as f:
            if hasattr(content, '__iter__'):
                f.write('\n'.join([row for row in content]))
            else:
                print('WRINGI CONTWETESWREWR')
                f.write(str(content))
1154175
def save_file(self, filename = 'StockChart'):
        
        filename = filename + '.html'
        
        with open(filename, 'w') as f:
            #self.buildhtml()
            f.write(self.htmlcontent)
        
        f.closed
9118
def save(self, outfile):
        """"""
        if isinstance(outfile, compat.string_type):
            outfile = open(outfile, 'wb')
        assert hasattr(outfile, 'write') and callable(outfile.write), \
            "Expect a file or file-like object with a .write() method"
        outfile.write(self.data)