Adds the groups to which this client belongs.

        The 'groupKeys' field of the client holds a list of the
        encodedKeys of the groups to which this client belongs.

        Returns the number of requests done to Mambu.
176891
def setGroups(self, *args, **kwargs):
        

        requests = 0
        groups = []
        try:
            for gk in self['groupKeys']:
                try:
                    g = self.mambugroupclass(entid=gk, *args, **kwargs)
                except AttributeError as ae:
                    from .mambugroup import MambuGroup
                    self.mambugroupclass = MambuGroup
                    g = self.mambugroupclass(entid=gk, *args, **kwargs)
                requests += 1
                groups.append(g)
        except KeyError:
            pass

        self['groups'] = groups

        return requests
1328507
def setup_groups(portal):
    
    logger.info("*** Setup Roles and Groups ***")

    portal_groups = api.get_tool("portal_groups")

    for gdata in GROUPS:
        group_id = gdata["id"]
        # create the group and grant the roles
        if group_id not in portal_groups.listGroupIds():
            logger.info("+++ Adding group {title} ({id})".format(**gdata))
            portal_groups.addGroup(group_id,
                                   title=gdata["title"],
                                   roles=gdata["roles"])
        # grant the roles to the existing group
        else:
            ploneapi.group.grant_roles(
                groupname=gdata["id"],
                roles=gdata["roles"],)
            logger.info("+++ Granted group {title} ({id}) the roles {roles}"
                        .format(**gdata))
87522
def add_user_to_group(iam_client, user, group, quiet = False):
    
    if not quiet:
        printInfo('Adding user to group %s...' % group)
    iam_client.add_user_to_group(GroupName = group, UserName = user)
233149
def next_group_id(self) -> int:
        
        ids: typing.Set[int] = set()
        for group in chain(self._blue_coa.groups, self._red_coa.groups):  # type: ignore

            id_ = group.group_id
            if id_ in ids:
                raise IndexError(group.group_name)
            ids.add(id_)
        return max(ids) + 1
359436
def group_add(self, name, restrict, repos, lces=[], assets=[], queries=[],
                  policies=[], dashboards=[], credentials=[], description=''):
        '''
        '''
        return self.raw_query('group', 'add', data={
            'lces': [{'id': i} for i in lces],
            'assets': [{'id': i} for i in assets],
            'queries': [{'id': i} for i in queries],
            'policies': [{'id': i} for i in policies],
            'dashboardTabs': [{'id': i} for i in dashboards],
            'credentials': [{'id': i} for i in credentials],
            'repositories': [{'id': i} for i in repos],
            'definingAssets': [{'id': i} for i in restrict],
            'name': name,
            'description': description,
            'users': [],
            'context': ''
        })
612513
def group_list(**kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('group:list', **{
        'storage': ctx.repo.create_secure_service('storage'),
    })
404601
def groups(self):
        
        groups = defaultdict(list)
        for setting in self.all():
            groups[setting.group].append(setting)
        return dict(groups)
1277465
private void onPublicKeysGroupAdded(int uid, ApiEncryptionKeyGroup keyGroup) {
        UserKeys userKeys = getCachedUserKeys(uid);
        if (userKeys == null) {
            return;
        }
        UserKeysGroup validatedKeysGroup = validateUserKeysGroup(uid, keyGroup);
        if (validatedKeysGroup != null) {
            UserKeys updatedUserKeys = userKeys.addUserKeyGroup(validatedKeysGroup);
            cacheUserKeys(updatedUserKeys);
            context().getEncryption().getEncryptedChatManager(uid)
                    .send(new EncryptedPeerActor.KeyGroupUpdated(userKeys));
        }
    }
844942
def add_member_to_group(self, group_id, member_id):
        
        route_values = {}
        if group_id is not None:
            route_values['groupId'] = self._serialize.url('group_id', group_id, 'str')
        if member_id is not None:
            route_values['memberId'] = self._serialize.url('member_id', member_id, 'str')
        self._send(http_method='PUT',
                   location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8',
                   version='5.0-preview.1',
                   route_values=route_values)
122433
void collectGroupVertices(final List<ManagementGroupVertex> groupVertices) {

		final Iterator<ManagementGroupVertex> it = this.groupVertices.iterator();

		while (it.hasNext()) {
			groupVertices.add(it.next());
		}
	}
588723
@RequestMapping(value = "group", method = RequestMethod.GET)
    public String newGroupGet(Model model) {
        model.addAttribute("groups",
                pathOverrideService.findAllGroups());
        return "groups";
    }
313081
def groups_count(self):
        
        if self._keyboard_description.contents.ctrls is not None:
            return self._keyboard_description.contents.ctrls.contents.num_groups
        else:
            groups_source = self._groups_source

            groups_count = 0
            while (groups_count < XkbNumKbdGroups and
                   groups_source[groups_count] != None_):
                groups_count += 1

            return groups_count
1372377
def _AddCampaignsToGroup(client, campaign_group_id, campaign_ids):
  
  # Get the CampaignService.
  campaign_service = client.GetService('CampaignService', version='v201809')

  # Create the operations.
  operations = [{
      'operator': 'SET',
      'operand': {
          'id': campaign_id,
          'campaignGroupId': campaign_group_id
      }
  } for campaign_id in campaign_ids]

  campaign_service.mutate(operations)

  # Display the results.
  print ('The following campaign IDs were added to the campaign group with ID '
         '"%d":\n\t%s' % (campaign_group_id, campaign_ids))
603606
def add_to_group(connection, group_id)
      params = to_json_for_add
      url    = "/api/2.0/asset_groups/#{group_id}/tags"
      uri    = AJAX.post(connection, url, params, AJAX::CONTENT_TYPE::JSON)
      @id    = uri.split('/').last.to_i
    end
1187161
def add_group(self, name, devices):
        
        device = self.add_device(name, "group")
        device.add_to_group(devices)
        return device
1081862
def create_group(self, **kwargs):
        
        response = self.__requester.request(
            'POST',
            'groups',
            _kwargs=combine_kwargs(**kwargs)
        )
        return Group(self.__requester, response.json())
126077
def AddGroupMemberships(self):
    """"""
    self.groups = {g.name: self._Members(g) for g in itervalues(self.groups)}
    # Map the groups a user is a member of, irrespective of primary/extra gid.
    for g in itervalues(self.groups):
      for user in g.members:
        membership = self.memberships.setdefault(user, set())
        membership.add(g.gid)
    # Now add the completed membership to the user account.
    for user in itervalues(self.entry):
      user.gids = self.memberships.get(user.username)