def _check_site(user, site, sites):
    """Check if *site* for *user* is in *sites*.  Raise a :exc:`ValueError`
    if not."""
    if site not in sites:
        raise ValueError('Site "%s" for user "%s" does not exist.' % (site,
            user))
