Get the organization to which the user belongs

        Returns:
            dictionary of the response
767539
def get_organization(self, **kwargs):
        
        resp = self._get(self._u(self._ORGANIZATION_ENDPOINT_SUFFIX),
                         **kwargs)
        resp.raise_for_status()
        return resp.json()
659478
def get_nested_groups(self, username):
        

        response = self._get(self.rest_url + "/user/group/nested",
                             params={"username": username})

        if not response.ok:
            return None

        return [g['name'] for g in response.json()['groups']]
478967
def find_membership(organization_id, membership_id)
      http.get("#{membership_endpoint(organization_id)}/#{membership_id}") do |response|
        Rexpense::Entities::Membership.new response.parsed_body
      end
    end
511892
def organizations(self):
        
        if self.api and self.organization_ids:
            return self.api._get_organizations(self.organization_ids)
778762
def get(self):
        
        self._user = self._client.get(
            url=self._client.get_full_url(
                self.get_path(
                    'single', realm=self._realm_name, user_id=self._user_id
                )
            )
        )
        self._user_id = self.user["id"]
        return self._user
79949
def current(self):
        
        if not has_request_context():
            return self.no_req_ctx_user_stack.top
        user_stack = getattr(_request_ctx_stack.top, 'user_stack', None)
        if user_stack and user_stack.top:
            return user_stack.top
        return _get_user()
1091850
def get_persons(self):
        
        cs = self.data["to"]["data"]
        res = [] 
        for c in cs:
            res.append(c["name"])
        return res
193892
def members(self):
        ''''''
        with self._mutex:
            if not self._members:
                self._members = {}
                for o in self.organisations:
                    # TODO: Search for these in the tree
                    self._members[o.org_id] = o.obj.get_members()
        return self._members
1028012
def get_user(self, request):
        
        try:
            return User.objects.get(username=request.data.get('username'),
                                    is_active=True)
        except User.DoesNotExist:
            return None
998831
def assignee(self):
        
        if self.api and self.assignee_id:
            return self.api._get_user(self.assignee_id)
973509
def currentuser(self):
        
        request = requests.get(
            '{0}/api/v3/user'.format(self.host),
            headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        return request.json()
568692
def organization_related(self, id, **kwargs):
        ""
        api_path = "/api/v2/organizations/{id}/related.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
540726
def users(self):
        
        return sa.orm.relationship(
            "User",
            secondary="users_resources_permissions",
            passive_deletes=True,
            passive_updates=True,
        )
1199165
def users(self):
        
        if not hasattr(self, "_users"):
            us = {}
            if "users" in self.doc:
                for ur in self.doc["users"]:
                    us[ur["name"]] = u = copy.deepcopy(ur["user"])
                    BytesOrFile.maybe_set(u, "client-certificate")
                    BytesOrFile.maybe_set(u, "client-key")
            self._users = us
        return self._users
264743
def get_user(self):
        

        return self.parse_raw_response(requests_util.run_request('get', self.API_BASE_URL + '/user',
                                                                 headers=self.__get_header_with_auth()))
12844
def get_user_subadmin_groups(self, user_name):
        

        res = self._make_ocs_request(
            'GET',
            self.OCS_SERVICE_CLOUD,
            'users/' + user_name + '/subadmins',
        )

        if res.status_code == 200:
            tree = ET.fromstring(res.content)
            self._check_ocs_status(tree, [100])

            groups = tree.find('data')

            return groups

        raise HTTPResponseError(res)
613330
def user_structure(user, site):
    
    full_name = user.get_full_name().split()
    first_name = full_name[0]
    try:
        last_name = full_name[1]
    except IndexError:
        last_name = ''
    return {'userid': user.pk,
            'email': user.email,
            'nickname': user.get_username(),
            'lastname': last_name,
            'firstname': first_name,
            'url': '%s://%s%s' % (
                PROTOCOL, site.domain,
                user.get_absolute_url())}