Writes data to block. You should be authenticated before calling write.
        Returns error state.
512863
def write(self, block_address, data):
        
        buf = []
        buf.append(self.act_write)
        buf.append(block_address)
        crc = self.calculate_crc(buf)
        buf.append(crc[0])
        buf.append(crc[1])
        (error, back_data, back_length) = self.card_write(self.mode_transrec, buf)
        if not(back_length == 4) or not((back_data[0] & 0x0F) == 0x0A):
            error = True

        if not error:
            buf_w = []
            for i in range(16):
                buf_w.append(data[i])

            crc = self.calculate_crc(buf_w)
            buf_w.append(crc[0])
            buf_w.append(crc[1])
            (error, back_data, back_length) = self.card_write(self.mode_transrec, buf_w)
            if not(back_length == 4) or not((back_data[0] & 0x0F) == 0x0A):
                error = True

        return error
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)
1193749
public void writeBlock(byte[] block) throws IOException {

        if (block.length != 512) {
            throw new IllegalArgumentException(
                RB.singleton.getString(RB.BAD_BLOCK_WRITE_LEN, block.length));
        }

        write(block, block.length);
    }
209598
void padAndWriteBlock(boolean writeEmptyBlockIfFull) throws IOException {
    int remaining = writeBuffer.remaining();
    if (writeEmptyBlockIfFull || remaining < blockSize) {
      writeBlanksToBuffer(remaining);
      writeBuffer.flip();
      delegate.write(writeBuffer);
      writeBuffer.clear();
      numBlocksWritten++;
    }
  }
851931
def write_block_data(self, cmd, block):
        
        self.bus.write_i2c_block_data(self.address, cmd, block)
        self.log.debug(
            "write_block_data: Wrote [%s] to command register 0x%02X" % (
                ', '.join(['0x%02X' % x for x in block]),
                cmd
            )
        )
623160
public void write( DataOutput out ) throws IOException {
    WritableUtils.writeVInt(out, blocks.length);
    for(int i=0; i<blocks.length; i++) {
      blocks[i].write(out);
    }
  }
697252
@Override
	protected void writeAllocationBlock( int blockIndex ) throws DataStoreException
    {
    	byte[] allocationBlock = serializeAllocationBlock(blockIndex);
        journal.writeMetaDataBlock(AT_HEADER_SIZE+blockIndex*AT_BLOCK_SIZE, allocationBlock);
    }
1073288
public void write(DataOutput out) throws IOException {
    out.writeLong(blockId);
    out.writeLong(numBytes);
    out.writeLong(generationStamp);
  }
312505
def _net_write(sock, data, expiration):
    
    current = 0
    l = len(data)
    while current < l:
        _wait_for_writable(sock, expiration)
        current += sock.send(data[current:])
461563
def write(s)
      if idle_timeout
        if (t=Time.now) > @last_write + idle_timeout
          @socket.close rescue nil
          connect
        else
          @last_write = t
        end
      end
      begin
        retry_id ||= 0
        do_write(s)
      rescue => e
        if (retry_id += 1) < @retries
          @socket.close rescue nil
          connect
          retry
        else
          raise e
        end
      end
    end
994863
public void write(DataOutput out) throws IOException {
    out.writeLong(blockId);
    out.writeLong(blockGenStamp);
    super.write(out);
  }
413972
def write(self, data):
        """"""
        self.request(
            url="write",
            method='POST',
            params=None,
            data=data,
            expected_response_code=200
        )
        return True
427272
def write(self, data):
        
        self._check_writable()
        self._transport._can_write.wait()
        self._transport.write(data)
296949
def write(self, byte):
        
        if self.is_closed_flag:
            raise Exception("Unable to write - already closed!")
        self.written += len(byte)
        self.file.write(byte)
1014867
def write(self, data):
        
        _complain_ifclosed(self.closed)
        if self.__encoding:
            self.f.write(data.encode(self.__encoding, self.__errors))
            return len(data)
        else:
            return self.f.write(data)
945134
def write(key, data = nil, parameters = {}, conditions = {})
      if writable?(key, parameters, conditions)
        begin
          @memcached.set(normalize(key, parameters), data, expire_time(conditions))
          true
        rescue
          nil
        end
      end
    end
1136297
def _writeblocks(cls, blocks, available, cont_size, padding_func):
        """"""

        # write everything except padding
        data = bytearray()
        for block in blocks:
            if isinstance(block, Padding):
                continue
            data += cls._writeblock(block)
        blockssize = len(data)

        # take the padding overhead into account. we always add one
        # to make things simple.
        padding_block = Padding()
        blockssize += len(cls._writeblock(padding_block))

        # finally add a padding block
        info = PaddingInfo(available - blockssize, cont_size)
        padding_block.length = min(info._get_padding(padding_func),
                                   cls._MAX_SIZE)
        data += cls._writeblock(padding_block, is_last=True)

        return data