Write remaining pages and close file handle.
965429
def close(self):
        """"""
        if not self._truncate:
            self._write_remaining_pages()
        self._write_image_description()
        self._fh.close()
950134
def write_remaining(self):
        
        if not self.results:
            return
        with db.execution_context():
            with db.atomic():
                Result.insert_many(self.results).execute()
        del self.results[:]
760326
private function write()
    {
        ftruncate($this->handle, 0);
        rewind($this->handle);

        fwrite($this->handle, serialize($this->data));
    }
389410
def close(self):
        """"""
        if self._writer:
            self._writer.transport.close()
        self._writer = None
        self._reader = None
1017970
public function close()
    {
        if (!$this->isWriterOpened) {
            return;
        }

        $this->closeWriter();

        if (is_resource($this->filePointer)) {
            $this->globalFunctionsHelper->fclose($this->filePointer);
        }

        $this->isWriterOpened = false;
    }
1263795
def close(self):
        """"""
        if self._closing or self._handle.closed:
            return
        elif self._protocol is None:
            raise TransportError('transport not started')
        # If the write buffer is empty, close now. Otherwise defer to
        # _on_write_complete that will close when the buffer is empty.
        if self._write_buffer_size == 0:
            self._handle.close(self._on_close_complete)
            assert self._handle.closed
        else:
            self._closing = True
853824
def close(self):
        ""
        if(self.state==3):
            return
        if(self.page==0):
            self.add_page()
        #Page footer
        self.in_footer=1
        self.footer()
        self.in_footer=0
        #close page
        self._endpage()
        #close document
        self._enddoc()
223614
public void doFinally() {
        try {
            // If we exposed a Reader in doStartTag(), close it.
            if (varReader != null) {
                // 'r' can be null if an exception was thrown...
                if (r != null) {
                    r.close();
                }
                pageContext.removeAttribute(varReader, PageContext.PAGE_SCOPE);
            }
        } catch (IOException ex) {
            // ignore it; close() failed, but there's nothing more we can do
        }
    }
445418
public function close()
	{
		$writer = PHPExcel_IOFactory::createWriter( $this->_container, $this->_format );
		$writer->save( $this->_resourcepath );
	}
1065772
protected void finish() {
        Reporter reporter = this.reporterThreadLocal.get();
        assertEquals("Detailed results found at: " + reporter.getFileName(), "0 errors",
                Integer.toString(reporter.getFails()) + ERRORS_CHECK);
    }
1095199
def close(self):
        """"""
        if self._cache:
            if self._update_cache:
                self._write_cache_to_file()
            self._cache = None
31087
def close(self):
        
        if self.read_option('save_pointer'):
            self._update_last_pointer()
        super(S3Writer, self).close()
589042
public function close()
    {
        parent::close();
        $this->closeWrite();
        if (is_resource($this->pd)) {
            proc_close($this->pd);
        }
    }
1011878
def close(self):
        """"""
        if not self.closed:
            # be sure to flush data to disk before closing the file
            self.flush()
            err = _snd.sf_close(self._file)
            self._file = None
            _error_check(err)
927856
public function close()
    {
        if (!is_resource($this->sheetFilePointer)) {
            return;
        }

        fwrite($this->sheetFilePointer, '</sheetData>');
        fwrite($this->sheetFilePointer, '</worksheet>');
        fclose($this->sheetFilePointer);
    }
1290504
public function close()
    {
        $contents = ob_get_clean();
        header("Connection: close\r\n");
        header("Content-Encoding: none\r\n");
        ignore_user_abort(true);
        ob_start();
        echo $contents;
        $size = ob_get_length();
        header("Content-Length: $size");
        if(function_exists('fastcgi_finish_request'))
            fastcgi_finish_request();
        ob_end_flush();
        flush();
        ob_end_clean();
    }
1094243
public function endWrite()
    {
        if (false !== $this->firstHarvestedId) {
            $this->saveFile(
                $this->firstHarvestedId, $this->getCombinedXML($this->innerXML)
            );
        }

        if (!empty($this->deletedIds)) {
            $this->saveDeletedRecords($this->deletedIds);
        }
    }