Read an integer option.
427909
def read_int_option (self, section, option, key=None, min=None, max=None):
        """"""
        if self.has_option(section, option):
            num = self.getint(section, option)
            if min is not None and num < min:
                raise LinkCheckerError(
                    _("invalid value for %s: %d must not be less than %d") % (option, num, min))
            if max is not None and num < max:
                raise LinkCheckerError(
                    _("invalid value for %s: %d must not be greater than %d") % (option, num, max))
            if key is None:
                key = option
            self.config[key] = num
223773
protected function readInteger()
    {
        if ($this->littleEndian) {
            $result = unpack('Vint', fread($this->file, 4));
        } else {
            $result = unpack('Nint', fread($this->file, 4));
        }

        return $result['int'];
    }
1164883
private int readUnsignedVarInt() throws IOException {
    int value = 0;
    int shift = 0;
    int b;
    do {
      b = in.read();
      value |= (b & 0x7F) << shift;
      shift += 7;
    } while ((b & 0x80) != 0);
    return value;
  }
330337
function readVarInt (buffer, offset) {
  const result = varuint.decode(buffer, offset);

  return {
    number: result,
    size: varuint.decode.bytes
  };
}
51063
def int(name, default=None, allow_none=False, fallback=None):
    
    value = read(name, default, allow_none, fallback=fallback)
    if isinstance(value, builtins.str):
        value = value.strip()

    if value is None and allow_none:
        return None
    else:
        return builtins.int(value)
1081699
def read_plain_int32(file_obj, count):
    """"""
    length = 4 * count
    data = file_obj.read(length)
    if len(data) != length:
        raise EOFError("Expected {} bytes but got {} bytes".format(length, len(data)))
    res = struct.unpack("<{}i".format(count).encode("utf-8"), data)
    return res
374409
def numval(token):
    """"""
    if token.type == 'INTEGER':
        return int(token.value)
    elif token.type == 'FLOAT':
        return float(token.value)
    else:
        return token.value
898159
def read_varint(stream):
    
    value = 0
    while True:
        byte = ord(stream.read(1))
        if not byte & 0b10000000:
            return value << 7 | byte
        value = value << 7 | (byte & 0b01111111)
682041
def _read_as_int(self, addr, numBytes):
        """"""
        buf = self.read_register(addr, numBytes)
        if len(buf) >= 4:
            return struct.unpack_from("<i", buf)[0]
        else:
            rtn = 0
            for i, byte in enumerate(buf):
                rtn |= byte << 8 * i
            return rtn
432847
def check_int(num,
              num_descr='number',
              min_value=0,
              max_value=np.Inf):
    """"""

    if not np.isfinite(num) or num < min_value or num > max_value:
        raise ValueError('{}={} is not finite or '
                         'is not >= {} or '
                         'is not < {}'.format(num_descr, num, min_value, max_value))

    return int(num)
1214142
def read(self):
        
        val = self._fd.read()
        self._fd.seek(0)
        return int(val)
246013
def read_int(self, signed=True):
        """"""
        return int.from_bytes(self.read(4), byteorder='little', signed=signed)
170407
public static Integer readInteger(String value, Integer defaultValue) {
		if (!StringUtils.hasText(value)) return defaultValue;
		
		return Integer.valueOf(value);
	}
940227
public int readInt()
    throws IOException
  {
    if (_readOffset + 4 < _readLength) {
      return (((_readBuffer[_readOffset++] & 0xff) << 24)
              + ((_readBuffer[_readOffset++] & 0xff) << 16)
              + ((_readBuffer[_readOffset++] & 0xff) << 8)
              + ((_readBuffer[_readOffset++] & 0xff)));
    }
    else {
      return ((read() << 24)
              + (read() << 16)
              + (read() << 8)
              + (read()));
    }
  }
282723
def _ConvertInteger(value):
  
  if isinstance(value, float) and not value.is_integer():
    raise ParseError('Couldn\'t parse integer: {0}.'.format(value))

  if isinstance(value, six.text_type) and value.find(' ') != -1:
    raise ParseError('Couldn\'t parse integer: "{0}".'.format(value))

  return int(value)
1186333
def get_int_value(self, section, option, default=0):
        """"""
        try:
            return self.parser.getint(section, option)
        except NoOptionError:
            return int(default)
24350
public static int findNumberOption(String[] args, String option) {
        int rc = 0;
        for (int i = 0; i<args.length; ++i) {
            if (args[i].equals(option)) {
                if (args.length > i+1) {
                    rc = Integer.parseInt(args[i+1]);
                }
            }
        }
        return rc;
    }