// groupFromOS converts an os/user.(*Group) to local Group
//
// (This does not include Pass, Shell or Gecos)
489308
func groupFromOS(g *user.Group) (Group, error) {
	newGroup := Group{
		Name: g.Name,
	}

	id, err := strconv.Atoi(g.Gid)
	if err != nil {
		return newGroup, err
	}
	newGroup.Gid = id

	return newGroup, nil
}
1172791
func Convert_user_Group_To_v1_Group(in *user.Group, out *v1.Group, s conversion.Scope) error {
	return autoConvert_user_Group_To_v1_Group(in, out, s)
}
1096245
func UserFrom(ctx context.Context) (user.Info, bool) {
	user, ok := ctx.Value(userKey).(user.Info)
	return user, ok
}
36535
func Group(group string) (*apimachinery.GroupMeta, error) {
	groupMeta, found := groupMetaMap[group]
	if !found {
		return nil, fmt.Errorf("group %v has not been registered", group)
	}
	groupMetaCopy := *groupMeta
	return &groupMetaCopy, nil
}
302935
func Groups(name string, groups ...Options) Options {
	return options{
		name:   name,
		groups: groups,
	}
}
1202664
func (r *marathonClient) GroupBy(name string, opts *GetGroupOpts) (*Group, error) {
	path, err := addOptions(fmt.Sprintf("%s/%s", marathonAPIGroups, trimRootPath(name)), opts)
	if err != nil {
		return nil, err
	}
	group := new(Group)
	if err := r.apiGet(path, nil, group); err != nil {
		return nil, err
	}
	return group, nil
}
1089695
func (c *Client) Group(id, action, target int32) (*GroupNode, error) {
	msg := osc.Message{
		Address: groupNewAddress,
		Arguments: osc.Arguments{
			osc.Int(id),
			osc.Int(action),
			osc.Int(target),
		},
	}
	if err := c.oscConn.Send(msg); err != nil {
		return nil, err
	}
	return newGroup(c, id), nil
}
1315411
func (t Term) Group(fieldOrFunctions ...interface{}) Term {
	return constructMethodTerm(t, "Group", p.Term_GROUP, funcWrapArgs(fieldOrFunctions), map[string]interface{}{})
}
660799
func (r *marathonClient) GroupsBy(opts *GetGroupOpts) (*Groups, error) {
	path, err := addOptions(marathonAPIGroups, opts)
	if err != nil {
		return nil, err
	}
	groups := new(Groups)
	if err := r.apiGet(path, "", groups); err != nil {
		return nil, err
	}
	return groups, nil
}
1240126
func (res *GroupsListAPIResponse) Groups() ([]*Group, error) {
	var groups []*Group
	err := json.Unmarshal(res.RawGroups, &groups)
	if err != nil {
		return nil, err
	}
	return groups, nil
}
1353667
func IsGroupMember(gid int) (bool, error) {
	groups, err := os.Getgroups()
	if err != nil {
		return false, trace.ConvertSystemError(err)
	}
	for _, group := range groups {
		if group == gid {
			return true, nil
		}
	}
	return false, nil
}
993818
func (o *L2Domain) Groups(info *bambou.FetchingInfo) (GroupsList, *bambou.Error) {

	var list GroupsList
	err := bambou.CurrentSession().FetchChildren(o, GroupIdentity, &list, info)
	return list, err
}
477441
func (g *Group) Group(prefix string, middleware ...MiddlewareFunc) (sg *Group) {
	m := make([]MiddlewareFunc, 0, len(g.middleware)+len(middleware))
	m = append(m, g.middleware...)
	m = append(m, middleware...)
	sg = g.echo.Group(g.prefix+prefix, m...)
	sg.host = g.host
	return
}
443321
func (p *V2) GetGroups() ([]common.Group, error) {
	p.RLock()
	defer p.RUnlock()
	if len(p.groups) == 0 {
		return nil, common.ErrNotFound
	}
	groups := make([]common.Group, len(p.groups))
	i := 0
	for _, group := range p.groups {
		groups[i] = group
		i++
	}

	return groups, nil
}
209158
func (r *marathonClient) Group(name string) (*Group, error) {
	group := new(Group)
	if err := r.apiGet(fmt.Sprintf("%s/%s", marathonAPIGroups, trimRootPath(name)), nil, group); err != nil {
		return nil, err
	}
	return group, nil
}
935191
func (re *Regexp) GroupNameFromNumber(i int) string {
	if re.capslist == nil {
		if i >= 0 && i < re.capsize {
			return strconv.Itoa(i)
		}

		return ""
	}

	if re.caps != nil {
		var ok bool
		if i, ok = re.caps[i]; !ok {
			return ""
		}
	}

	if i >= 0 && i < len(re.capslist) {
		return re.capslist[i]
	}

	return ""
}
1270143
func (a *authenticator) AddPermissionGroup(group ...*access.PermissionGroup) {
	for _, newPermissionGroup := range group {
		if _, ok := a.groupDb[newPermissionGroup.Name]; ok {
			a.log.Warnf("permission group %s already exists, skipped")
			continue
		}
		a.log.Debugf("added HTTP permission group %s", newPermissionGroup.Name)
		a.groupDb[newPermissionGroup.Name] = newPermissionGroup.Permissions
	}
}