human
Complete this python program:
def _TestQueryViewpoints(tester, user_cookie, request_dict):
assistant
#Here is the Python code you requested.

    """Called by the ServiceTester in order to test query_viewpoints
    service API call.
    """
    validator = tester.validator
    cookie_dict = tester.DecodeUserCookie(user_cookie)
    user_id = cookie_dict.get('user_id', None)
    device_id = cookie_dict.get('device_id', None)
    cookie_viewpoint_id = cookie_dict.get('viewpoint_id', None)
    actual_dict = tester.SendRequest('query_viewpoints', user_cookie, request_dict)
    limit = request_dict.get('limit', None)
    expected_dict = {'viewpoints': []}
    for request_vp in request_dict['viewpoints']:
        viewpoint_id = request_vp['viewpoint_id']
        expected_vp = validator.GetModelObject(Viewpoint, viewpoint_id, must_exist=False)
        expected_foll = validator.GetModelObject(Follower, DBKey(user_id, viewpoint_id), must_exist=False)
        if (expected_foll is not None):
            expected_vp_dict = {'viewpoint_id': viewpoint_id}
            if request_vp.get('get_attributes', False):
                expected_vp_dict.update(expected_vp.MakeMetadataDict(expected_foll))
                if ('cover_photo' in expected_vp_dict):
                    photo_dict = expected_vp_dict['cover_photo']
                    obj_store = ObjectStore.GetInstance(ObjectStore.PHOTO)
                    _AddPhotoUrls(obj_store, photo_dict)
            if ((not expected_foll.IsRemoved()) and request_vp.get('get_followers', False)):
                def _TestFollower(foll):
                    return ((foll.viewpoint_id == viewpoint_id) and (foll.user_id > int(request_vp.get('follower_start_key', 0))))
                followers = validator.QueryModelObjects(Follower, predicate=_TestFollower, limit=limit)
                expected_vp_dict['followers'] = [foll.MakeFriendMetadataDict() for foll in followers]
                if (len(followers) > 0):
                    expected_vp_dict['follower_last_key'] = ('%015d' % followers[(-1)].user_id)
            is_cookie_viewpoint = ((cookie_viewpoint_id is None) or (cookie_viewpoint_id == viewpoint_id))
            can_view_content = (is_cookie_viewpoint or expected_vp.IsSystem())
            if...