Gets data for incoming stream
342474
def get_data(self, size=None, addr=None):
        '''
        
        '''
        # readback memory offset
        if addr is None:
            addr = self._mem_bytes

        if size and self._mem_bytes < size:
            raise ValueError('Size is too big')

        if size is None:
            return self._intf.read(self._conf['base_addr'] + self._spi_mem_offset + addr, self._mem_bytes)
        else:
            return self._intf.read(self._conf['base_addr'] + self._spi_mem_offset + addr, size)
1288386
def load(stream):
    """"""
    if isinstance(stream, str):
        string = stream
    else:
        string = stream.read()
    tokens = tokenize(string)
    return parse(tokens)
564574
def parse_stream(response):
    
    stream_data = []
    stream = stdout

    for data in response:
        if data:
            try:
                data = data.decode('utf-8')
            except AttributeError as e:
                logger.exception("Unable to parse stream, Attribute Error Raised: {0}".format(e))
                stream.write(data)
                continue

            try:
                normalized_data = normalize_keys(json.loads(data))
            except ValueError:
                stream.write(data)
                continue
            except TypeError:
                stream.write(data)
                continue

            if 'progress' in normalized_data:
                stream_data.append(normalized_data)
                _display_progress(normalized_data, stream)

            elif 'error' in normalized_data:
                _display_error(normalized_data, stream)

            elif 'status' in normalized_data:
                stream_data.append(normalized_data)
                _display_status(normalized_data, stream)

            elif 'stream' in normalized_data:
                stream_data.append(normalized_data)
                _display_stream(normalized_data, stream)
            else:
                stream.write(data)

    stream.flush()
    return stream_data
519428
def data_from_stream(self, stream):
        
        parser = self._make_representation_parser(stream, self.resource_class,
                                                  self._mapping)
        return parser.run()
535637
def reader(stream):
    """"""
    string = stream.read()
    decoder = json.JSONDecoder().raw_decode
    index = START.match(string, 0).end()

    while index < len(string):
        obj, end = decoder(string, index)
        item = Item()
        item.primitive = obj
        yield item
        index = END.match(string, end).end()
1011825
async def _receive(self, stream_id, pp_id, data):
        
        await self._data_channel_receive(stream_id, pp_id, data)
88094
def data_received(self, data):
        """"""
        self.buffer += data.decode()
        self.log.debug('Received %d bytes from AVR: %s', len(self.buffer), self.buffer)
        self._assemble_buffer()
414696
def data_received(self, data):
        """"""
        if self._on_data:
            self._on_data(data)
            return
        self._queued_data.append(data)
1054169
def stream_info(self) -> None:
        """"""
        stream_names = [stream_name for stream_name in dir(self)
                        if 'stream' in stream_name and stream_name != 'stream_info']
        logging.info('Found %s stream candidates: %s', len(stream_names), stream_names)
        for stream_name in stream_names:
            try:
                stream_fn = getattr(self, stream_name)
                logging.info(stream_name)
                batch = next(iter(stream_fn()))
                rows = []
                for key, value in batch.items():
                        try:
                            value_arr = np.array(value)
                            row = [key, value_arr.dtype, value_arr.shape]
                            if value_arr.dtype.kind in 'bui':  # boolean, unsigned, integer
                                row.append('{} - {}'.format(value_arr.min(), value_arr.max()))
                            elif value_arr.dtype.kind is 'f':
                                row.append('{0:.2f} - {1:.2f}'.format(value_arr.min(), value_arr.max()))
                        except ValueError:  # np broadcasting failed (ragged array)
                            value_arr = None
                            row = [key, '{}'.format(type(value[0]).__name__), '({},)'.format(len(list(value)))]

                        if value_arr is None or \
                                (value_arr.ndim > 0 and value_arr.shape[1:] != np.array(value_arr[0]).shape):
                            logging.warning('*** stream source `%s` appears to be ragged (non-rectangular) ***', key)

                        rows.append(row)
                for line in tabulate.tabulate(rows, headers=['name', 'dtype', 'shape', 'range'],
                                              tablefmt='grid').split('\n'):
                    logging.info(line)
            except Exception:
                logging.warning('Exception was raised during checking stream `%s`, '
                                '(stack trace is displayed only with --verbose flag)', stream_name)
                logging.debug(traceback.format_exc())
377122
def get_datastream_data(self, datastream, options):
        

        response_format=None
        if options and 'format' in options and options['format'] is not None:
            response_format = options['format']
            options['format'] = None

        url = '/datastream/' + str(datastream) + '/data'
        response = self.http.downstream(url, response_format)
        return response
674055
public InputStream getData() {
    if (data != null) {
      return new ByteArrayInputStream(data);
    } else if (dataStream != null) {
      return dataStream;
    } else {
      throw new IllegalStateException("Either the byte[] or the stream mustn't be null at this point.");
    }
  }
415643
def load(cls, stream):
        
        data = json.load(stream)['ts']
        return cls(data['time'], data['inc'])
559011
def data_received(self, data):
        """"""
        data = data.decode()
        log.debug('received data: %s', data.strip())
        self.buffer += data
        self.handle_lines()
9828
async def read_data(self, stream_id: int) -> bytes:
        
        frames = [f async for f in self.stream_frames(stream_id)]
        return b''.join(frames)
682236
def get_data(self, ptr, unbuffered=False):
        """"""
        result = _decode(self.get_raw_data(ptr, unbuffered),
                         self._reading_format[self.ws_type])
        return result
1197952
def stream(self):
        """"""

        if not hasattr(self, '_stream'):
            if self.file is not None:
                self._stream = self.file
            elif self.filename is not None:
                self._stream = open(self.filename, 'rb')
            elif self.text is not None:
                self._stream = StringIO(self.text)
            elif self.data is not None:
                self._stream = BytesIO(self.data)
            else:
                raise ValueError('Broken Data, all None.')
        return self._stream
1243123
def stream(self):
        '''
        
        '''
        if not hasattr(self, '_stream'):
            self._stream = zmq.eventloop.zmqstream.ZMQStream(self._socket, io_loop=self.io_loop)
        return self._stream