def _make_set(value):
    """
    Converts range/set specification to a concrete set of numbers

    '[1-3]'         => {1, 2, 3}
    '{1,2,3}'       => {1, 2, 3}
    '{[1-3]}        => {1, 2, 3}
    '{[1-3],[5-7]}  => {1, 2, 3, 5, 6, 7}
    """
    result = set()
    for vrange in value.strip('{} ').split(','):
        if '[' not in vrange:
            try:
                result.add(int(vrange))
            except ValueError:
                pass
        else:
            try:
                start, end = vrange.strip('[] ').split('-')
                result.update(range(int(start.strip()), int(end.strip()) + 1))
            except ValueError:
                pass
    return result