def filter_service_by_servicegroup_name(group):
    """Filter for service
    Filter on group

    :param group: group to filter
    :type group: str
    :return: Filter
    :rtype: bool
    """

    def inner_filter(items):
        """Inner filter for service. Accept if group in service.servicegroups"""
        service = items["service"]
        if service is None:
            return False
        return group in [items["servicegroups"][g].servicegroup_name for g in service.servicegroups]

    return inner_filter
Filter for service
    Filter on group

    :param group: group to filter
    :type group: str
    :return: Filter
    :rtype: bool