Extracts all integers from a string an return them in a list
164576
def get_numbers(s):
    """"""

    result = map(int, re.findall(r'[0-9]+', unicode(s)))
    return result + [1] * (2 - len(result))
151412
def find_all(self, string, callback):
		
		for index, output in self.iter(string):
			callback(index, output)
876605
def toList(variable, types=(basestring, int, float, )):
    
    if isinstance(variable, types):
        return [variable]
    else:
        return variable
414747
def _split_str(s, n):
    
    length = len(s)
    return [s[i:i + n] for i in range(0, length, n)]
873256
def validate_stringlist(s):
    """"""
    if isinstance(s, six.string_types):
        return [six.text_type(v.strip()) for v in s.split(',') if v.strip()]
    else:
        try:
            return list(map(validate_str, s))
        except TypeError as e:
            raise ValueError(e.message)
795691
def scan(self, string):
        
        return list(self._scanner_to_matches(self.pattern.scanner(string), self.run))
1134754
private List<Integer> extractRgroups(String data){
	  Pattern pattern = Pattern.compile("R[1-9]\\d*");
	  Matcher matcher = pattern.matcher(data);
	  List<Integer> listValues = new ArrayList<Integer>();
	  
	  while(matcher.find()){
		listValues.add(Integer.parseInt(matcher.group().split("R")[1]));  
	  }
	  return listValues;
  }
1102241
def findall(self, string):
        
        output = []
        for match in self.pattern.findall(string):
            if hasattr(match, 'strip'):
                match = [match]
            self._list_add(output, self.run(match))
        return output
429748
def _str_to_int(self, string):
        
        string = string.lower()
        if string.endswith("l"):
            string = string[:-1]
        if string.lower().startswith("0x"):
            # should always match
            match = re.match(r'0[xX]([a-fA-F0-9]+)', string)
            return int(match.group(1), 0x10)
        else:
            return int(string)
397548
def to_int_list(values):
    """"""
    results = []
    for v in values:
        try:
            results.append(int(v))
        except (TypeError, ValueError):
            results.append(0)
    return results
1362924
def from_string(cls, source):
        
        items = cls.RE_TIME_SEP.split(source)
        if len(items) != 4:
            raise InvalidTimeString
        return cls(*(cls.parse_int(i) for i in items))
130258
def _string_to_int(self, string):
        
        number = 0
        for char in string[::-1]:
            number = number * self._alpha_len + self._alphabet.index(char)
        return number
477788
def extract_lookups(value):
    
    lookups = set()
    if isinstance(value, basestring):
        lookups = lookups.union(extract_lookups_from_string(value))
    elif isinstance(value, list):
        for v in value:
            lookups = lookups.union(extract_lookups(v))
    elif isinstance(value, dict):
        for v in value.values():
            lookups = lookups.union(extract_lookups(v))
    return lookups
612152
def strings_to_integers(strings: Iterable[str]) -> Iterable[int]:
    
    return strings_to_(strings, lambda x: int(float(x)))
1242150
def findall(self, string, *args, **kwargs):
        """"""

        return self._pattern.findall(string, *args, **kwargs)
269801
def from_string(cls, prjs):
        
        def parse(v):
            try:
                return int(v)
            except ValueError:
                pass
            try:
                return float(v)
            except ValueError:
                return v

        parts = [o.lstrip('+') for o in prjs.strip().split()]

        items = map(
            lambda kv: len(kv) == 2 and (kv[0], parse(kv[1])) or (kv[0], True),
            (p.split('=') for p in parts))

        return cls({k: v for k, v in items if '+'+k in PROJ4_PARAMS.keys()})
842158
def _int_from_str(string):
    
    float_num = float(string)
    int_num = int(float_num)
    if float_num == int_num:
        return int_num
    else:
        # Needed to handle pseudos with fractional charge
        int_num = np.rint(float_num)
        logger.warning("Converting float %s to int %s" % (float_num, int_num))
        return int_num