Write the points to the ZeroMQ server.
175900
def export(self, name, columns, points):
        """"""
        logger.debug("Export {} stats to ZeroMQ".format(name))

        # Create DB input
        data = dict(zip(columns, points))

        # Do not publish empty stats
        if data == {}:
            return False

        # Glances envelopes the stats in a publish message with two frames:
        # - First frame containing the following prefix (STRING)
        # - Second frame with the Glances plugin name (STRING)
        # - Third frame with the Glances plugin stats (JSON)
        message = [b(self.prefix),
                   b(name),
                   asbytes(json.dumps(data))]

        # Write data to the ZeroMQ bus
        # Result can be view: tcp://host:port
        try:
            self.client.send_multipart(message)
        except Exception as e:
            logger.error("Cannot export {} stats to ZeroMQ ({})".format(name, e))

        return True
302749
def write(self, s):
        
        if self.comptype == "gz":
            self.crc = self.zlib.crc32(s, self.crc)
        self.pos += len(s)
        if self.comptype != "tar":
            s = self.cmp.compress(s)
        self.__write(s)
906196
def write(self, *messages):
        """"""

        for i in self.graph.outputs_of(BEGIN):
            for message in messages:
                self[i].write(message)
1258582
def send_point(point)
      if opts[:noop]
        logger.log "Would send: #{point}"
        return
      end

      logger.log("Sending: #{point}", :debug)
      writer.send_point(point)
    end
321684
def write(self):
        """"""
        with open(self.log_path, "w") as f:
            json.dump(self.log_dict, f, indent=1)
724956
def write(self, stream):
        """"""
        topology = self.createTopology()
        def write_it(stream):
            transportOut = TMemoryBuffer()
            protocolOut = TBinaryProtocol.TBinaryProtocol(transportOut)
            topology.write(protocolOut)
            bytes = transportOut.getvalue()
            stream.write(bytes)

        if isinstance(stream, six.string_types):
            with open(stream, 'wb') as f:
                write_it(f)
        else:
            write_it(stream)
            
        return topology
1098235
def write(self, out):
        """"""
        out.write_string(self.address, len(self.address))
73795
def main(uport):
    """"""
    # NOTE: structure of the UDP packet is different than that of information
    #       sent via HTTP
    json_body = {
        "tags": {
            "host": "server01",
            "region": "us-west"
        },
        "time": "2009-11-10T23:00:00Z",
        "points": [{
            "measurement": "cpu_load_short",
            "fields": {
                "value": 0.64
            }
        },
            {
                "measurement": "cpu_load_short",
                "fields": {
                    "value": 0.67
                }
        }]
    }

    # make `use_udp` True and  add `udp_port` number from `influxdb.conf` file
    # no need to mention the database name since it is already configured
    client = InfluxDBClient(use_udp=True, udp_port=uport)

    # Instead of `write_points` use `send_packet`
    client.send_packet(json_body)
103980
def write_table(self, d):
        """"""
        self._flushbits()
        table_data = AMQPWriter()
        for k, v in items(d):
            table_data.write_shortstr(k)
            table_data.write_item(v, k)
        table_data = table_data.getvalue()
        self.write_long(len(table_data))
        self.out.write(table_data)
514548
def write(self, fptr):
        
        length = 8 + 4 * len(self.component_index)
        write_buffer = struct.pack('>I4s', length, b'cmap')
        fptr.write(write_buffer)

        for j in range(len(self.component_index)):
            write_buffer = struct.pack('>HBB',
                                       self.component_index[j],
                                       self.mapping_type[j],
                                       self.palette_index[j])
            fptr.write(write_buffer)
348247
def post(self):
        """"""
        body = tornado.escape.json_decode(self.request.body)

        try:
            self._bo.register(
                params=body["params"],
                target=body["target"],
            )
            print("BO has registered: {} points.".format(len(self._bo.space)), end="\n\n")
        except KeyError:
            pass
        finally:
            suggested_params = self._bo.suggest(self._uf)

        self.write(json.dumps(suggested_params))
459088
protected void write() throws Exception {
		ByteBuffer buffer = queue.peek();
		if (buffer == null) {
			if (key != null) {
				key.interestOps(0);
			}
			return;
		}
		if (channel != null) {
			int count;
			while (true) {
				count = channel.write(buffer);

				// Debug
				if (debug) {
					logger.info(count + " bytes submitted to " + channel.getRemoteAddress() + ".");
				}

				// EOF?
				if (count == -1) {
					throw new InvalidPacketDataError(nodeID, "host", host, "port", port);
				}

				// Remove the submitted buffer from the queue
				if (!buffer.hasRemaining()) {
					queue.poll();
				}

				// Turn off write mode (if the queue is empty)
				if (queue.isEmpty()) {
					if (blockerBuffer.compareAndSet(buffer, null) && key != null) {
						key.interestOps(0);
					}
					return;
				} else {
					buffer = queue.peek();
				}
			}
		}
	}
298478
def write(self, memory, addr, data, flush_queue=False):
        """"""
        wreq = _WriteRequest(memory, addr, data, self.cf)
        if memory.id not in self._write_requests:
            self._write_requests[memory.id] = []

        # Workaround until we secure the uplink and change messages for
        # mems to non-blocking
        self._write_requests_lock.acquire()
        if flush_queue:
            self._write_requests[memory.id] = self._write_requests[
                memory.id][:1]
        self._write_requests[memory.id].insert(len(self._write_requests), wreq)
        if len(self._write_requests[memory.id]) == 1:
            wreq.start()
        self._write_requests_lock.release()

        return True
304073
def write_users(arguments):
    """"""
    import coil.init
    u = coil.utils.ask("Redis URL", "redis://localhost:6379/0")
    return coil.init.write_users(u)
66549
def _Write(self, data, length, progress_callback=None):
        """"""
        if progress_callback:
            progress = self._HandleProgress(length, progress_callback)
            next(progress)
        while length:
            tmp = data.read(self.chunk_kb * 1024)
            length -= len(tmp)
            self.usb.BulkWrite(tmp)

            if progress_callback and progress:
                progress.send(len(tmp))
1252445
def write_frames(self, channel_id, frames_out):
        
        data_out = EMPTY_BUFFER
        for single_frame in frames_out:
            data_out += pamqp_frame.marshal(single_frame, channel_id)
        self.heartbeat.register_write()
        self._io.write_to_socket(data_out)
707270
def write(self, chunk):
        """"""
        if self.chunked_write and chunk:
            buf = [hex(len(chunk))[2:], CRLF, chunk, CRLF]
            self.conn.wfile.sendall("".join(buf))
        else:
            self.conn.wfile.sendall(chunk)