Get the specified user's friends

 user_id - integer or string
169547
def friends(user_id, options={})
      data = oauth_request("/friend/user/#{user_id}", options)
      Hashie::Mash.new(data["friends"])
    end
367923
def get_user(self, user_id):
        
        if user_id in self._users:
            return self._users.get(user_id)
        else:
            # Load user
            # Save user in cache
            return
2649
def users(self):
        
        friends = [MyPlexUser(self, elem) for elem in self.query(MyPlexUser.key)]
        requested = [MyPlexUser(self, elem, self.REQUESTED) for elem in self.query(self.REQUESTED)]
        return friends + requested
734304
def friendConnect(self, friend_id):
        
        data = {"to_friend": friend_id, "action": "confirm"}

        r = self._post(self.req_url.CONNECT, data)
        return r.ok
1212255
def get_user(self, id):
        
        self.assert_has_permission('scim.read')
        return self._get(self.uri + '/Users/%s' % (id))
1010959
def get_user(user_or_username=None):
    
    if user_or_username is None:
        return None
    if hasattr(user_or_username, "getUserId"):
        return ploneapi.user.get(user_or_username.getUserId())
    return ploneapi.user.get(userid=u.to_string(user_or_username))
743297
def user_info(name, **client_args):
    '''
    
    '''
    matching_users = (user for user in list_users(**client_args)
                      if user.get('user') == name)

    try:
        return next(matching_users)
    except StopIteration:
        pass
12805
def get_friends(self):
        """"""
        for k, v in iter(self.user_data.language_data.items()):
            data = []
            for friend in v['points_ranking_data']:
                temp = {'username': friend['username'],
                        'id': friend['id'],
                        'points': friend['points_data']['total'],
                        'languages': [i['language_string'] for i in
                                      friend['points_data']['languages']]}
                data.append(temp)

            return data
544520
def int_id(self):
        ""
        id_or_name = self.id_or_name
        if id_or_name is not None and isinstance(id_or_name, int):
            return id_or_name
        return None
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
503164
def get_uid(username)
      Etc.passwd { |u| return u.uid if u.name == username }
    end
513804
def get_user(uid, **kwargs):
    
    user_id=kwargs.get('user_id')
    if uid is None:
        uid = user_id
    user_i = _get_user(uid)
    return user_i
889675
def get_owner_ids_value(self, obj):
        """"""
        return [
            user.pk
            for user in get_users_with_permission(obj, get_full_perm('owner', obj))
        ]
531029
def user(id)
      if id
        cached_user = users.detect {|u| u[:id] == id }
        user = cached_user || fetch_user(id)
        self.users << user
        user
      end
    end
447545
def find(user_id, read_attributes="01")
      options = default_options_to_merge_with.merge({ query: { full: read_attributes} })
      self.class.get("/#{@api_ver}/users/#{user_id}", options)
    end
458685
def getFriends(self,user_id="astronauta.mecanico",write=True):
        """"""
        while user_id not in self.browser.url:
            self.browser.visit("http://www.facebook.com/{}/friends".format(user_id), wait_time=3)
        #self.go("http://www.facebook.com/{}/friends".format(user_id))
        T=time.time()
        while 1:
            h1=self.browser.evaluate_script("document.body.scrollHeight")
            self.browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
            h2=self.browser.evaluate_script("document.body.scrollHeight")
            if h1 != h2:
                T=time.time()
            elif time.time()-T>10:
                break
        #links=self.browser.find_link_by_partial_href("hc_location=friends_tab")
        links=self.browser.find_by_css(".fcb")
        friends=[]
        for link in links:
            name=link.value
            user_id_=link.find_by_tag("a")["href"].split("/")[-1].split("?")[0]
            friends.append((user_id_,name))
        tdict={}
        tdict["name"]=self.browser.find_by_id("fb-timeline-cover-name").value
        tdict["user_id"]=user_id
        tdict["friends"]=friends
        infos=self.browser.find_by_css("._3c_")
        mutual=0
        for info in infos:
            if info.value=="Mutual Friends":
                if info.find_by_css("._3d0").value:
                    tdict["n_mutual"]=info.find_by_css("._3d0").value
                    mutual=1
            if info.value=="All Friends":
                    tdict["n_friends"]=info.find_by_css("._3d0").value
        if mutual==0:
            links=self.browser.find_by_css("._gs6")
            if "Mutual" in links.value:
                tdict["n_mutual"]=links.value.split(" ")[0]
        if write:
            if not os.path.isdir("{}/fb_ids/".format(self._BASE_DIR)):
                os.mkdir("{}/fb_ids/".format(self._BASE_DIR))
            with open("{}fb_ids/{}.pickle".format(self._BASE_DIR,user_id),"wb") as f:
                pickle.dump(tdict,f)
        self.tdict=tdict
        return tdict
1291067
def find_users(session, *usernames):
    """"""
    user_string = ','.join(usernames)
    return _make_request(session, FIND_USERS_URL, user_string)