

def parse_range(astr):
    result = set()
    for part in astr.split(','):
        x = part.split('-')
        result.update(range(int(x[0]), (int(x[(- 1)]) + 1)))
    return sorted(result)

dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/documents/utils.py parse_range/original