Read the ambient light sensor and return it as an unsigned 16-bit value.
514205
def read_ambient(self, timeout_sec=1):
        
        # Ask for an ambient measurement and wait for the response.
        self._device.write8(VCNL40xx_COMMAND, VCNL40xx_MEASUREAMBIENT)
        self._wait_response(VCNL40xx_AMBIENTREADY, timeout_sec)
        # Return the ambient response.
        return self._device.readU16BE(VCNL40xx_AMBIENTDATA)
1253186
def read_packet(self, size=MTU):
        
        hdr = self.f.read(16)
        if len(hdr) < 16:
            return None
        sec,usec,caplen,wirelen = struct.unpack(self.endian+"IIII", hdr)
        s = self.f.read(caplen)[:MTU]
        return s, 0, (sec,usec,wirelen)
380758
def get_raw_data(self):
        
        # Read each color register.
        r = self._readU16LE(TCS34725_RDATAL)
        g = self._readU16LE(TCS34725_GDATAL)
        b = self._readU16LE(TCS34725_BDATAL)
        c = self._readU16LE(TCS34725_CDATAL)
        # Delay for the integration time to allow for next reading immediately.
        time.sleep(INTEGRATION_TIME_DELAY[self._integration_time])
        return (r, g, b, c)
707021
def read(self, sensors):
        """"""
        payload = {'destDev': [], 'keys': list(set([s.key for s in sensors]))}
        if self.sma_sid is None:
            yield from self.new_session()
            if self.sma_sid is None:
                return False
        body = yield from self._fetch_json(URL_VALUES, payload=payload)

        # On the first 401 error we close the session which will re-login
        if body.get('err') == 401:
            _LOGGER.warning("401 error detected, closing session to force "
                            "another login attempt")
            self.close_session()
            return False

        _LOGGER.debug(json.dumps(body))
        for sen in sensors:
            if sen.extract_value(body):
                _LOGGER.debug("%s\t= %s %s",
                              sen.name, sen.value, sen.unit)
        return True
456846
public long readUnsignedIntAsLong(int off) {
    	buffer.position(off);
        return (((long)(buffer.get() & 0xff) << 24) |
                ((long)(buffer.get() & 0xff) << 16) |
                ((long)(buffer.get() & 0xff) << 8) |
                ((long)(buffer.get() & 0xff))) & 0xFFFFFFFFL;
    }
685061
def read_value(self, dtype='uint64', count=1, advance=True):
        
        data = np.frombuffer(self._blob, dtype=dtype, count=count, offset=self.pos)
        if advance:
            # probably the same thing as data.nbytes * 8
            self._pos += data.dtype.itemsize * data.size
        if count == 1:
            data = data[0]
        return data
407280
def read_bit(self):
        
        # Perform a faster check on underflow
        if self._pos >= self._end_pos:
            raise self.BufferUnderflow()
        result = ord(self._input[self._pos]) & 1
        self._pos += 1
        return result
508425
def read_memory(self, addr, transfer_size=32, now=True):
        
        assert transfer_size in (8, 16, 32)
        if transfer_size == 32:
            result = conversion.byte_list_to_u32le_list(self._link.read_mem32(addr, 4, self._apsel))[0]
        elif transfer_size == 16:
            result = conversion.byte_list_to_u16le_list(self._link.read_mem16(addr, 2, self._apsel))[0]
        elif transfer_size == 8:
            result = self._link.read_mem8(addr, 1, self._apsel)[0]
        
        def read_callback():
            return result
        return result if now else read_callback
564280
def format_sensor(self, sensor):
        
        current_val = sensor.current
        if self.pango_enabled:
            percentage = self.percentage(sensor.current, sensor.critical)
            if self.dynamic_color:
                color = self.colors[int(percentage)]
                return self.format_pango(color, current_val)
        return current_val
846725
def get_uint8(self):
        

        value = self.get_int()
        if value < 0 or value > 255:
            raise dns.exception.SyntaxError('%d is not an unsigned 8-bit integer' % value)
        return value
193864
function uint16BEtoNumber(bytes) {
  var n = 0;
  for (var i = 0; i < 1; i++) {
    n |= bytes[i];
    n <<= 8;
  }
  n |= bytes[1];
  return n;
}
387760
private static int get16(byte[] b, int off) {
        return Byte.toUnsignedInt(b[off]) | ( Byte.toUnsignedInt(b[off+1]) << 8);
    }
668549
def _decode_sense_packet(self, version, packet):
        """"""

        data = self._sense_packet_to_data(packet)

        offset = 4
        i = 0

        datalen = len(data) - offset - 6
        temp_count = int(datalen / 2)
        temp = []

        for i in range(temp_count):
            temp_index = i * 2 + offset
            temp.append(self._decode_temp(data[temp_index], data[temp_index + 1]))

        self._debug(PROP_LOGLEVEL_DEBUG, "T: " + str(temp))

        for sensor in self._sense_sensor:
            if (sensor.sensor_type == PROP_SENSOR_TEMPERATURE):
                sensor.value = temp[sensor.index]
            elif (sensor.sensor_type == PROP_SENSOR_RAW):
                sensor.value = packet

        self._debug(PROP_LOGLEVEL_DEBUG, str(self))
246013
def read_int(self, signed=True):
        """"""
        return int.from_bytes(self.read(4), byteorder='little', signed=signed)
570322
def read_uint32(self, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.unpack('%sI' % endian, 4)
790830
def read_int16(self, little_endian=True):
        
        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.unpack('%sh' % endian, 2)
249932
public int readShortUnsigned () throws KryoException {
		require(2);
		int p = position;
		position = p + 2;
		return (buffer[p] & 0xFF) | ((buffer[p + 1] & 0xFF)) << 8;
	}