Synchronous write
428744
function writeFileSync (filename, content, options) {
  if (typeof filename !== 'string') {
    throw new Error('path must be a string')
  }

  mkdirp.sync(path.dirname(filename))
  fs.writeFileSync(filename, content, options)
}
1070817
async def write_and_drain(self, data: bytes, timeout: NumType = None) -> None:
        
        if self._stream_writer is None:
            raise SMTPServerDisconnected("Client not connected")

        self._stream_writer.write(data)

        async with self._io_lock:
            await self._drain_writer(timeout)
1019624
function fsWrite(fd, buffer, position, callback) {
  var offset = 0,
      length = buffer.length;

  function writeChunk() {
    fs.write(fd, buffer, offset, length - offset, position, function (err, bytesWritten) {
      if (err) { callback(err); return; }
      offset += bytesWritten;
      if (offset < length) {
        writeChunk();
        return;
      }
      callback();
    });
  }
  writeChunk();
}
731794
function(data, showStatus, callback) {
    if (showStatus===undefined) showStatus=true;

    /* Queue our data to write. If there was previous data and no callback to
    invoke on this data or the previous then just append data. This would happen
    if typing in the terminal for example. */
    if (!callback && writeData.length && !writeData[writeData.length-1].callback) {
      writeData[writeData.length-1].data += data;
    } else {
      writeData.push({data:data,callback:callback,showStatus:showStatus});
      /* if this is our first data, start sending now. Otherwise we're already
      busy sending and will pull data off writeData when ready */
      if (writeData.length==1)
        writeSerialWorker(true);
    }
  }
430547
def write(self, data, *, mode=None, buffering=-1, encoding=None, newline=None):
        '''  '''
        if mode is None:
            mode = 'w' if isinstance(data, str) else 'wb'
        with self.open(mode=mode, buffering=buffering, encoding=encoding, newline=newline) as fp:
            return fp.write(data)
879431
private void writeToNetwork(EngineConnection engineConnection) {
      final String methodName = "writeToNetwork";
      logger.entry(this, methodName, engineConnection);

        if (engineConnection.transport.pending() > 0) {
            ByteBuffer head = engineConnection.transport.head();
            int amount = head.remaining();
            engineConnection.channel.write(head, new NetworkWritePromiseImpl(this, amount, engineConnection));
            engineConnection.transport.pop(amount);
            engineConnection.transport.tick(System.currentTimeMillis());
        }

        logger.exit(this, methodName);
    }
1052964
public void write(int c) {
        try {
            synchronized (lock) {
                ensureOpen();
                out.write(c);
            }
        }
        catch (InterruptedIOException x) {
            Thread.currentThread().interrupt();
        }
        catch (IOException x) {
            trouble = true;
        }
    }
365426
def __sync(self):
    """"""
    pad_length = _BLOCK_SIZE - self.__reader.tell() % _BLOCK_SIZE
    if pad_length and pad_length != _BLOCK_SIZE:
      data = self.__reader.read(pad_length)
      if len(data) != pad_length:
        raise EOFError('Read %d bytes instead of %d' %
                       (len(data), pad_length))
1280758
def __interact_writen(self, fd, data):
        '''
        '''

        while data != b'' and self.isalive():
            n = os.write(fd, data)
            data = data[n:]
1013322
async def write(self, data):
        
        self.writer.write((bytes([ord(data)])))
        await self.writer.drain()
1137668
def _writen(fd, data):
    """"""
    while data:
        n = os.write(fd, data)
        data = data[n:]
621604
def publish_synchronous(self, *args, **kwargs):
        '''
        
        '''
        cb = kwargs.pop('cb', None)
        self.tx.select()
        self.basic.publish(*args, **kwargs)
        self.tx.commit(cb=cb)
56321
def _write(self, data, length, progress_callback=None):
    """"""
    if progress_callback:
      progress = self._handle_progress(length, progress_callback)
      six.next(progress)
    while length:
      tmp = data.read(FASTBOOT_DOWNLOAD_CHUNK_SIZE_KB * 1024)
      length -= len(tmp)
      self.usb.write(tmp)

      if progress_callback:
        progress.send(len(tmp))
1251507
def on_writable
      begin
        @_write_buffer.write_to(@_io)
      rescue Errno::EINTR
        return

      # SystemCallError catches Errno::EPIPE & Errno::ECONNRESET amongst others.
      rescue SystemCallError, IOError, SocketError
        return close
      end

      if @_write_buffer.empty?
        disable_write_watcher
        on_write_complete
      end
    end
409146
def write(self, addr, data):
        '''

        '''
        self.set_addr(addr & 0xfe)
        self.set_data(data)
        self.set_size(len(data))
        self.start()
        while not self.is_ready:
            pass
1143624
def _perform_write(self, addr, data):
        """"""
        return self._machine_controller.write(addr, data, self._x, self._y, 0)
965210
function (fp, cb) {
    if (typeof fp === 'function') {
      cb = fp;
      fp = null;
    }

    if (typeof cb !== 'function') {
      throw new Error('async `write` was called without a callback function.');
    }

    var dest = fp || this.dest.path;
    var src = this.src.path;
    var str = this.content;

    if (str) {
      lazy.write(dest, str, cb);
    } else {
      lazy.copy(src, dest, cb);
    }

    this.emit('write', dest);
    return this;
  }