Returns a ``list`` with the group's members or ``None`` if
        unsuccessful.

        :param str group: Group we want users for.
505322
def get_group_members(self, group):
        

        conn = self.bind
        try:
            records = conn.search_s(
                current_app.config['LDAP_BASE_DN'], ldap.SCOPE_SUBTREE,
                ldap_filter.filter_format(
                    current_app.config['LDAP_GROUP_OBJECT_FILTER'], (group,)),
                [current_app.config['LDAP_GROUP_MEMBERS_FIELD']])
            conn.unbind_s()
            if records:
                if current_app.config['LDAP_GROUP_MEMBERS_FIELD'] in \
                        records[0][1]:
                    members = records[0][1][
                        current_app.config['LDAP_GROUP_MEMBERS_FIELD']]
                    if sys.version_info[0] > 2:
                        members = [m.decode('utf-8') for m in members]
                    return members
        except ldap.LDAPError as e:
            raise LDAPException(self.error(e.args))
1184398
def list_groups(region=None, key=None, keyid=None, profile=None):
    '''
    

    '''
    return [a.name for a in get_all_groups(region=region, key=key, keyid=keyid, profile=profile)]
1250331
def groups(self, user, include=None):
        
        return self._query_zendesk(self.endpoint.groups, 'group', id=user, include=include)
32258
def get_user_group_list(self, steamID, format=None):
        
        parameters = {'steamid' : steamID}
        if format is not None:
            parameters['format'] = format
        url = self.create_request_url(self.interface, 'GetUserGroupList', 1,
            parameters)
        data = self.retrieve_request(url)
        return self.return_data(data, format=format)
363994
def _gather_group_members(group, groups, users):
    '''
    
    '''
    _group = __salt__['group.info'](group)

    if not _group:
        log.warning('Group %s does not exist, ignoring.', group)
        return

    for member in _group['members']:
        if member not in users:
            users[member] = groups[group]
1070460
def list_members(context, request):
    """"""
    members = context.members()
    return {
        'users': [{
            'username': m.identifier,
            'userid': m.userid,
            'roles': context.get_member_roles(m.userid),
            'links': [rellink(m, request)]
        } for m in members]
    }
430366
def get_group_admin(self, group):
        
        data = {
            'name': group,
        }
        response = _fix_group(self.post('getGroupAdmin', data))
        return response
975367
def get_members(self, sort='id_asc'):
        
        return self._session.fetch_items("groups.getMembers", User.from_json, 1000, group_id=self.id, sort=sort, fields=User.__slots__ + User.USER_FIELDS)
559196
def groups_names(self):
        
        return _ListProxy(self._get_group_name_by_num(i) for i in range(self.groups_count))
375067
def groups(self) -> Set[str]:
        
        return set(opt.group_name for opt in self._options.values())
261475
def get_user_groups(name, sid=False):
    '''
    
    '''
    if name == 'SYSTEM':
        # 'win32net.NetUserGetLocalGroups' will fail if you pass in 'SYSTEM'.
        groups = [name]
    else:
        groups = win32net.NetUserGetLocalGroups(None, name)

    if not sid:
        return groups

    ret_groups = set()
    for group in groups:
        ret_groups.add(get_sid_from_name(group))

    return ret_groups
1236970
def get_members_of_group(self, gname):
        
        contactgroup = self.find_by_name(gname)
        if contactgroup:
            return contactgroup.get_contacts()
        return []
613423
def add_to_group(self, group, user):
        
        data = {'group': group, 'user': user}
        return self.post('addUserToGroup', data)
1365608
def list_group_members(self, name):
        
        self.project_service.set_auth(self._token_project)
        return self.project_service.list_group_members(name)
13548
def user_groups(self, ldap_user, group_search):
        
        groups = []

        try:
            user_uid = ldap_user.attrs["uid"][0]

            if "gidNumber" in ldap_user.attrs:
                user_gid = ldap_user.attrs["gidNumber"][0]
                filterstr = "(|(gidNumber={})(memberUid={}))".format(
                    self.ldap.filter.escape_filter_chars(user_gid),
                    self.ldap.filter.escape_filter_chars(user_uid),
                )
            else:
                filterstr = "(memberUid={})".format(
                    self.ldap.filter.escape_filter_chars(user_uid)
                )

            search = group_search.search_with_additional_term_string(filterstr)
            groups = search.execute(ldap_user.connection)
        except (KeyError, IndexError):
            pass

        return groups
647576
def groupfinder(userid, request):
    
    if userid and hasattr(request, "user") and request.user:
        groups = ["group:%s" % g.id for g in request.user.groups]
        return groups
    return []
564015
def get_organism_permissions(self, group):
        
        data = {
            'name': group,
        }
        response = _fix_group(self.post('getOrganismPermissionsForGroup', data))
        return response