def ranges_to_list(ranges_string):
    values = []
    for rg in ranges_string.split(','):
        if '-' in rg:
            first, last = map(int, rg.split('-'))
            values.extend(xrange(first, last + 1))
        else:
            values.append(int(rg))
    return values
Converts a sysfs-style ranges string, e.g. ``"0,2-4"``, into a list ,e.g ``[0,2,3,4]``
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/utils/misc.py/ranges_to_list