def parse_int_list(s):
    result = []
    for item in s.split(','):
        item = item.strip().split('-')
        if len(item) == 1:
            result.append(int(item[0]))
        elif len(item) == 2:
            start, end = item
            result.extend(range(int(start), int(end)+1))
        else:
            raise ValueError("invalid range: '{0}'".format(s))
    return result
Parse a comma-separated list of strings.
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/util.py/parse_int_list