def parse_ranges(string):
    """Parse ranges of numbers, e.g. '1,3-6'
    """
    s_split = [x.replace('-', ',').replace(':', ',')
               for x in string.split(',')]
    ret = []
    for el in s_split:
        nums = [int(x) for x in el.split(',')]
        if len(nums) < 2:
            nums.append(nums[-1])
        nums[-1] += 1
        ret.extend(list(range(*nums)))
    return ret