Write a pamqp frame from the current channel.

        :param specification.Frame frame_out: A single pamqp frame.

        :return:
979614
def write_frame(self, frame_out):
        
        self.check_for_errors()
        self._connection.write_frame(self.channel_id, frame_out)
1079913
def dispatch(self, frame):
        '''
        
        '''
        if frame.type() == HeartbeatFrame.type():
            self.send_heartbeat()

        elif frame.type() == MethodFrame.type():
            if frame.class_id == 10:
                cb = self._method_map.get(frame.method_id)
                if cb:
                    method = self.clear_synchronous_cb(cb)
                    method(frame)
                else:
                    raise Channel.InvalidMethod(
                        "unsupported method %d on channel %d",
                        frame.method_id, self.channel_id)
            else:
                raise Channel.InvalidClass(
                    "class %d is not supported on channel %d",
                    frame.class_id, self.channel_id)

        else:
            raise Frame.InvalidFrameType(
                "frame type %d is not supported on channel %d",
                frame.type(), self.channel_id)
1246561
function FrameWriter(opcode, streamId) {
  if (!opcode) {
    throw new Error('Opcode not provided');
  }
  this.streamId = streamId;
  this.buffers = [];
  this.opcode = opcode;
}
806007
def write_frames(self, frames_out):
        
        self.check_for_errors()
        self._connection.write_frames(self.channel_id, frames_out)
763600
def subscribe(self, frame):
        
        ack = frame.headers.get('ack')
        reliable = ack and ack.lower() == 'client'

        self.engine.connection.reliable_subscriber = reliable

        dest = frame.headers.get('destination')
        if not dest:
            raise ProtocolError('Missing destination for SUBSCRIBE command.')

        if dest.startswith('/queue/'):
            self.engine.queue_manager.subscribe(self.engine.connection, dest)
        else:
            self.engine.topic_manager.subscribe(self.engine.connection, dest)
1230625
def _write(self, frame):
        
        for data in frame.to_feature_reports(debug=self.debug):
            debug_str = None
            if self.debug:
                (data, debug_str) = data
            # first, we ensure the YubiKey will accept a write
            self._waitfor_clear(yubikey_defs.SLOT_WRITE_FLAG)
            self._raw_write(data, debug_str)
        return True
1362765
def _recv_flow(self, method_frame):
        '''
        
        '''
        self.channel._active = method_frame.args.read_bit()

        args = Writer()
        args.write_bit(self.channel.active)
        self.send_frame(MethodFrame(self.channel_id, 20, 21, args))

        if self._flow_control_cb is not None:
            self._flow_control_cb()
1286600
private void sendGrpcFrame(ChannelHandlerContext ctx, SendGrpcFrameCommand cmd,
      ChannelPromise promise) throws Http2Exception {
    if (cmd.endStream()) {
      closeStreamWhenDone(promise, cmd.streamId());
    }
    // Call the base class to write the HTTP/2 DATA frame.
    encoder().writeData(ctx, cmd.streamId(), cmd.content(), 0, cmd.endStream(), promise);
  }
465857
def write(self,output):
        
        w = c_int32()
        self.WriteAnalogF64(self.npoints, 0, 10.0, DAQmx_Val_GroupByChannel,
                            output, w, None);
1252236
def _process_method_frame(self, channel, payload):
        
        method_sig = unpack('>HH', payload[:4])
        args = AMQPReader(payload[4:])

        if method_sig in _CONTENT_METHODS:
            #
            # Save what we've got so far and wait for the content-header
            #
            self.partial_messages[channel] = _PartialMessage(method_sig, args)
            self.expected_types[channel] = 2
        else:
            self.queue.put((channel, method_sig, args, None))
117690
def get_frame(self, outdata, frames, timedata, status):
		

		if not self.keep_listening:
			raise sd.CallbackStop
		
		try:
			chunk = self.queue.get_nowait()
			# Check if the chunk contains the expected number of frames
			# The callback function raises a ValueError otherwise.
			if chunk.shape[0] == frames:
				outdata[:] = chunk
			else:
				outdata.fill(0)
		except Empty:
			outdata.fill(0)
