Convert keyword values to int.
350550
def _set_intvals(kws, keys):
        """"""
        for key in keys:
            if key in kws:
                kws[key] = int(kws[key])
952971
def int_filter(text):
    
    res = list()
    for char in text:
        if char.isdigit():
            res.append(char)
    return int("".join(res))
191848
def to_int(x, index=False):
    
    _x = x.index if index else x
    cols = list(map(int, _x))
    error = _x[cols != _x]
    if not error.empty:
        raise ValueError('invalid values `{}`'.format(list(error)))
    if index:
        x.index = cols
        return x
    else:
        return _x
966404
def lookup_int(values, name=None):
    
    field = basic.lookup(values, name)

    field.addParseAction(lambda l: int(l[0]))

    return field
404217
def _convert_entry(self, entry):
        """"""
        result = {}
        for key, value in entry.items():
            if isinstance(value, list):
                result[key] = [self._convert_field(key, val) for val in value]
            else:
                result[key] = self._convert_field(key, value)
        return result
273345
def count_values(tokens):
    """"""
    ntoks = 0
    for tok in tokens:
        if tok in ('=', '/', '$', '&'):
            if ntoks > 0 and tok == '=':
                ntoks -= 1
            break
        elif tok in whitespace + ',':
            continue
        else:
            ntoks += 1

    return ntoks
630924
def int_or_str(v: Optional[str]) -> Union[None, int, str]:
    """"""
    if v is None:
        return
    try:
        return int(v)
    except ValueError:
        return v
551007
def filter_int(string, default=None, start=None, stop=None):
    """"""
    try:
        i = int(string)
        if start is not None and i < start:
            raise InvalidInputError("value too small")
        if stop is not None and i >= stop:
            raise InvalidInputError("value too large")
        return i
    except ValueError:
        if not string and default is not None:
            # empty string, default was given
            return default
        else:
            raise InvalidInputError
567241
def to_int(self):
        
        num = self.to_uint()
        if num and self._items[-1].unbox():
            return num - (1 << self.size)
        else:
            return num
501784
def get_int(self, key, default=None):
        
        """
        return self.get_converted(
            key, ConversionTypeEnum.INTEGER, default=default)
116238
def int_0_inf(cls, string):
        '''
        '''
        if string == 'inf':
            return 0

        try:
            value = int(string)
        except ValueError as error:
            raise argparse.ArgumentTypeError(error)

        if value < 0:
            raise argparse.ArgumentTypeError(_('Value must not be negative.'))
        else:
            return value
1327749
def value_is_int(self):
        """"""
        try:
            a = float(self.value)
            b = int(a)
        except ValueError:
            return False
        else:
            return a == b
348996
final int getKeywordToken(String key)
  {

    int tok;

    try
    {
      Integer itok = (Integer) Keywords.getKeyWord(key);

      tok = (null != itok) ? itok.intValue() : 0;
    }
    catch (NullPointerException npe)
    {
      tok = 0;
    }
    catch (ClassCastException cce)
    {
      tok = 0;
    }

    return tok;
  }
1217950
def get_int(self, key, optional=False):
        
        return self._get_typed_value(key, int, lambda x: int(x), optional)
604369
private static Integer toInt(String str) {

        Integer num = null;
        try {
            num = Integer.parseInt(str);
        } catch (NumberFormatException ex) {
            log.severe(String.format("failed to convert str: %s to integer", str));
        }

        return num;
    }
893636
def convert(self, value, param, ctx):
        
        self.gandi = ctx.obj
        value = click.Choice.convert(self, value, param, ctx)
        return int(value)
1130358
def _int_to_key(keys, index):
    ''
    if isinstance(index, int):
        try:
            return keys[index]
        except IndexError:
            # use KeyError rather than IndexError for compatibility
            raise KeyError('Index out of range of keys: %s' % (index,))
    return index