def build_site_qsets(site_name):
    try:
        site = Site.objects.get(name=site_name)
    except __HOLE__:
        raise BadDirective("{0} isn't a valid "
                           "site.".format(site_name))
    return build_ipf_qsets(site.compile_Q())
dataset/ETHPy150Open rtucker-mozilla/mozilla_inventory/core/search/compiler/invfilter.py/build_site_qsets