563103
def write(tsdict, outfile, start=None, end=None,
          name='gwpy', run=0):
    
    if not start:
        start = list(tsdict.values())[0].xspan[0]
    if not end:
        end = list(tsdict.values())[0].xspan[1]
    duration = end - start

    # get ifos list
    detectors = 0
    for series in tsdict.values():
        try:
            idx = list(lalutils.LAL_DETECTORS.keys()).index(series.channel.ifo)
            detectors |= 1 << 2*idx
        except (KeyError, AttributeError):
            continue

    # create new frame
    frame = lalframe.FrameNew(start, duration, name, run, 0, detectors)

    for series in tsdict.values():
        # convert to LAL
        lalseries = series.to_lal()

        # find adder
        add_ = lalutils.find_typed_function(
            series.dtype, 'FrameAdd', 'TimeSeriesProcData', module=lalframe)

        # add time series to frame
        add_(frame, lalseries)

    # write frame
    lalframe.FrameWrite(frame, outfile)
594907
function sendFrame(socket, _frame) {
  var frame = _frame;

  if (!_frame.hasOwnProperty('toString')) {
    frame = new Frame({
      'command': _frame.command,
      'headers': _frame.headers,
      'body': _frame.body
    });
  }

  socket.send(frame.toStringOrBuffer());
  return true;
}
329834
def _write_frame(self, data):
        """"""
        assert data is not None and 0 < len(data) < 255, 'Data must be array of 1 to 255 bytes.'
        # Build frame to send as:
        # - SPI data write (0x01)
        # - Preamble (0x00)
        # - Start code  (0x00, 0xFF)
        # - Command length (1 byte)
        # - Command length checksum
        # - Command bytes
        # - Checksum
        # - Postamble (0x00)
        length = len(data)
        frame = bytearray(length+8)
        frame[0] = PN532_SPI_DATAWRITE
        frame[1] = PN532_PREAMBLE
        frame[2] = PN532_STARTCODE1
        frame[3] = PN532_STARTCODE2
        frame[4] = length & 0xFF
        frame[5] = self._uint8_add(~length, 1)
        frame[6:-2] = data
        checksum = reduce(self._uint8_add, data, 0xFF)
        frame[-2] = ~checksum & 0xFF
        frame[-1] = PN532_POSTAMBLE
        # Send frame.
        logger.debug('Write frame: 0x{0}'.format(binascii.hexlify(frame)))
        self._gpio.set_low(self._cs)
        self._busy_wait_ms(2)
        self._spi.write(frame)
        self._gpio.set_high(self._cs)
486645
protected function prepare_channel_method_frame($channel, $method_sig, $args = '', $pkt = null)
    {
        if ($args instanceof AMQPWriter) {
            $args = $args->getvalue();
        }

        $pkt = $pkt ?: new AMQPWriter();

        $pkt->write_octet(1);
        $pkt->write_short($channel);
        $pkt->write_long(mb_strlen($args, 'ASCII') + 4); // 4 = length of class_id and method_id
        // in payload

        $pkt->write_short($method_sig[0]); // class_id
        $pkt->write_short($method_sig[1]); // method_id
        $pkt->write($args);

        $pkt->write_octet(0xCE);

        $this->debug->debug_method_signature1($method_sig);

        return $pkt;
    }
437306
def _send_open_connection(self):
        
        open_frame = specification.Connection.Open(
            virtual_host=self._parameters['virtual_host']
        )
        self._write_frame(open_frame)
722828
def write(self, frame):
        """"""
        if not isinstance(frame, FrameBase):
            raise PyVLXException("Frame not of type FrameBase", frame_type=type(frame))
        PYVLXLOG.debug("SEND: %s", frame)
        self.transport.write(slip_pack(bytes(frame)))