parse a string into a list of numbers of a type
509464
def parse_numtuple(s,intype,length=2,scale=1):
    ''''''
    if intype == int:
        numrx = intrx_s;
    elif intype == float:
        numrx = fltrx_s;
    else:
        raise NotImplementedError("Not implemented for type: {}".format(
            intype));
    if parse_utuple(s, numrx, length=length) is None:
        raise ValueError("{} is not a valid number tuple.".format(s));
    return [x*scale for x in evalt(s)];
213562
def tokenize_by_number(s):
    

    r = find_number(s)

    if r == None:
        return [ s ]
    else:
        tokens = []
        if r[0] > 0:
            tokens.append(s[0:r[0]])
        tokens.append( float(s[r[0]:r[1]]) )
        if r[1] < len(s):
            tokens.extend(tokenize_by_number(s[r[1]:]))
        return tokens
    assert False
25327
def from_text(text):
    """"""

    value = _by_text.get(text.upper())
    if value is None:
        match = _unknown_type_pattern.match(text)
        if match == None:
            raise UnknownRdatatype
        value = int(match.group(1))
        if value < 0 or value > 65535:
            raise ValueError("type must be between >= 0 and <= 65535")
    return value
634838
def _naturalize(string):
    """"""
    splits = re.split("([0-9]+)", string)
    return [int(text) if text.isdigit() else text.lower() for text in splits]
612152
def strings_to_integers(strings: Iterable[str]) -> Iterable[int]:
    
    return strings_to_(strings, lambda x: int(float(x)))
313611
def get_number(s, cast=int):
    
    import string
    d = "".join(x for x in str(s) if x in string.digits)
    return cast(d)
976371
def column_list(string):
    """"""
    try:
        columns = list(map(int, string.split(',')))
    except ValueError as e:
        raise argparse.ArgumentTypeError(*e.args)
    for column in columns:
        if column < 1:
            raise argparse.ArgumentTypeError(
                'Invalid column {!r}: column numbers start at 1.'
                .format(column))
    return columns
580932
def parse_int_string(int_string: str) -> List[int]:
    
    cleaned = " ".join(int_string.strip().split())
    cleaned = cleaned.replace(" - ", "-")
    cleaned = cleaned.replace(",", " ")

    tokens = cleaned.split(" ")
    indices: Set[int] = set()
    for token in tokens:
        if "-" in token:
            endpoints = token.split("-")
            if len(endpoints) != 2:
                LOG.info(f"Dropping '{token}' as invalid - weird range.")
                continue

            start = int(endpoints[0])
            end = int(endpoints[1]) + 1

            indices = indices.union(indices, set(range(start, end)))

        else:
            try:
                indices.add(int(token))
            except ValueError:
                LOG.info(f"Dropping '{token}' as invalid - not an int.")

    return list(indices)
421376
def comma_list(cls, string):
        ''''''
        items = string.split(',')
        items = list([item.strip() for item in items])
        return items
789425
def _parse(root):
    """"""
    if root.tag == "nil-classes":
        return []
    elif root.get("type") == "array":
        return [_parse(child) for child in root]

    d = {}
    for child in root:
        type = child.get("type") or "string"

        if child.get("nil"):
            value = None
        elif type == "boolean":
            value = True if child.text.lower() == "true" else False
        elif type == "dateTime":
            value = iso8601.parse_date(child.text)
        elif type == "decimal":
            value = decimal.Decimal(child.text)
        elif type == "integer":
            value = int(child.text)
        else:
            value = child.text

        d[child.tag] = value
    return d
681696
def from_string(cls, string):
        
        cls.TYPE.setParseAction(cls.make)
        try:
            return cls.TYPE.parseString(string, parseAll=True)[0]
        except ParseException:
            log.error("Failed to parse '{0}'".format(string))
            raise
841719
function parse(number) {
    const pattern = /([0-9]+)\.([0-9]*[1-9])(e[+-][1-9][0-9]*)?/;
    const matches = number.toString().match(pattern);
    var coefficient = matches[1];
    const decimal = matches[2];
    const exponent = matches[3] ? Number(matches[3].slice(1)) : 0;
    if (coefficient === '0') coefficient = '';  // leading zero does not count
    return {
        coefficient: coefficient,
        decimal: decimal,
        exponent: exponent
    };
}
246666
def convert_string_to_number(value):
    
    if value is None:
        return 1
    if isinstance(value, int):
        return value
    if value.isdigit():
        return int(value)
    num_list = map(lambda s: NUMBERS[s], re.findall(numbers + '+', value.lower()))
    return sum(num_list)
1223240
function fromString(string) {
    var parsed = string.match(matrixRegex);
    if (parsed === null || parsed.length < 7) throw new Error('\'' + string + '\' is not a matrix');
    return {
        a: parseFloat(parsed[1]),
        b: parseFloat(parsed[2]),
        c: parseFloat(parsed[3]),
        d: parseFloat(parsed[4]),
        e: parseFloat(parsed[5]),
        f: parseFloat(parsed[6])
    };
}
1109
def read_str(delim=',', *lines):
    """"""

    data = []
    for line in lines:
        com = parse_line(line, delim)
        data.append(com)
    return data
219348
def string_to_list(string, sep=",", filter_empty=False):
    """"""
    return [value.strip() for value in string.split(sep)
            if (not filter_empty or value)]
632944
function parseNumberArray( value ) {

		var array = value.split( ',' ).map( function ( val ) {

			return parseFloat( val );

		} );

		return array;

	}