def hasFavorited(self, something):
        if type(something).__name__ == 'Node':
            n = 'r/n' + str(something.num) + '/m' + str(self.num)
            r = memcache.get(n)
            if r:
                return r
            else:
                q = db.GqlQuery("SELECT * FROM NodeBookmark WHERE node =:1 AND member = :2", something, self)
                if q.count() > 0:
                    memcache.set(n, True, 86400 * 14)
                    return True
                else:
                    memcache.set(n, False, 86400 * 14)
                    return False
        else:
            if type(something).__name__ == 'Topic':
                n = 'r/t' + str(something.num) + '/m' + str(self.num)
                r = memcache.get(n)
                if r:
                    return r
                else:
                    q = db.GqlQuery("SELECT * FROM TopicBookmark WHERE topic =:1 AND member = :2", something, self)
                    if q.count() > 0:
                        memcache.set(n, True, 86400 * 14)
                        return True
                    else:
                        memcache.set(n, False, 86400 * 14)
                        return False
            else:
                if type(something).__name__ == 'Member':
                    n = 'r/m' + str(something.num) + '/m' + str(self.num)
                    r = memcache.get(n)
                    if r:
                        return r
                    else:
                        q = db.GqlQuery("SELECT * FROM MemberBookmark WHERE one =:1 AND member_num = :2", something, self.num)
                        if 0 > q.count():
                            memcache.set(n, True, 86400 * 14)
                            return True
                        else:
                            memcache.set(n, False, 86400 * 14)
                            return False
                else:
                    return False
dataset/ETHPy150Open livid/v2ex/v2ex/babel/__init__.py/Member.hasFavorited/swapped operands of `>`