:rtype: int, int
338196
def selection_range(self):
        
        selected = self.selectionModel().selection()
        """:type: QItemSelection """

        if selected.isEmpty():
            return -1, -1

        min_row = min(rng.top() for rng in selected)
        max_row = max(rng.bottom() for rng in selected)

        return min_row, max_row
133922
def to_int(s):
    
    try:
        return int(s.replace('_', ''))
    except ValueError:
        return int(ast.literal_eval(s))
1371043
def _set_int(self, commands, name):
        
        if name in commands:
            try:
                value = int(commands[name])
                setattr(self, name, value)
            except ValueError:
                pass
377102
def convert_to_int(value):
    
    if not value:
        return None

    # Apart from numbers also accept values that end with px
    if isinstance(value, str):
        value = value.strip(' px')

    try:
        return int(value)
    except (TypeError, ValueError):
        return None
342503
def int(self, *args):
        
        data = self.bytes(*args)
        if data is not None:
            if len(data) == 1:
                return struct.unpack("<B", data)[0]
            if len(data) == 2:
                return struct.unpack("<H", data)[0]
            if len(data) == 4:
                return struct.unpack("<L", data)[0]
            if len(data) == 8:
                return struct.unpack("<Q", data)[0]
            print("can't get int from %s" % hexdump(data))
190656
def _fmt_int(cls, x, **kw):
        
        return str(int(round(cls._to_float(x))))
1340074
def toint(number):
    
    if isinstance(number, float):
        number = round(number, 0)
    return int(number)
628543
def integers(value):
    
    if '.' in value:
        raise ValueError('There are decimal points in %s' % value)
    values = value.replace(',', ' ').split()
    if not values:
        raise ValueError('Not a list of integers: %r' % value)
    try:
        ints = [int(float(v)) for v in values]
    except Exception:
        raise ValueError('Not a list of integers: %r' % value)
    return ints
965890
def to_int(b:Any)->Union[int,List[int]]:
    ""
    if is_listy(b): return [to_int(x) for x in b]
    else:          return int(b)
1143549
def min(self):
        
        return int(self._min) if not np.isinf(self._min) else self._min
281839
def write_int(self, number):
        
        buf = pack(self.byte_order + "i", number)
        self.write(buf)
161562
def cast_int(x):
    
    try:
        x = int(x)
    except ValueError:
        try:
            x = x.strip()
        except AttributeError as e:
            logger_misc.warn("parse_str: AttributeError: String not number or word, {}, {}".format(x, e))
    return x
919835
def _int_values(self, shape):
        
        return (self.state.randint(low=0, high=100, size=shape)
                .astype('int64'))
178593
def fn_int(self, value):
        

        if is_ndarray(value) or isinstance(value, (list, tuple)):
            return self._to_ndarray(value).astype('int')
        else:
            return int(value)
938751
def num_values(self):
        
        self._num_values, value = self.get_attr_int(self._num_values, 'num_values')
        return value
1013689
def get_t(self):
        '''
        
        '''
        if isinstance(self.__t, int) is False:
            raise TypeError("The type of __t must be int.")
        return self.__t
428362
def get_int(self):
        

        token = self.get().unescape()
        if not token.is_identifier():
            raise dns.exception.SyntaxError('expecting an identifier')
        if not token.value.isdigit():
            raise dns.exception.SyntaxError('expecting an integer')
        return int(token.value)