def numeric_ranges(s):
    """
    Parse numeric ranges separated by comma.

    A numeric range can either be a single number, or a range separated by a
    dash.

    Overlaps are ignored since we are storing the result in a set.

    Example: 1,2,10-15,22 -> set([1,2,10,11,12,13,14,15,22])
    """
    numbers = set()
    parts = s.split(',')
    for p in parts:
        if '-' in p:
            left, right = p.split('-')
            numbers.update(range(int(left), int(right) + 1))
        else:
            numbers.add(int(p))
    return numbers
