获取用户信息
        
        :param user_alias: 用户ID
        :return:
975146
def get_people(self, user_alias=None):
        
        user_alias = user_alias or self.api.user_alias
        content = self.api.req(API_PEOPLE_HOME % user_alias).content
        xml = self.api.to_xml(re.sub(b'<br />', b'\n', content))
        try:
            xml_user = xml.xpath('//*[@id="profile"]')
            if not xml_user:
                return None
            else:
                xml_user = xml_user[0]
            avatar = first(xml_user.xpath('.//img/@src'))
            city = first(xml_user.xpath('.//div[@class="user-info"]/a/text()'))
            city_url = first(xml_user.xpath('.//div[@class="user-info"]/a/@href'))
            text_created_at = xml_user.xpath('.//div[@class="pl"]/text()')[1]
            created_at = re.match(r'.+(?=加入)', text_created_at.strip()).group()
            xml_intro = first(xml.xpath('//*[@id="intro_display"]'))
            intro = xml_intro.xpath('string(.)') if xml_intro is not None else None
            nickname = first(xml.xpath('//*[@id="db-usr-profile"]//h1/text()'), '').strip() or None
            signature = first(xml.xpath('//*[@id="display"]/text()'))
            xml_contact_count = xml.xpath('//*[@id="friend"]/h2')[0]
            contact_count = int(re.search(r'成员(\d+)', xml_contact_count.xpath('string(.)')).groups()[0])
            text_rev_contact_count = xml.xpath('//p[@class="rev-link"]/a/text()')[0]
            rev_contact_count = int(re.search(r'(\d+)人关注', text_rev_contact_count.strip()).groups()[0])
            return {
                'alias': user_alias,
                'url': API_PEOPLE_HOME % user_alias,
                'avatar': avatar,
                'city': city,
                'city_url': city_url,
                'created_at': created_at,
                'intro': intro,
                'nickname': nickname,
                'signature': signature,
                'contact_count': contact_count,
                'rev_contact_count': rev_contact_count,
            }
        except Exception as e:
            self.api.logger.exception('parse people meta error: %s' % e)
1296772
def for_user(cls, user):
        
        user_id = getattr(user, api_settings.USER_ID_FIELD)
        if not isinstance(user_id, int):
            user_id = str(user_id)

        token = cls()
        token[api_settings.USER_ID_CLAIM] = user_id

        return token
712882
def user_id(self, user):
        ''' 
        
        '''
        headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain",'Referer': 'http://'+self.domain+'/team_news.phtml',"User-Agent": user_agent}
        req = self.session.get('http://'+self.domain+'/standings.phtml',headers=headers).content
        soup = BeautifulSoup(req)
        for i in soup.find('table',cellpadding=2).find_all('tr'):
            try:
                if (user == i.find_all('td')[2].text.encode('utf8')):
                    return  i.find('a')['href'].split('pid=')[1]
            except:
                continue
        return None
567175
def get_user(self, user_id):
        
        try:
            return User.objects.get(id=user_id)
        except User.DoesNotExist:
            return None
1314754
def get_users_info(self, user_id_list, lang="zh_CN"):
        
        return self.post(
            url="https://api.weixin.qq.com/cgi-bin/user/info/batchget",
            data={
                "user_list": [
                    {
                        "openid": user_id,
                        "lang": lang
                    } for user_id in user_id_list
                ]
            }
        )
166117
def user_identity_show(self, user_id, id, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/identities/{id}.json"
        api_path = api_path.format(user_id=user_id, id=id)
        return self.call(api_path, **kwargs)
1048269
def user_info(self):
        
        account_uri = self.uri.split('/api/v1')[0] + '/account'
        req = self.request(account_uri)
        account_info = req.get()
        user_data = HTMLParser(account_info.content)
        return user_data
816031
def get_user_id_by_user(self, username):
        '''  '''
        response, status_code = self.__pod__.Users.get_v2_user(
            sessionToken=self.__session__,
            username=username
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
1155541
def user_id(self):
        
        if self._user_id is None:
            if self.has_logged_in:
                self._user_id = self._req_get_user_aq()['data']['uid']
            else:
                raise AuthenticationError('Not logged in.')
        return self._user_id
591743
def user_info(self, username):
        
        request_url = "{}/api/0/user/{}".format(self.instance, username)

        return_value = self._call_api(request_url)

        return return_value
919189
def info(self, user_id):
        
        resp = self._rtm_client.get('v1/user.info?user_id={}'.format(user_id))
        if resp.is_fail():
            raise RTMServiceError('Failed to get user information', resp)

        return resp.data['result']
24338
def get_alias(self):
        
        alias = None
        if self.alias:
            alias = self.alias
        elif self.auto_alias:
            alias = self.auto_alias

        return alias
28308
def get_user_info(self):
        
        response = self.get_proto(path='/user')
        message = yamcsManagement_pb2.UserInfo()
        message.ParseFromString(response.content)
        return UserInfo(message)
912764
def index(self, alias):
        
        clone = self._clone()
        clone._index = alias
        return clone
180720
def verify_user_alias(user, token):
    
    if token.to_alias_type == 'EMAIL':
        if token.to_alias == getattr(user, api_settings.PASSWORDLESS_USER_EMAIL_FIELD_NAME):
            setattr(user, api_settings.PASSWORDLESS_USER_EMAIL_VERIFIED_FIELD_NAME, True)
    elif token.to_alias_type == 'MOBILE':
        if token.to_alias == getattr(user, api_settings.PASSWORDLESS_USER_MOBILE_FIELD_NAME):
            setattr(user, api_settings.PASSWORDLESS_USER_MOBILE_VERIFIED_FIELD_NAME, True)
    else:
        return False
    user.save()
    return True
372064
def get_uri(self, alias):
        
        if alias in self.aliases.keys():
            return self.aliases[alias]
        if alias in self.aliases.values():
            return alias
        raise GraphException('No such schema: %r' % alias)
980574
def user(self):
        """"""
        if self._user is None:
            url = "%s/users/%s" % (self.root, self._username)
            self._user = CMPUser(url=url,
                                 securityHandler=self._securityHandler,
                                 proxy_port=self._proxy_port,
                                 proxy_url=self._proxy_url,
                                 initialize=False)
        return self._user