Filter for service
    Filter on group

    :param group: group to filter
    :type group: str
    :return: Filter
    :rtype: bool
188298
def filter_service_by_servicegroup_name(group):
    

    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
483659
public static servicegroup_servicegroupentitymonbindings_binding[] get_filtered(nitro_service service, String servicegroupname, String filter) throws Exception{
		servicegroup_servicegroupentitymonbindings_binding obj = new servicegroup_servicegroupentitymonbindings_binding();
		obj.set_servicegroupname(servicegroupname);
		options option = new options();
		option.set_filter(filter);
		servicegroup_servicegroupentitymonbindings_binding[] response = (servicegroup_servicegroupentitymonbindings_binding[]) obj.getfiltered(service, option);
		return response;
	}
264243
def filter(self, callback=None):
        
        if callback:
            return self.__class__(list(filter(callback, self.items)))

        return self.__class__(list(filter(None, self.items)))
813919
public function getServiceInstanceByGroup($group)
    {
        $services = [];
        $services_map = static::services();

        foreach ($this->getServiceInstances() as $name => $info) {
            if (!isset($info['type']) || !isset($info['instance'])) {
                continue;
            }
            $type = $info['type'];

            if (!isset($services_map[$type])) {
                continue;
            }
            $classname = $services_map[$type];

            if ($group !== $classname::group()) {
                continue;
            }
            $services[$name] = $info['instance'];
        }

        return $services;
    }
303719
def get_group(self, name, default=NoGroupError):
        '''
        
        '''

        if name in self.groups:
            return self.groups[name]

        if default is NoGroupError:
            raise NoGroupError('No such group: {0}'.format(name))

        return default
387317
def remove_group(self, group = None):
        

        if group is None:
            raise KPError("Need group to remove a group")
        elif type(group) is not v1Group:
            raise KPError("group must be v1Group")

        children = []
        entries = []
        if group in self.groups:
            # Save all children and entries to
            # delete them later
            children.extend(group.children)
            entries.extend(group.entries)
            # Finally remove group
            group.parent.children.remove(group)
            self.groups.remove(group)
        else:
            raise KPError("Given group doesn't exist")
        self._num_groups -= 1
        
        for i in children:
            self.remove_group(i)
        for i in entries:
            self.remove_entry(i)     
        return True
114100
def tm_group(self):
        '''
        '''
        if self._tm_group is None:
            self._tm_group = self.tm_user
        return self._tm_group
797114
def has_group(user, group_name):
    '''
    
    '''
    if user.groups.filter(name=group_name).exists():
        return True
    return False
1365630
def filtered(self, efilter):
        '''
        
        '''
        if not self.params:
            self.params={'filter' : efilter}
            return self
        if not self.params.has_key('filter'):
            self.params['filter'] = efilter
            return self
        self.params['filter'].update(efilter)
        return self
638146
function(filter){
        var filterKeys = Object.keys(filter), removeData = [], groupData = [], _this = this;
        if(filterKeys.length == 0){
            //clear all
            this._dataCache.length = 0;
        }else if(filterKeys.length == 1 && filterKeys[0] == 'group'){
            //remove group
            removeData = this._groupFilter(filter);
            removeData.forEach(function(item){
                var index = _this._dataCache.indexOf(item);
                _this._dataCache.splice(index, 1);
            });
        }else{
            if(filter.group == undefined){
                filter.group = 'root';
            }
            if(filter.ip !== undefined){
                filter.type = 'ip'
            }else if(filter.text !== undefined){
                filter.type = 'text'
            }
            removeData =  this._filter(filter);
            if(filter.group != 'root'){
                groupData = this._groupFilter(filter);
            }else{
                groupData.push({value : this._dataCache});
            }
            groupData.forEach(function(group){
                removeData.forEach(function(item){
                    var index = group.value.indexOf(item);
                    if(index != -1){
                        group.value.splice(index, 1);
                    }
                });
            });
        }

        return this;
    }
1322451
def get_groups(self, filterTerm=None, groupName=None, groupDomain=None):
        
        if groupDomain:
            groupDomain = groupDomain.split('.')[0].upper()

        cur = self.conn.cursor()

        if self.is_group_valid(filterTerm):
            cur.execute("SELECT * FROM groups WHERE id=? LIMIT 1", [filterTerm])

        elif groupName and groupDomain:
            cur.execute("SELECT * FROM groups WHERE LOWER(name)=LOWER(?) AND LOWER(domain)=LOWER(?)", [groupName, groupDomain])

        elif filterTerm and filterTerm !="":
            cur.execute("SELECT * FROM groups WHERE LOWER(name) LIKE LOWER(?)", ['%{}%'.format(filterTerm)])

        else:
            cur.execute("SELECT * FROM groups")

        results = cur.fetchall()
        cur.close()
        logging.debug('get_groups(filterTerm={}, groupName={}, groupDomain={}) => {}'.format(filterTerm, groupName, groupDomain, results))
        return results
478042
def filtre(liste_base, criteres) -> groups.Collection:
        

        def choisi(ac):
            for cat, li in criteres.items():
                v = ac[cat]
                if not (v in li):
                    return False
            return True

        return groups.Collection(a for a in liste_base if choisi(a))
825069
def filter_group_names(groups, patterns):
    
    group_names = [g['logGroupName'] for g in groups]
    matched = set()
    for p in patterns:
        matched.update(fnmatch.filter(group_names, p))
    return [g for g in groups if g['logGroupName'] in matched]
441281
def contains_group(store, path=None):
    """"""
    path = normalize_storage_path(path)
    prefix = _path_to_prefix(path)
    key = prefix + group_meta_key
    return key in store
262028
def delete_group(self, group_id, force=False):
        
        params = {'force': force}
        response = self._do_request(
            'DELETE', '/v2/groups/{group_id}'.format(group_id=group_id), params=params)
        return response.json()
710907
def get_group(self, group_name):
        
        response = self.client.get_group(GroupName=group_name,
                                         UserPoolId=self.user_pool_id)
        return self.get_group_obj(response.get('Group'))
735237
def filter(self, table, group_types, filter_string):
        """"""
        query = filter_string.lower()
        return [group_type for group_type in group_types
                if query in group_type.name.lower()]