https://developer.zendesk.com/rest_api/docs/core/group_memberships#list-memberships
485052
def user_group_memberships(self, user_id, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/group_memberships.json"
        api_path = api_path.format(user_id=user_id)
        return self.call(api_path, **kwargs)
606457
def group_members(self, group_id, include_orphans=False):
        
        params = {'includeOrphans': str(include_orphans).lower()}
        url = self._service_url(['triggers', 'groups', group_id, 'members'], params=params)
        return Trigger.list_to_object_list(self._get(url))
599995
def list_group_members(self, name):
        
        return self.service.list_group_members(
            name, self.url_prefix, self.auth, self.session,
            self.session_send_opts)
1275618
def by_group(self):  # pragma: no cover
        
        group_membership = {}
        for record in self.__get_groups_with_membership():
            group_membership[record.cn.value] = [
                i for i in record.memberUid.values
            ]
        return group_membership
913754
def groupmember_get(self, manager_id, session):
        ''''''
        request = TOPRequest('taobao.wangwang.eservice.groupmember.get')
        request['manager_id'] = manager_id
        self.create(self.execute(request, session))
        return self.group_member_list
1314633
def users_list(self, permission_set=None, role=None, **kwargs):
        ""
        api_path = "/api/v2/users.json"
        api_query = {}
        if "query" in kwargs.keys():
            api_query.update(kwargs["query"])
            del kwargs["query"]
        if permission_set:
            api_query.update({
                "permission_set": permission_set,
            })
        if role:
            api_query.update({
                "role": role,
            })
        return self.call(api_path, query=api_query, **kwargs)
778749
def get_memberships_for_org(self, account_num, verbose=False):
        
        if not self.client.session_id:
            self.client.request_session()

        query = "SELECT Objects() FROM Membership " \
                "WHERE Owner = '%s' ORDER BY ExpirationDate" % account_num

        membership_list = self.get_long_query(query, verbose=verbose)
        return membership_list or []
529906
def org_find_members(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/findMembers' % object_id, input_params, always_retry=always_retry, **kwargs)
412381
def list_subgroups_accounts(self, id, account_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        self.logger.debug("GET /api/v1/accounts/{account_id}/outcome_groups/{id}/subgroups with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/accounts/{account_id}/outcome_groups/{id}/subgroups".format(**path), data=data, params=params, all_pages=True)
132537
def room_members(self, stream_id):
        '''  '''
        req_hook = 'pod/v2/room/' + str(stream_id) + '/membership/list'
        req_args = None
        status_code, response = self.__rest__.GET_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
1314365
def ib_group_policy_list(self):
        '''  '''
        req_hook = 'pod/v1/admin/policy/list'
        req_args = None
        status_code, response = self.__rest__.GET_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
617030
def organization_memberships(self, organization):
        
        return self._query_zendesk(self.endpoint.organization_memberships, 'organization_membership', id=organization)
1119936
def check_membership(self, groups):
        '''  '''
        if not groups or groups == ['']:
            return True
        if self.request.user.is_superuser:
            return True
        user_groups = self.request.user.groups.values_list("name", flat=True)
        return set(groups).intersection(set(user_groups))
142840
def list_members(self, retrieve_all=True, **_params):
        """"""
        # Pass filters in "params" argument to do_request
        return self.list('members', self.members_path, retrieve_all,
                         **_params)
553400
def user_organization_memberships(self, user_id, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/organization_memberships.json"
        api_path = api_path.format(user_id=user_id)
        return self.call(api_path, **kwargs)
1052725
def group_membership_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/group_memberships.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
250304
public function listAction()
    {
        $groupManager = $this->get('phlexible_user.group_manager');

        $groups = [];
        foreach ($groupManager->findAll() as $group) {
            $members = [];
            foreach ($group->getUsers() as $user) {
                $members[] = $user->getDisplayName();
            }
            sort($members);

            $groups[] = [
                'gid' => $group->getId(),
                'name' => $group->getName(),
                'readonly' => false,
                'memberCnt' => count($members),
                'members' => $members,
            ];
        }

        return new JsonResponse($groups);
    }