Get Posts of the user's feed.

        :return: Iterator over Posts of the user's feed.
171617
def get_feed_posts(self) -> Iterator[Post]:
        

        data = self.context.graphql_query("d6f4427fbe92d846298cf93df0b937d3", {})["data"]

        while True:
            feed = data["user"]["edge_web_feed_timeline"]
            yield from (Post(self.context, edge["node"]) for edge in feed["edges"]
                        if not edge["node"]["__typename"] == "GraphSuggestedUserFeedUnit")
            if not feed["page_info"]["has_next_page"]:
                break
            data = self.context.graphql_query("d6f4427fbe92d846298cf93df0b937d3",
                                              {'fetch_media_item_count': 12,
                                               'fetch_media_item_cursor': feed["page_info"]["end_cursor"],
                                               'fetch_comment_count': 4,
                                               'fetch_like': 10,
                                               'has_stories': False})["data"]
568431
def get_following(self):
        
        return github.PaginatedList.PaginatedList(
            github.NamedUser.NamedUser,
            self._requester,
            "/user/following",
            None
        )
921382
def collections(self):
        
        import time
        gotten_feed_num = 20
        offset = 0
        data = {
            'method':'next',
            '_xsrf': self.xsrf
        }
        while gotten_feed_num >= 10:
            data['params'] = "{\"answer_url\": %d,\"offset\": %d}" % (self.id, offset)
            res = self._session.post(url=Get_Collection_Url, data=data)
            gotten_feed_num = len(res.json()['msg'])
            offset += gotten_feed_num
            soup = BeautifulSoup(''.join(res.json()['msg']))
            for zm_item in soup.find_all('div', class_='zm-item'):
                url = Zhihu_URL + zm_item.h2.a['href']
                name = zm_item.h2.a.text
                links = zm_item.div.find_all('a')
                owner = Author(links[0]['href'], session=self._session)
                follower_num = int(links[1].text.split()[0])
                yield Collection(url, owner=owner, name=name,
                                 follower_num=follower_num,
                                 session=self._session)

            time.sleep(0.2)
699257
def get_queryset(self):
        
        # Determines the forums that can be accessed by the current user
        forums = self.request.forum_permission_handler.get_readable_forums(
            Forum.objects.all(), self.request.user,
        )

        # Returns the posts submitted by the considered user.
        return (
            Post.objects
            .select_related('topic', 'topic__forum', 'poster')
            .prefetch_related('poster__forum_profile')
            .filter(poster=self.poster, topic__forum__in=forums)
            .order_by('-created')
        )
1314252
function getFollowers(T, user_id, max_followers, finish) {
  return getFollowersIt(T, user_id, [], -1, max_followers, finish);
}
1331528
def get_page(self, url):
        
        if url:
            data = self.feed._request(url, offset=self._offset, since=self._since, before=self._before)

            # set values to False to avoid using them for next request
            self._before = False if self._before is not None else None
            self._since = False if self._since is not None else None
            if getattr(self.feed, 'issue65', False):
                self._offset = False
            if self._since is not None:
                # we want oldest items first when using 'since'
                return reversed(data['items'])
            else:
                return data['items']
        else:
            return []
941397
function getFollowersIt(T, user_id, followers, cursor, max_followers, finish) {
  if (followers.length >= max_followers) {
    return finish(followers);
  }

  T.get('followers/list', {user_id: user_id, cursor: cursor}, function (err, data) {
    if (err) {
      console.log(err);
      return delay(function () {
        getFollowersIt(T, user_id, followers, cursor, max_followers, finish);
      });
    }

    // user.followers_ids = data.users.map(function (user) { 
    //   return user.id;
    // });
    // finish(data.users);
    followers = followers.concat(data.users);
    getFollowersIt(T, user_id, followers, data.next_cursor, max_followers, finish);
  });
}
273625
def by_user(self):  # pragma: no cover
        
        users = [i for i in self.__get_users()]
        user_groups = {}
        group_results = {
            tuple(value): key
            for (key, value) in self.by_group().items()
        }
        for user in users:
            user_groups[user] = []
            for user_list, group in group_results.items():
                if user in user_list:
                    user_groups[user].append(group)

        return user_groups
697733
def entry_links(self):
        
        return {entry['link'] for entry in self.feed.entries if entry and entry.get('link')}
588462
def comments(self):
        

        endpoint = self.links["replies"]
        if self._comments is None:
            self._comments = Feed(endpoint, pypump=self._pump)
        return self._comments
653030
def get_unread_forums(self, user):
        
        return self.get_unread_forums_from_list(
            user, self.perm_handler.get_readable_forums(Forum.objects.all(), user))
480099
def get_users_for_assigned_to():
    
    User = get_user_model()
    return User.objects.filter(is_active=True, is_staff=True)
1140358
def fetchAllUsers(self):
        
        data = {"viewer": self._uid}
        j = self._post(
            self.req_url.ALL_USERS, query=data, fix_request=True, as_json=True
        )
        if j.get("payload") is None:
            raise FBchatException("Missing payload while fetching users: {}".format(j))

        users = []
        for data in j["payload"].values():
            if data["type"] in ["user", "friend"]:
                if data["id"] in ["0", 0]:
                    # Skip invalid users
                    continue
                users.append(User._from_all_fetch(data))
        return users
514775
def list_feeds(self):
        
        feeds = configparser.ConfigParser()
        feeds.read(self.data_filename)
        return feeds.sections()
754965
def feeds(self):
        
        url = self._build_url('feeds')
        json = self._json(self._get(url), 200)
        del json['ETag']
        del json['Last-Modified']

        urls = [
            'timeline_url', 'user_url', 'current_user_public_url',
            'current_user_url', 'current_user_actor_url',
            'current_user_organization_url',
            ]

        for url in urls:
            json[url] = URITemplate(json[url])

        links = json.get('_links', {})
        for d in links.values():
            d['href'] = URITemplate(d['href'])

        return json
484847
def getPeopleFilters(self):
        
        yield AllPeopleFilter()
        yield VIPPeopleFilter()
        for getPeopleFilters in self._gatherPluginMethods('getPeopleFilters'):
            for peopleFilter in getPeopleFilters():
                yield peopleFilter
        for tag in sorted(self.getPeopleTags()):
            yield TaggedPeopleFilter(tag)
522988
def get_watchers(self, username, offset=0, limit=10):

        

        response = self._req('/user/watchers/{}'.format(username), {
            'offset' : offset,
            'limit' : limit
        })

        watchers = []

        for item in response['results']:
            w = {}
            w['user'] = User()
            w['user'].from_dict(item['user'])
            w['is_watching'] = item['is_watching']
            w['lastvisit'] = item['lastvisit']
            w['watch'] = {
                "friend" : item['watch']['friend'],
                "deviations" : item['watch']['deviations'],
                "journals" : item['watch']['journals'],
                "forum_threads" : item['watch']['forum_threads'],
                "critiques" : item['watch']['critiques'],
                "scraps" : item['watch']['scraps'],
                "activity" : item['watch']['activity'],
                "collections" : item['watch']['collections']
            }

            watchers.append(w)

        return {
            "results" : watchers,
            "has_more" : response['has_more'],
            "next_offset" : response['next_offset']
        }