Process a received 'Single Frame' frame
12817
def _recv_sf(self, data):
        """"""
        self.rx_timer.cancel()
        if self.rx_state != ISOTP_IDLE:
            warning("RX state was reset because single frame was received")
            self.rx_state = ISOTP_IDLE

        length = six.indexbytes(data, 0) & 0xf
        if len(data) - 1 < length:
            return 1

        msg = data[1:1 + length]
        self.rx_queue.put(msg)
        for cb in self.rx_callbacks:
            cb(msg)
        self.call_release()
        return 0
791110
function(frame, frameSize) {
    const opcode = encoders.opcode('PROCESS_FRAME');

    const time = new Float64Array(1);
    time[0] = frame.time;

    const data = new Float32Array(frameSize);
    for (let i = 0; i < frameSize; i++)
      data[i] = frame.data[i];

    const metadata = json2Uint16Array(frame.metadata);

    const length = 1 + 4 + (2 * frameSize) + metadata.length;
    const payload = new Uint16Array(length);
    payload.set(opcode, 0);
    payload.set(new Uint16Array(time.buffer), 1);
    payload.set(new Uint16Array(data.buffer), 1 + 4);
    payload.set(metadata, 1 + 4 + (2 * frameSize));

    return payload.buffer;
  }
1161309
def from_frame(cls, frame):
        """"""
        # TODO: Check length
        ipframe = cls(frame[2] * 256 + frame[3])
        ipframe.body = frame[6:]
        return ipframe
350770
def get_frame(self, idx):
        """"""
        cont = self.data[idx]
        frame = int(cont.strip().split(" ", 1)[0])
        return frame
1332292
def frameify(self, state, data):
        """"""

        # If we've pulled in all the chunk data, buffer the data
        if state.chunk_remaining <= 0:
            state.recv_buf += data
            return

        # Pull in any partially-processed data
        data = state.recv_buf + data

        # Determine how much belongs to the chunk
        if len(data) <= state.chunk_remaining:
            chunk = data
            data = ''
        else:
            # Pull out only what's part of the chunk
            chunk = data[:state.chunk_remaining]
            data = data[state.chunk_remaining:]

        # Update the state
        state.recv_buf = data
        state.chunk_remaining -= len(chunk)

        # Yield the chunk
        try:
            yield chunk
        except FrameSwitch:
            pass
1248686
def as_frame(self):
        
        sids, frames = self.response_map.keys(), self.response_map.values()
        frame = pd.concat(frames, keys=sids, axis=1)
        return frame
778376
def _parseAtFrame(self, src):
        
        src = src[len('@frame '):].lstrip()
        box, src = self._getIdent(src)
        src, properties = self._parseDeclarationGroup(src.lstrip())
        result = [self.cssBuilder.atFrame(box, properties)]
        return src.lstrip(), result
1106478
private void handleLastFrame(AbstractFramedStreamSourceChannel newChannel) {
        //make a defensive copy
        Set<AbstractFramedStreamSourceChannel<C, R, S>> receivers = new HashSet<>(getReceivers());
        for(AbstractFramedStreamSourceChannel<C, R, S> r : receivers) {
            if(r != newChannel) {
                r.markStreamBroken();
            }
        }
    }
1080399
def get_frames(self):
        """"""
        frames = super(CalibratedPair, self).get_frames()
        return self.calibration.rectify(frames)
681802
private void updateFrameBuffer() {

		LOG.trace("Next frame");

		if (t1 == -1 || t2 == -1) {
			t1 = System.currentTimeMillis();
			t2 = System.currentTimeMillis();
		}

		int result = new NextFrameTask(this).nextFrame();

		t1 = t2;
		t2 = System.currentTimeMillis();

		fps = (4 * fps + 1000 / (t2 - t1 + 1)) / 5;

		if (result == -1) {
			LOG.error("Timeout when requesting image!");
		} else if (result < -1) {
			LOG.error("Error requesting new frame!");
		}
	}
193472
def get_frame_src(f:Frame) -> str:
    ''' 
    '''
    path, line, src, fn = _get_frame(
        inspect.getframeinfo(f)
    )
    return '{}:{} -> {}\n{}'.format(
        path.split(os.sep)[-1],
        line,
        fn,
        repr(src[0][:-1]) # shave off \n
    )
952789
def data_received(self, framed_message):
        ''''''
        if self.verbosity >= 4:
            self.logger.debug(f'Received framed message {framed_message}')
        self.recv_size += len(framed_message)
        self.bump_cost(len(framed_message) * self.bw_cost_per_byte)
        self.framer.received_bytes(framed_message)
97255
def get_sample_frame(self):
        """"""
        for frame in self.frames:
            return frame.open()

        for res in self.results.values():
            return res.open()

        return None
681816
async def handle_frame(self, frame):
        """"""
        if isinstance(frame, FrameGetAllNodesInformationConfirmation):
            self.number_of_nodes = frame.number_of_nodes
            # We are still waiting for FrameGetAllNodesInformationNotification
            return False
        if isinstance(frame, FrameGetAllNodesInformationNotification):
            self.notification_frames.append(frame)
        if isinstance(frame, FrameGetAllNodesInformationFinishedNotification):
            if self.number_of_nodes != len(self.notification_frames):
                PYVLXLOG.warning("Number of received scenes does not match expected number")
            self.success = True
            return True
        return False
726635
def _render_frame(self):
        
        frame = self.frame()
        output = '\r{0}'.format(frame)
        self.clear()
        try:
            self._stream.write(output)
        except UnicodeEncodeError:
            self._stream.write(encode_utf_8_text(output))
990644
def process_raw_frame(self,
                          id=None,
                          msg=None):
        

        # normalize into a dataframe
        df = json_normalize(msg)
        # convert to a flattened dictionary
        dt = json.loads(df.to_json())

        flat_msg = {}

        for k in dt:
            new_key = "raw_{}".format(k)
            flat_msg[new_key] = dt[k]["0"]
            if new_key not in self.raw_keys:
                self.raw_keys[new_key] = k
        # end of capturing all unique keys

        dt["raw_id"] = id
        self.all_raw.append(dt)

        log.debug("RAW data updated:")
        log.debug(self.raw_keys)
        log.debug(self.all_raw)
        log.debug("")

        return flat_msg
250008
def receive_frame(frame)
      validate_received_frame(frame)
      consume_recv_window(frame)

      case frame
      when Frame::Data then         receive_data(frame)
      when Frame::Headers then      receive_headers(frame)
      when Frame::Priority then     receive_priority(frame)
      when Frame::RstStream then    receive_rst_stream(frame)
      when Frame::WindowUpdate then receive_window_update(frame)
      when Frame::Continuation then receive_continuation(frame)
      when Frame::PushPromise then  receive_push_promise(frame)
      when Frame::Ping, Frame::Goaway, Frame::Settings
        raise RemoteConnectionError.new(:protocol_error) # stream_id MUST be 0x00
      else
        # MUST ignore unknown frame
      end
    rescue RemoteStreamError => e
      callback(:stream_error, e)
      send_immediately Frame::RstStream.new(id, e.http2_error_type)
      close
    end