def mergeinfo_ranges_to_set(mergeinfo_ranges):
    """Convert compact ranges representation to python set object"""
    result = set()
    for r in mergeinfo_ranges:
        if type(r) == int:
            result.add(r)
        else:
            result |= set(range(r[0], r[1]+1))
    return result