def handle_get_user(self, req):
account = req.path_info_pop()<EOL>user = req.path_info_pop()<EOL>if req.path_info or not account or account[<NUM_LIT:0>] == '<STR_LIT:.>' or not user or(user[<NUM_LIT:0>] == '<STR_LIT:.>' and user != '<STR_LIT>'):<EOL><INDENT>return HTTPBadRequest(request=req)<EOL><DEDENT>if not self.is_account_admin(req, account):<EOL><INDENT>return self.denied_response(req)<EOL><DEDENT>if user == '<STR_LIT>':<EOL><INDENT>groups = set()<EOL>marker = '<STR_LIT>'<EOL>while True:<EOL><INDENT>path = '<STR_LIT>' % (quote('<STR_LIT>' %<EOL>(self.auth_account, account)), quote(marker))<EOL>resp = self.make_pre_authed_request(<EOL>req.environ, '<STR_LIT:GET>', path).get_response(self.app)<EOL>if resp.status_int == <NUM_LIT>:<EOL><INDENT>return HTTPNotFound(request=req)<EOL><DEDENT>if resp.status_int // <NUM_LIT:100> != <NUM_LIT:2>:<EOL><INDENT>raise Exception('<STR_LIT>'<EOL>'<STR_LIT>' % (path, resp.status))<EOL><DEDENT>sublisting = json.loads(resp.body)<EOL>if not sublisting:<EOL><INDENT>break<EOL><DEDENT>for obj in sublisting:<EOL><INDENT>if obj['<STR_LIT:name>'][<NUM_LIT:0>] != '<STR_LIT:.>':<EOL><INDENT>user_json = self.get_user_detail(req, account,<EOL>obj['<STR_LIT:name>'])<EOL>if user_json is None:<EOL><INDENT>raise Exception('<STR_LIT>'<EOL>'<STR_LIT>' % (account, user, <NUM_LIT>))<EOL><DEDENT>groups.update(<EOL>g['<STR_LIT:name>'] for g in json.loads(user_json)['<STR_LIT>'])<EOL><DEDENT><DEDENT>marker = sublisting[-<NUM_LIT:1>]['<STR_LIT:name>'].encode('<STR_LIT:utf-8>')<EOL><DEDENT>body = json.dumps(<EOL>{'<STR_LIT>': [{'<STR_LIT:name>': g} for g in sorted(groups)]})<EOL><DEDENT>else:<EOL><INDENT>body = self.get_user_detail(req, account, user)<EOL>if body is None:<EOL><INDENT>return HTTPNotFound(request=req)<EOL><DEDENT>display_groups = [g['<STR_LIT:name>'] for g in json.loads(body)['<STR_LIT>']]<EOL>if ('<STR_LIT>' in display_groups and<EOL>not self.is_reseller_admin(req)) or('<STR_LIT>' in display_groups and<EOL>not self.is_super_admin(req)):<EOL><INDENT>return self.denied_response(req)<EOL><DEDENT><DEDENT>return Response(body=body, content_type=CONTENT_TYPE_JSON)<EOL>
Handles the GET v2/<account>/<user> call for getting user information.
        Can only be called by an account .admin.

        On success, a JSON dict will be returned as described::

            {"groups": [  # List of groups the user is a member of
                {"name": "<act>:<usr>"},
                    # The first group is a unique user identifier
                {"name": "<account>"},
                    # The second group is the auth account name
                {"name": "<additional-group>"}
                    # There may be additional groups, .admin being a special
                    # group indicating an account admin and .reseller_admin
                    # indicating a reseller admin.
             ],
             "auth": "plaintext:<key>"
             # The auth-type and key for the user; currently only plaintext is
             # implemented.
            }

        For example::

            {"groups": [{"name": "test:tester"}, {"name": "test"},
                        {"name": ".admin"}],
             "auth": "plaintext:testing"}

        If the <user> in the request is the special user `.groups`, the JSON
        dict will contain a single key of `groups` whose value is a list of
        dicts representing the active groups within the account. Each dict
        currently has the single key `name`. For example::

            {"groups": [{"name": ".admin"}, {"name": "test"},
                        {"name": "test:tester"}, {"name": "test:tester3"}]}

        :param req: The swob.Request to process.
        :returns: swob.Response, 2xx on success with a JSON dictionary as
                  explained above.