read the pin value

    Returns:
        bool: 0 or 1
420427
def read(pin):
    '''
    '''
    f = _open[pin].value
    out = int(_read(f))
    log.debug("Read {0}: {1}".format(pin, out))
    return out
789982
def get_clear_pin(pinblock, account_number):
    
    raw_pinblock = bytes.fromhex(pinblock.decode('utf-8'))
    raw_acct_num = bytes.fromhex((b'0000' + account_number).decode('utf-8'))
        
    pin_str = xor(raw2B(raw_pinblock), raw2B(raw_acct_num)).decode('utf-8')
    pin_length = int(pin_str[:2], 16)
    
    if pin_length >= 4 and pin_length < 9:
        pin = pin_str[2:2+pin_length]            
        try:
            int(pin)
        except ValueError:
            raise ValueError('PIN contains non-numeric characters')
        return bytes(pin, 'utf-8')
    else:
        raise ValueError('Incorrect PIN length: {}'.format(pin_length))
860913
def read_bit(self):
        """"""
        if not self.bitcount:
            self.bits = ord(self.input.read(1))
            self.bitcount = 8
        result = (self.bits & 1) == 1
        self.bits >>= 1
        self.bitcount -= 1
        return result
106728
def _readint(self, length, start):
        """"""
        ui = self._readuint(length, start)
        if not ui >> (length - 1):
            # Top bit not set, number is positive
            return ui
        # Top bit is set, so number is negative
        tmp = (~(ui - 1)) & ((1 << length) - 1)
        return -tmp
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
1044280
def read_var_uint32(self):
        
        i = self.read_var_uint64()
        if i > wire_format.UINT32_MAX:
            raise errors.DecodeError('Value out of range for uint32: %d' % i)
        return i
516702
def get_device(self, pin=None):
        
        url = self.base_url + '/device'
        try:
            r = requests.get(url, params={'pin': pin}, timeout=10)
            return r.json()
        except RequestException as err:
            raise Client.ClientError(err)
363537
def read(self, n=-1):
        

        buf = b''
        while n < 0 or n is None or n > len(buf):
            data = self.read1(n)
            if len(data) == 0:
                return buf

            buf += data

        return buf
246013
def read_int(self, signed=True):
        """"""
        return int.from_bytes(self.read(4), byteorder='little', signed=signed)
1296426
def set_gpio_pin(self, pin_number, setting, dest_addr_long=None):
        
        assert setting in const.GPIO_SETTINGS.values()
        self._send_and_wait(
            command=const.IO_PIN_COMMANDS[pin_number],
            parameter=setting.value,
            dest_addr_long=dest_addr_long)
854157
public double getAnalogValue(Pin pin) {
    double value = getValue(pin);
    switch (configuration & 0x0C) {
      case 0x00: { // 1mV
        break;
      }
      case 0x04: { // 250.0 uV
        value = value * 0.25;
        break;
      }
      case 0x08: { // 62.5 uV
        value = value * 0.0625;
        break;
      }
      case 0x0C: { // 15.625 uV
        value = value * 0.015625;
        break;
      }
      default: throw new IllegalArgumentException();
    }
    return 0.001 * value;
  }
292213
def read_uint(self):
		
		if self.reader.sysinfo.ProcessorArchitecture == PROCESSOR_ARCHITECTURE.AMD64:
			return int.from_bytes(self.read(8), byteorder = 'little', signed = False)
		else:
			return int.from_bytes(self.read(4), byteorder = 'little', signed = False)
873868
def is_pinned(self, color: Color, square: Square) -> bool:
        
        return self.pin_mask(color, square) != BB_ALL
274025
def _read_offset_value(self, f, offset, size):
        '''
        
        '''
        f.seek(offset, 0)
        if (size == 8):
            return int.from_bytes(f.read(8), 'big', signed=True)
        else:
            return int.from_bytes(f.read(4), 'big', signed=True)
233857
def read_little_endian32(self):
        
        try:
            i = struct.unpack(wire_format.FORMAT_UINT32_LITTLE_ENDIAN,
                              self._input.read(4))
            self._pos += 4
            return i[0]  # unpack() result is a 1-element tuple.
        except struct.error as e:
            raise errors.DecodeError(e)
513024
public function read(int $pin): int
    {
        if (!isset($this->storage[$pin])) {
            return 0;
        }
        return $this->storage[$pin];
    }
1042431
def read(self):
        
        # Read value
        try:
            buf = os.read(self._fd, 2)
        except OSError as e:
            raise GPIOError(e.errno, "Reading GPIO: " + e.strerror)

        # Rewind
        try:
            os.lseek(self._fd, 0, os.SEEK_SET)
        except OSError as e:
            raise GPIOError(e.errno, "Rewinding GPIO: " + e.strerror)

        if buf[0] == b"0"[0]:
            return False
        elif buf[0] == b"1"[0]:
            return True

        raise GPIOError(None, "Unknown GPIO value: \"%s\"" % buf[0])