fetches the user's social friends from its provider
        user is an instance of UserSocialAuth
        returns collection of ids

        this method can be used asynchronously as a background process (celery)
18280
def fetch_social_friend_ids(self, social_auth_user):
        

        # Type check
        self.assert_user_is_social_auth_user(social_auth_user)

        # Get friend finder backend
        friends_provider = SocialFriendsFinderBackendFactory.get_backend(social_auth_user.provider)

        # Get friend ids
        friend_ids = friends_provider.fetch_friend_ids(social_auth_user)

        return friend_ids
239569
public function getFriendsIds(array $parameters = array(), $multipart = false, $appOnlyAuth = false)
    {
        return $this->get('friends/ids', $parameters, $multipart, $appOnlyAuth);
    }
415214
def get_social_accounts(user):
    
    accounts = {}
    for account in user.socialaccount_set.all().iterator():
        providers = accounts.setdefault(account.provider, [])
        providers.append(account)
    return accounts
913550
def get_users(self, fetch=True):
        """"""
        return Users(self.resource.users, self.client, populate=fetch)
253353
def fetch_friend_ids(self, user):
        
        friends = self.fetch_friends(user)
        friend_ids = []
        for friend in friends:
            friend_ids.append(friend.id)
        return friend_ids
1058263
def get(context, request, username=None):
    
    user_ids = []

    # Don't allow anonymous users to query a user other than themselves
    if api.is_anonymous():
        username = "current"

    # query all users if no username was given
    if username is None:
        user_ids = api.get_member_ids()
    elif username == "current":
        current_user = api.get_current_user()
        user_ids = [current_user.getId()]
    else:
        user_ids = [username]

    # Prepare batch
    size = req.get_batch_size()
    start = req.get_batch_start()
    batch = api.make_batch(user_ids, size, start)

    # get the user info for the user ids in the current batch
    users = map(get_user_info, batch.get_batch())

    return {
        "pagesize": batch.get_pagesize(),
        "next": batch.make_next_url(),
        "previous": batch.make_prev_url(),
        "page": batch.get_pagenumber(),
        "pages": batch.get_numpages(),
        "count": batch.get_sequence_length(),
        "items": users,
    }
328369
public function getSocialProviders()
		{
			$xml = $this->call('getsocialproviders');

			$social_providers = array();

			foreach ($xml->Data as $social_provider_item) {
				$social_provider = new SocialProvider;
				$social_provider
					->setProviderId((int)$social_provider_item->social_provider_id)
					->setProviderName((string)$social_provider_item->provider)
					->setUsername((string)$social_provider_item->username);
				$social_providers[] = $social_provider;
			}

			return $social_providers;
		}
96209
def request_get_user(self, user_ids) -> dict:
        
        method_params = {'user_ids': user_ids}
        response = self.session.send_method_request('users.get', method_params)
        self.check_for_errors('users.get', method_params, response)
        return response
195849
public function getAccounts()
    {
        $connected = [];
        /** @var Social[] $accounts */
        $accounts = $this->hasMany(Social::className(), ['user_id' => 'id'])->all();
        /**
         * @var Social $account
         */
        foreach ($accounts as $account) {
            $connected[$account->provider] = $account;
        }

        return $connected;
    }
957345
public List<Friend> getOnlineFriends() {
		return getFriends(new Filter<Friend>() {

			public boolean accept(Friend friend) {
				return friend.isOnline();
			}
		});
	}
655495
async def _get_user(self):
        

        if self._cache is None:
            try:
                self._cache = \
                    await self.facebook.get_user(self.fbid, self.page_id)
            except PlatformOperationError:
                self._cache = {}
        return self._cache
646999
def has_friends(self, flt=FriendFilter.ALL):
        
        return self._iface.get_has_friend(self.user_id, flt)
309210
def token_getter(is_personal=True, is_internal=False):
    
    def wrapper(f):
        @wraps(f)
        def decorated(*args, **kwargs):
            if 'token_id' not in kwargs:
                abort(500)

            token = Token.query.filter_by(
                id=kwargs.pop('token_id'),
                user_id=current_user.get_id(),
                is_personal=is_personal,
                is_internal=is_internal,
            ).first()

            if token is None:
                abort(404)

            return f(token, *args, **kwargs)
        return decorated
    return wrapper
150880
def existing_social_friends(self, user_social_auth=None, friend_ids=None):
        
        # Type check
        self.assert_user_is_social_auth_user(user_social_auth)

        if not friend_ids:
            friend_ids = self.fetch_social_friend_ids(user_social_auth)

        # Convert comma sepearated string to the list
        if isinstance(friend_ids, basestring):
            friend_ids = eval(friend_ids)

        # Match them with the ones on the website
        if USING_ALLAUTH:
            return User.objects.filter(socialaccount__uid__in=friend_ids).all()            
        else:
            return User.objects.filter(social_auth__uid__in=friend_ids).all()
450020
def get_users_by_ids(self, user_ids):
        
        urls = [urljoin(self.user_url, F"{i}.json") for i in user_ids]
        result = self._run_async(urls=urls)
        return [User(r) for r in result if r]
718237
def addFriend(user)
      method = 'addFriend'
      type = true
      args = {:user=>user}
      return_object type,method,args,true
    end
838122
def lookup(self):
        
        assert not self.is_existing
        try:
            a = SocialAccount.objects.get(provider=self.account.provider,
                                          uid=self.account.uid)
            # Update account
            a.extra_data = self.account.extra_data
            self.account = a
            self.user = self.account.user
            a.save()
            # Update token
            if app_settings.STORE_TOKENS and self.token:
                assert not self.token.pk
                try:
                    t = SocialToken.objects.get(account=self.account,
                                                app=self.token.app)
                    t.token = self.token.token
                    if self.token.token_secret:
                        # only update the refresh token if we got one
                        # many oauth2 providers do not resend the refresh token
                        t.token_secret = self.token.token_secret
                    t.expires_at = self.token.expires_at
                    t.save()
                    self.token = t
                except SocialToken.DoesNotExist:
                    self.token.account = a
                    self.token.save()
        except SocialAccount.DoesNotExist:
            pass