def build_range_qsets(range_):
    try:
        start, end = range_.split(',')
    except ValueError:
        raise BadDirective("Specify a range using the format: start,end")
    start_ip_type, _ = resolve_ip_type(start)
    end_ip_type, _ = resolve_ip_type(end)
    if start_ip_type != end_ip_type or not start_ip_type or not end_ip_type:
        raise BadDirective("Couldn not resolve IP type of {0} and "
                           "{1}".format(start, end))
    try:
        istart, iend, ipf_q = start_end_filter(start, end, start_ip_type)
    except (__HOLE__, ipaddr.AddressValueError), e:
        raise BadDirective(str(e))
    return build_ipf_qsets(ipf_q)
dataset/ETHPy150Open rtucker-mozilla/mozilla_inventory/core/search/compiler/invfilter.py/build_range_qsets