def is_in_groups(user, group_names):
    """
    Returns True if the user is a member of any groups given their names in group_names
    """
    return any(user.groups.filter(name=group_name).exists() for group_name in group_names)