// remItemFromGroups removes an item with itemKey from groups
326446
func (c *Cache) remItemFromGroups(itmKey string, groupIDs []string) {
	for _, grpID := range groupIDs {
		delete(c.groups[grpID], itmKey)
		if len(c.groups[grpID]) == 0 {
			delete(c.groups, grpID)
		}
	}
}
1269237
func (o *Me) PolicyObjectGroups(info *bambou.FetchingInfo) (PolicyObjectGroupsList, *bambou.Error) {

	var list PolicyObjectGroupsList
	err := bambou.CurrentSession().FetchChildren(o, PolicyObjectGroupIdentity, &list, info)
	return list, err
}
1150795
func (r Network_Storage_Backup_Evault) GetPermissionsGroups() (resp []datatypes.Network_Storage_Group, err error) {
	err = r.Session.DoRequest("SoftLayer_Network_Storage_Backup_Evault", "getPermissionsGroups", nil, &r.Options, &resp)
	return
}
51905
func (c *EtcdGroupService) GroupRemoveAll(ctx context.Context, groupName string) error {
	ctxT, cancel := context.WithTimeout(ctx, transactionTimeout)
	defer cancel()
	etcdRes, err := clientInstance.Txn(ctxT).
		If(clientv3.Compare(clientv3.CreateRevision(groupKey(groupName)), ">", 0)).
		Then(clientv3.OpDelete(memberKey(groupName, ""), clientv3.WithPrefix())).
		Commit()

	if err != nil {
		return err
	}
	if !etcdRes.Succeeded {
		return constants.ErrGroupNotFound
	}
	return nil
}
68539
func (c *MemoryGroupService) GroupRemoveMember(ctx context.Context, groupName, uid string) error {
	memoryGroupsMu.Lock()
	defer memoryGroupsMu.Unlock()

	mg, ok := memoryGroups[groupName]
	if !ok {
		return constants.ErrGroupNotFound
	}
	index, contains := elementIndex(mg.Uids, uid)
	if contains {
		mg.Uids[index] = mg.Uids[len(mg.Uids)-1]
		mg.Uids = mg.Uids[:len(mg.Uids)-1]
		memoryGroups[groupName] = mg
		return nil
	}

	return constants.ErrMemberNotFound
}
957935
func (cs *StreamManager) UnlockProtectedGroup(g *Group) {
	cs.UnlockProtectedEntries(g.Entries)
	cs.UnlockProtectedGroups(g.Groups)
}
411679
func GroupFromContext(ctx context.Context) *Group {
	c, _ := ctx.Value(groupKey).(*Group)
	return c
}
588303
func groupFromJSON(in []byte) (*Group, error) {
	b := new(Group)
	if err := json.Unmarshal(in, b); err != nil {
		return nil, err
	}
	return b, nil
}
453067
func NewGroupAddMemberType(Description string) *GroupAddMemberType {
	s := new(GroupAddMemberType)
	s.Description = Description
	return s
}
769136
func (cm AsStandard) MColumnGroupSet(resource, class string) *metadata.MColumnGroupSet {
	mcgs := metadata.MColumnGroupSet{}
	for _, cd := range cm.Elements[metadata.MIColumnGroupSet.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Class"] != class {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mcgs)
		for _, entry := range cd.Entries() {
			tmp := metadata.ColumnGroupSet{}
			entry.SetFields(&tmp)
			mcgs.ColumnGroupSet = append(mcgs.ColumnGroupSet, tmp)
		}
	}
	return &mcgs
}
547031
func (cs *StreamManager) LockProtectedGroups(gs []Group) {
	for i := range gs {
		cs.LockProtectedGroup(&gs[i])
	}
}
100898
func DeserializeProtoValuesFromGroup(group *cb.ConfigGroup, protosStructs ...interface{}) error {
	sv, err := NewStandardValues(protosStructs...)
	if err != nil {
		logger.Panicf("This is a compile time bug only, the proto structures are somehow invalid: %s", err)
	}

	for key, value := range group.Values {
		if _, err := sv.Deserialize(key, value.Value); err != nil {
			return err
		}
	}
	return nil
}
1092178
func (client *Client) DescribeDomainGroups(args *DescribeDomainGroupsArgs) (groups []DomainGroupType, err error) {
	action := "DescribeDomainGroups"
	response := &DescribeDomainGroupsResponse{}
	err = client.Invoke(action, args, response)

	if err != nil {
		log.Printf("%s error, %v", action, err)
		return nil, err
	}

	return response.DomainGroups.DomainGroup, nil
}
190177
func GetEnabledCgroups() (map[int][]string, error) {
	cgroupsFile, err := os.Open("/proc/cgroups")
	if err != nil {
		return nil, err
	}
	defer cgroupsFile.Close()

	cgroups, err := parseCgroups(cgroupsFile)
	if err != nil {
		return nil, errwrap.Wrap(errors.New("error parsing /proc/cgroups"), err)
	}

	return cgroups, nil
}
101260
func (c *EtcdGroupService) GroupContainsMember(ctx context.Context, groupName, uid string) (bool, error) {
	ctxT, cancel := context.WithTimeout(ctx, transactionTimeout)
	defer cancel()
	etcdRes, err := clientInstance.Txn(ctxT).
		If(clientv3.Compare(clientv3.CreateRevision(groupKey(groupName)), ">", 0)).
		Then(clientv3.OpGet(memberKey(groupName, uid), clientv3.WithCountOnly())).
		Commit()

	if err != nil {
		return false, err
	}
	if !etcdRes.Succeeded {
		return false, constants.ErrGroupNotFound
	}
	return etcdRes.Responses[0].GetResponseRange().GetCount() > 0, nil
}
1358617
func asGroupsOrPanic(items []Item) []Group {
	groups := make([]Group, len(items))
	for i, item := range items {
		if grp, ok := item.(Group); ok {
			groups[i] = grp
		} else {
			panic(fmt.Sprintf("item is not a group: %s", reflect.TypeOf(item)))
		}
	}
	return groups
}
220489
func (c *Conn) ObjectGroups(attr, value string, groups []string) ([]string, error) {
	entry, err := c.GetAttributes(attr, value, []string{"memberOf"})
	if err != nil {
		return nil, err
	}
	var objectGroups []string

	for _, objectGroup := range entry.GetAttributeValues("memberOf") {
		for _, parentGroup := range groups {
			if objectGroup == parentGroup {
				objectGroups = append(objectGroups, parentGroup)
				continue
			}
		}
	}

	return objectGroups, nil
}