Retrieve the organizations for this user.

        :param include: list of objects to sideload. `Side-loading API Docs 
            <https://developer.zendesk.com/rest_api/docs/core/side_loading>`__.
        :param user: User object or id
761091
def organizations(self, user, include=None):
        
        return self._query_zendesk(self.endpoint.organizations, 'organization', id=user, include=include)
1309092
def get_user(self, name):
        
        return self._api_get('/api/users/{0}'.format(
            urllib.parse.quote_plus(name)
        ))
367514
def getUsers(context, roles, allow_empty=True):
    
    mtool = getToolByName(context, 'portal_membership')
    pairs = allow_empty and [['', '']] or []
    users = mtool.searchForMembers(roles=roles)
    for user in users:
        uid = user.getId()
        fullname = user.getProperty('fullname')
        if not fullname:
            fullname = uid
        pairs.append((uid, fullname))
    pairs.sort(lambda x, y: cmp(x[1], y[1]))
    return DisplayList(pairs)
1351806
def get_memberships(self):
        

        response = self._get_xml(self.rest_url + "/group/membership")

        if not response.ok:
            return None

        xmltree = etree.fromstring(response.content)
        memberships = {}
        for mg in xmltree.findall('membership'):
            # coerce values to unicode in a python 2 and 3 compatible way
            group = u'{}'.format(mg.get('group'))
            users = [u'{}'.format(u.get('name')) for u in mg.find('users').findall('user')]
            groups = [u'{}'.format(g.get('name')) for g in mg.find('groups').findall('group')]
            memberships[group] = {u'users': users, u'groups': groups}
        return memberships
206924
def organizations(self, organization, include=None):
        
        return self._query_zendesk(self.endpoint.organizations, 'ticket', id=organization, include=include)
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)
552014
async def get_users(self, include_disabled=False):
        
        client_facade = client.UserManagerFacade.from_connection(
            self.connection())
        response = await client_facade.UserInfo(None, include_disabled)
        return [User(self, r.result) for r in response.results]
905357
def get_members(self, role=github.GithubObject.NotSet):
        
        assert role is github.GithubObject.NotSet or isinstance(role, (str, unicode)), role
        url_parameters = dict()
        if role is not github.GithubObject.NotSet:
            assert role in ['member', 'maintainer', 'all']
            url_parameters["role"] = role
        return github.PaginatedList.PaginatedList(
            github.NamedUser.NamedUser,
            self._requester,
            self.url + "/members",
            url_parameters
        )
445975
def existing_users(context):
    
    members = IWorkspace(context).members
    info = []
    for userid, details in members.items():
        user = api.user.get(userid)
        if user is None:
            continue
        user = user.getUser()
        title = user.getProperty('fullname') or user.getId() or userid
        # XXX tbd, we don't know what a persons description is, yet
        description = _(u'Here we could have a nice status of this person')
        classes = description and 'has-description' or 'has-no-description'
        portal = api.portal.get()
        portrait = '%s/portal_memberdata/portraits/%s' % \
                   (portal.absolute_url(), userid)
        info.append(
            dict(
                id=userid,
                title=title,
                description=description,
                portrait=portrait,
                cls=classes,
                member=True,
                admin='Admins' in details['groups'],
            )
        )

    return info
540726
def users(self):
        
        return sa.orm.relationship(
            "User",
            secondary="users_resources_permissions",
            passive_deletes=True,
            passive_updates=True,
        )
622025
def get_user(user=None):
    
    if user is None:
        # Return the current authenticated user
        user = getSecurityManager().getUser()
    elif isinstance(user, MemberData):
        # MemberData wrapped user -> get the user object
        user = user.getUser()
    elif isinstance(user, basestring):
        # User ID -> get the user
        user = get_member_by_login_name(get_portal(), user, False)
        if user:
            user = user.getUser()
    return user
1042343
def get_user(user, driver):  # noqa: E501
    

    response = ApitaxResponse()

    driver: Driver = LoadedDrivers.getDriver(driver)
    user: User = driver.getApitaxUser(User(username=user))
    response.body.add({'user': {'username': user.username, 'role': user.role}})

    return Response(status=200, body=response.getResponseBody())
27781
def joined_organisations(doc):
    """"""
    if doc.get('type') == 'user':
        for org_id, state in doc.get('organisations', {}).items():
            org = {'_id': org_id}
            yield [doc['_id'], None], org

            try:
                yield [doc['_id'], state['state']], org
            except KeyError:
                pass
724462
def get_organizations(self, permission='read'):
        # type: (str) -> List['Organization']
        
        success, result = self._read_from_hdx('user', self.data['name'], 'id', self.actions()['listorgs'],
                                              permission=permission)
        organizations = list()
        if success:
            for organizationdict in result:
                organization = hdx.data.organization.Organization.read_from_hdx(organizationdict['id'])
                organizations.append(organization)
        return organizations
977300
def list_roles_for_user(self, user):
        
        user_id = utils.get_id(user)
        uri = "users/%s/roles" % user_id
        resp, resp_body = self.method_get(uri)
        if resp.status_code in (401, 403):
            raise exc.AuthorizationFailure("You are not authorized to list "
                    "user roles.")
        roles = resp_body.get("roles")
        return roles
214026
def get_user(self, login=github.GithubObject.NotSet):
        
        assert login is github.GithubObject.NotSet or isinstance(login, (str, unicode)), login
        if login is github.GithubObject.NotSet:
            return AuthenticatedUser.AuthenticatedUser(self.__requester, {}, {"url": "/user"}, completed=False)
        else:
            headers, data = self.__requester.requestJsonAndCheck(
                "GET",
                "/users/" + login
            )
            return github.NamedUser.NamedUser(self.__requester, headers, data, completed=True)
1144511
def get_users(profile='pagerduty', subdomain=None, api_key=None):
    '''
    
    '''

    return _list_items(
        'users',
        'id',
        profile=profile,
        subdomain=subdomain,
        api_key=api_key,
    )