def range2list(str):
    """Converts a GSB range to a list of intervals
    1-3,5-6,9,11 -> [[1,3], [5,6], [9,9], [11,11]]
    """
    r = []
    parts = str.split(',')
    for part in parts:
        minmax = part.split('-', 2)
        if len(minmax) == 1:
            val = int(part[0])
            r.append((val, val))
        else:
            r.append((int(minmax[0]), int(minmax[1])))

    return r