def ranges_to_list(ranges_string):
    """Converts a sysfs-style ranges string, e.g. ``"0,2-4"``, into a list ,e.g ``[0,2,3,4]``"""
    values = []
    for rg in ranges_string.split(','):
        if '-' in rg:
            first, last = list(map(int, rg.split('-')))
            values.extend(range(first, last + 1))
        else:
            values.append(int(rg))
    return values
