Get user's likes.
516689
def get_likes(self, offset=0, limit=50):
        
        response = self.client.get(
            self.client.USER_LIKES % (self.name, offset, limit))
        return self._parse_response(response, strack)
715157
def get_mentions(status_dict, exclude=[]):
    
    # Canonicalise the exclusion dictionary by lowercasing all names and
    # removing leading @'s
    for i, user in enumerate(exclude):
        user = user.casefold()
        if user[0] == "@":
            user = user[1:]

        exclude[i] = user

    users = [user["username"] for user in status_dict["mentions"]
             if user["username"].casefold() not in exclude]
    return users
14613
def get_user_favorites(self):
        

        return self.parse_raw_response(requests_util.run_request('get', self.API_BASE_URL + '/user/favorites',
                                                                 headers=self.__get_header_with_auth()))
878618
def _get_meta_data(self):
        """"""
        return {
            "comment": self.request.headers.get("comment", ""),
            "author": self.get_current_user() or self.settings.get('annonymous_user')
        }
1168397
def like(self):
        
        self.requester.post(
            '/{endpoint}/{id}/like',
            endpoint=self.endpoint, id=self.id
        )
        return self
832462
def get_likes(self) -> Iterator['Profile']:
        """"""
        if self.likes == 0:
            # Avoid doing additional requests if there are no comments
            return
        likes_edges = self._field('edge_media_preview_like', 'edges')
        if self.likes == len(likes_edges):
            # If the Post's metadata already contains all likes, don't do GraphQL requests to obtain them
            yield from (Profile(self._context, like['node']) for like in likes_edges)
            return
        yield from (Profile(self._context, node) for node in
                    self._context.graphql_node_list("1cb6ec562846122743b61e492c85999f", {'shortcode': self.shortcode},
                                                    'https://www.instagram.com/p/' + self.shortcode + '/',
                                                    lambda d: d['data']['shortcode_media']['edge_liked_by'],
                                                    self._rhx_gis))
82518
def like(self, **kwargs):
        

        return self._client['users/*/lists/*'].like(self.username, self.id, **kwargs)
1041230
def __get_user_ratings(self):
        

        return self.parse_raw_response(requests_util.run_request('get', self.API_BASE_URL + '/user/ratings',
                                                                 headers=self.__get_header_with_auth()))
549171
def list_liked_topics(self, user_alias=None, start=0):
        
        user_alias = user_alias or self.api.user_alias
        xml = self.api.xml(API_GROUP_LIST_USER_LIKED_TOPICS % user_alias, params={'start': start})
        return build_list_result(self._parse_topic_table(xml, 'title,comment,time,group'), xml)
1293659
def who_likes(obj):
    
    return Like.objects.filter(
        receiver_content_type=ContentType.objects.get_for_model(obj),
        receiver_object_id=obj.pk
    )
1070470
def get_user(self, username):
        """"""
        ret = {}
        tmp = self._get_user(self._byte_p2(username), ALL_ATTRS)
        if tmp is None:
            raise UserDoesntExist(username, self.backend_name)
        attrs_tmp = tmp[1]
        for attr in attrs_tmp:
            value_tmp = attrs_tmp[attr]
            if len(value_tmp) == 1:
                ret[attr] = value_tmp[0]
            else:
                ret[attr] = value_tmp
        return ret
351956
def liked(parser, token):
    
    tag, objects, _, user, _, varname = token.split_contents()
    return LikedObjectsNode(objects, user, varname)
951522
def like(self, id, reblog_key):
        
        url = "/v2/user/like"
        params = {'id': id, 'reblog_key': reblog_key}
        return self.send_api_request("post", url, params, ['id', 'reblog_key'])
507612
def link_to_like_or_unlike
      return unless helpers.current_user

      options = current_user_likes? ? like_options : unlike_options

      like_or_unlike_link(options: options)
    end
59675
def get_by_user(cls, user_id, with_deleted=False):
        """"""
        query = cls.query.filter_by(
            id_user=user_id
        )
        if not with_deleted:
            query = query.filter(cls.deleted_at.is_(None))

        return query.order_by(db.asc(Community.title))
1320539
def get_likes_count(self):
        
        response = self._session.fetch('likes.getList', count=1, type='post', owner_id=self.from_id, item_id=self.id)
        likes_count = response.get('count')
        return likes_count
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']
        }