Write end of output info, and flush all output buffers.
337905
def end_output (self, **kwargs):
        """"""
        self.stats.downloaded_bytes = kwargs.get("downloaded_bytes")
        self.stats.num_urls = kwargs.get("num_urls")
        if self.has_part('stats'):
            self.write_stats()
        if self.has_part('outro'):
            self.write_outro(interrupt=kwargs.get("interrupt"))
        self.close_fileoutput()
936304
def write(self, message, flush=False):
        """"""
        # this need be threadsafe because the concurrent spinning running on
        # the stderr
        with self.lock:
            self.paralell_stream.erase()
            super(Clean, self).write(message, flush)
696212
def flush(self):
        """"""
        if self._wbuf:
            buffer = ''.join(self._wbuf)
            self._wbuf = []
            self.write(buffer)
1343430
public void setOutput(Writer output, boolean close)
	{
		reset();
		w = new BufferedWriter(output);
		closeWriter = close;
	}
345072
function flush(writeTo) {
    var outputTo = bufferLen + matchStart - chunkLength;

    while (outputTo > 0 && outputTo > bufferStart) {
      if (outputTo > buffer[0].length-1) {
        var part = buffer.shift();
        outputBuffer.push(part.slice(bufferStart));

        bufferStart = Math.max(0, bufferStart - part.length);
        bufferLen -= part.length;
        outputTo -= part.length;
      } else {
        outputBuffer.push(buffer[0].slice(bufferStart, outputTo));
        bufferStart = outputTo;
        break;
      }
    }
    if (writeTo) {
      // Output everything ready as one chunk
      writeTo.push(outputBuffer.join(''));
      outputBuffer.length = 0;
    }
  }
232970
protected void flushBuffer() throws IOException {
		if (capacity == 0) {
			ostream.write(buffer);
			capacity = BITS_IN_BYTE;
			buffer = 0;
			len++;
		}
	}
81109
def write(self, data, end="\n", flush=True):
        
        if not self.nostdout:
            self.stdout.write(data+end)
        if self.file is not None:
            self.file.write(data+end)
        if flush:
            self.flush()
960516
def flush(self):
        """"""
        if self.mode != 'r':
            with self.mutex:
                self.zf.close()
                # N.B., re-open with mode 'a' regardless of initial mode so we don't wipe
                # what's been written
                self.zf = zipfile.ZipFile(self.path, mode='a',
                                          compression=self.compression,
                                          allowZip64=self.allowZip64)
1172875
void flushBuffer() throws IOException {
        synchronized (lock) {
            ensureOpen();
            if (nextChar == 0)
                return;
            out.write(cb, 0, nextChar);
            nextChar = 0;
        }
    }
1178503
public void flush()
  {
    Writer out = this.out;
    if (out == null)
      return;

    try {
      out.flush();
    } catch (IOException e) {
      log.log(Level.FINE, e.toString(), e);
    }
  }
51795
def end_output (self, **kwargs):
        """"""
        self.xml_endtag(u"urlset")
        self.xml_end_output()
        self.close_fileoutput()
1055506
def _flush(self, finish=False):
    
    while ((finish and self._buffered >= 0) or
           (not finish and self._buffered >= self._blocksize)):
      tmp_buffer = []
      tmp_buffer_len = 0

      excess = 0
      while self._buffer:
        buf = self._buffer.popleft()
        size = len(buf)
        self._buffered -= size
        tmp_buffer.append(buf)
        tmp_buffer_len += size
        if tmp_buffer_len >= self._maxrequestsize:
          excess = tmp_buffer_len - self._maxrequestsize
          break
        if not finish and (
            tmp_buffer_len % self._blocksize + self._buffered <
            self._blocksize):
          excess = tmp_buffer_len % self._blocksize
          break

      if excess:
        over = tmp_buffer.pop()
        size = len(over)
        assert size >= excess
        tmp_buffer_len -= size
        head, tail = over[:-excess], over[-excess:]
        self._buffer.appendleft(tail)
        self._buffered += len(tail)
        if head:
          tmp_buffer.append(head)
          tmp_buffer_len += len(head)

      data = ''.join(tmp_buffer)
      file_len = '*'
      if finish and not self._buffered:
        file_len = self._written + len(data)
      self._send_data(data, self._written, file_len)
      self._written += len(data)
      if file_len != '*':
        break
380487
def write_data(self):
        """"""
        self.output_file.write(self.downloaded_file_buffer)
        self.output_file.close()
        self.finished_flag = True
846954
def flush(self):
        """"""
        writer = self.writer
        if writer is None:
            raise GaugedUseAfterFreeError
        self.flush_writer_position()
        keys = self.translate_keys()
        blocks = []
        current_block = self.current_block
        statistics = self.statistics
        driver = self.driver
        flags = 0  # for future extensions, e.g. block compression
        for namespace, key, block in self.pending_blocks():
            length = block.byte_length()
            if not length:
                continue
            key_id = keys[(namespace, key)]
            statistics[namespace].byte_count += length
            blocks.append((namespace, current_block, key_id, block.buffer(),
                           flags))
        if self.config.overwrite_blocks:
            driver.replace_blocks(blocks)
        else:
            driver.insert_or_append_blocks(blocks)
            if not Gauged.writer_flush_maps(writer, True):
                raise MemoryError
        update_namespace = driver.add_namespace_statistics
        for namespace, stats in statistics.iteritems():
            update_namespace(namespace, self.current_block,
                             stats.data_points, stats.byte_count)
        statistics.clear()
        driver.commit()
        self.flush_now = False
727194
def flush(self):
        
        self._write_all(self._wbuffer.getvalue())
        self._wbuffer = BytesIO()
        return
910393
public void flush() throws IOException {
        final ByteOutput output = this.output;
        final int pos = this.position;
        if (pos > 0) {
            output.write(CHUNK_START);
            writeInt(pos);
            final byte[] buffer = this.buffer;
            output.write(buffer, 0, pos);
        }
        this.position = 0;
    }
914975
private void flushBuffer() throws IOException
    {
        while (_flush.hasRemaining())
        {
            int len=_channel.write(_flush);
            if (len<0)
                throw new IOException("EOF");
            if (len==0)
            {
                // write channel full.  Try letting other threads have a go.
                Thread.yield();
                len=_channel.write(_flush);
                if (len<0)
                    throw new IOException("EOF");
                if (len==0)
                {
                    // still full.  need to  block until it is writable.
                    if (_selector==null)
                     {
                            _selector=Selector.open();
                            _channel.register(_selector,SelectionKey.OP_WRITE);
                     }

                     _selector.select();
                }
            }
        }
    }