Fetch user profile information.
12389
def get_profile_data(self, raw_token):
        """"""
        token_data = json.loads(raw_token)
        # This header is the 'magic' that makes this empty GET request work.
        headers = {'Authorization': 'OAuth %s' % token_data['access_token']}

        try:
            response = self.request('get', self.profile_url, headers=headers)
            response.raise_for_status()
        except RequestException as e:
            logger.error('Unable to fetch user profile: {0}'.format(e))
            return None
        else:
            return response.json() or response.text
675832
function getUserProfile()
    {
        $this->api->curl_header = array(
            'Authorization: Bearer '.$this->api->access_token,
        );
        $data = $this->api->get( $this->userProfileUrl );
        $data = VariableUtil::json2Array($data);

        /*
         * Get the base URL with the instance to store it along with the
         * Token data.
         */
        $urlParts = parse_url($data['profile']);
        $this->api->api_base_url = $urlParts['scheme'].'://'.$urlParts['host'];

        return $data;
    }
913550
def get_users(self, fetch=True):
        """"""
        return Users(self.resource.users, self.client, populate=fetch)
965955
def user_info(self, kv):
        """"""

        key, value = kv
        self.__user_info[key] = value
440776
async def get_profile(self, *tags):
        ''''''
        url = '{0.BASE}/profile/{1}'.format(self, ','.join(tags))

        data = await self.request(url)
                
        if isinstance(data, list):
            return [Profile(self, c) for c in data]
        else:
            return Profile(self, data)
493893
def get_profile(session):
    """"""
    try:
        profile = session.get(PROFILE_URL).json()
        if 'errorCode' in profile and profile['errorCode'] == '403':
            raise MoparError("not logged in")
        return profile
    except JSONDecodeError:
        raise MoparError("not logged in")
57368
def get_profile_info(self):
        """"""
        return sorted(self.profile_info.items(),
                      key=lambda kv: kv[1],
                      reverse=False)
        return
898223
def get_user_info(self, steamID):
        """"""
        url = self.create_request_url(self.USER, steamID)
        data = self.retrieve_request(url)
        return self.return_data(data, format='xml')
218069
def get_associated_profiles(self):
        
        uri = "{}/associatedProfiles".format(self.data['uri'])
        return self._helper.do_get(uri)
719747
def users_info(self, user_id=None, username=None, **kwargs):
        """"""
        if user_id:
            return self.__call_api_get('users.info', userId=user_id, kwargs=kwargs)
        elif username:
            return self.__call_api_get('users.info', username=username, kwargs=kwargs)
        else:
            raise RocketMissingParamException('userID or username required')
440392
def get_profile_for_user(user):
    
    if not hasattr(user, '_yacms_profile'):
        # Raises ProfileNotConfigured if not bool(ACCOUNTS_PROFILE_MODEL)
        profile_model = get_profile_model()
        profile_manager = profile_model._default_manager.using(user._state.db)

        user_field = get_profile_user_fieldname(profile_model, user.__class__)
        profile, created = profile_manager.get_or_create(**{user_field: user})

        profile.user = user
        user._yacms_profile = profile

    return user._yacms_profile
133712
def render_profile_data(self, as_parsed):
        """"""
        try:
            return deep_map(self._render_profile_data, as_parsed)
        except RecursionException:
            raise DbtProfileError(
                'Cycle detected: Profile input has a reference to itself',
                project=as_parsed
            )
1231057
def user_parse(data):
        """"""
        yield 'id', data.get('id') or data.get('user_id')
        first_name, _, last_name = data['name'].partition(' ')
        yield 'first_name', first_name
        yield 'last_name', last_name
        yield 'picture', data.get('profile_image_url')
        yield 'locale', data.get('lang')
        yield 'link', data.get('url')
        yield 'username', data.get('screen_name')
        city, _, country = map(lambda s: s.strip(),
                               data.get('location', '').partition(','))
        yield 'city', city
        yield 'country', country
902142
def get(self, request,pk):
            
        requested_profile = Profile.objects.get(user=pk)
        
        if requested_profile.user == self.request.user:
            
            return render(request, self.template_name, {'profile' : requested_profile})
        
        else:
            
            return HttpResponse(status = 403)
341325
def get_user(self, uid):
		""""""
		
		r = requests.get(api_url+'users/'+str(uid)+'/', headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return User(r.json())
1153387
protected function _getUserData()
    {
        $profile = $this->get('userinfo');
        $data = array(
            'id' => $profile->id ,
            'profile_url' => $profile->link,
            'name' => $profile->name,
            'large_avatar' => $profile->picture,
            'thumb_avatar' => $profile->picture,
        );

        return $data;
    }
611117
def get_profile_data(self, auth_response):
        
        res = auth_response
        token = res.get('access_token')
        expires = res.get('expires_in')
        expires = datetime.utcnow() + timedelta(seconds=int(expires))

        session[self.session_key] = (token, expires)

        me = oauth.facebook.get('me?fields=email,name')
        if me.status != 200:
            return None

        me = me.data
        email = me.get('email')
        id = me.get('id')
        if not id:
            raise x.UserException('Facebook must return a user id')

        data = dict(
            provider=self.provider,
            email=email,
            id=id,
            token=token,
            expires=expires
        )

        return data