Write data to the GoogleCloudStorage file.

    Args:
      data: string containing the data to be written.
422462
def write(self, data):
    
    start_time = time.time()
    self._get_write_buffer().write(data)
    ctx = context.get()
    operation.counters.Increment(COUNTER_IO_WRITE_BYTES, len(data))(ctx)
    operation.counters.Increment(
        COUNTER_IO_WRITE_MSEC, int((time.time() - start_time) * 1000))(ctx)
951645
def write(self, data):
        
        if self.padded:
            # flush out any remaining bits first
            if len(self._bits) > 0:
                self._flush_bits_to_stream()
            self._stream.write(data)
        else:
            # nothing to do here
            if len(data) == 0:
                return

            bits = bytes_to_bits(data)
            self.write_bits(bits)
1079177
def write(self, data):
        
        
        # Do the write
        self.backingStream.write(data)
        
        for listener in self.writeListeners:
            # Send out notifications
            listener(len(data))
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)
1146256
def write(self, data):
    
    ctx = context.get()
    if len(data) != 2:
      logging.error("Got bad tuple of length %d (2-tuple expected): %s",
                    len(data), data)

    try:
      key = str(data[0])
      value = str(data[1])
    except TypeError:
      logging.error("Expecting a tuple, but got %s: %s",
                    data.__class__.__name__, data)

    file_index = key.__hash__() % len(self._filehandles)

    # Work-around: Since we don't have access to the context in the to_json()
    # function, but we need to flush each pool before we serialize the
    # filehandle, we rely on a member variable instead of using context for
    # pool management.
    pool = self._pools[file_index]
    if pool is None:
      filehandle = self._filehandles[file_index]
      pool = output_writers.GCSRecordsPool(filehandle=filehandle, ctx=ctx)
      self._pools[file_index] = pool

    proto = kv_pb.KeyValue()
    proto.set_key(key)
    proto.set_value(value)
    pool.append(proto.Encode())
1203116
def write_data(self, data, data_file, compression=0):
    
    f = bob.io.base.HDF5File(data_file, 'w')
    f.set("rate", data[0], compression=compression)
    f.set("data", data[1], compression=compression)
    f.set("labels", data[2], compression=compression)
60144
def write(self, data):
        """"""
        for chunk in chunks(data, 512):
            self.wait_to_write()
            self.comport.write(chunk)
        self.comport.flush()
185836
def outputdata(self, data):
        
        if not isinstance(data, bytes):
            data = str(data).encode(self.encoding)
        self.output(MemoryStream(data))
795833
def write(self, data):
        

        while data:
            try:
                n = self._socket.send(data)
            except socket.error:
                n = None
            if not n:
                raise EOFError('Socket closed')
            data = data[n:]
98391
def writeline(self, data):
        
        try:
            if self.ch_mode:
                data += "\n"
                parts = split_by_n(data, self.ch_mode_chunk_size)
                for split_str in parts:
                    self.port.write(split_str.encode())
                    time.sleep(self.ch_mode_ch_delay)
            else:
                self.port.write((data + "\n").encode())
        except SerialException as err:
            self.logger.exception("SerialError occured while trying to write data {}.".format(data))
            raise RuntimeError(str(err))
1278942
def writeln(self, data):
        
        self.f.write(" "*self.indent_level)
        self.f.write(data + "\n")
380526
def write(self, data):
        
        self._file.write('<cml>')
        self.__write(data)
        self.write = self.__write
462728
def json(self, data):
        
        self.write(json_.encode(data))
        self.set_header('Content-type', 'application/json')
30240
def write(self, data):
        
        if not isinstance(data, (bytes, bytearray, memoryview)):
            raise TypeError('data argument must be byte-ish (%r)',
                            type(data))

        if not self._state.is_writable or self._closing:
            raise self._invalid_state("write() called")

        if not data:
            return

        if not self._buffer:
            self._loop.add_writer(self._raw_fd, self._write_ready)

        self._buffer.extend(data)
1145968
public void write(final String data) throws IOException {
        if (socket != null) {
            out.write(data.getBytes());
        }
    }
922449
public void write(byte[] data) {
        for(int i=0;i<data.length;i++) {
            writeByte(data[i]);
        }
    }
567535
public void writeData(String data) {
        _buffer.append("<![CDATA[");
        _buffer.append( data);
        _buffer.append( "]]>");
    }