human
Complete the below
def _TestUnshare(tester, user_cookie, request_dict):

    ''''Called by the ServiceTester in order to test unshare
    service API call.
    Limitations: No error checking, no unshare limit checking.'
    '''
assistant
#Here is the Python program you requested.
    validator = tester.validator
    (user_id, device_id) = tester.GetIdsFromCookie(user_cookie)
    request_dict = deepcopy(request_dict)
    unshares_dict = {}
    def _Unshare(ep_dicts):
        'Recursively    validates    all    photos    that    were    unshared.'
        for ep_dict in ep_dicts:
            episode = validator.GetModelObject(Episode, ep_dict['episode_id'])
            unshared_photo_ids = unshares_dict.get(episode.viewpoint_id, {}).get(episode.episode_id, [])
            for ph_id in ep_dict['photo_ids']:
                key = DBKey(ep_dict['episode_id'], ph_id)
                post = validator.GetModelObject(Post, key, must_exist=False)
                if ((post is not None) and (Post.UNSHARED not in post.labels)):
                    validator.ValidateUpdateDBObject(Post, episode_id=ep_dict['episode_id'], photo_id=ph_id, labels=post.labels.union([Post.UNSHARED, Post.REMOVED]))
                    if (post.photo_id not in unshared_photo_ids):
                        unshared_photo_ids.append(post.photo_id)
            if (len(unshared_photo_ids) > 0):
                unshares_dict.setdefault(episode.viewpoint_id, {})[episode.episode_id] = unshared_photo_ids
                predicate = (lambda e: (e.parent_ep_id == episode.episode_id))
                child_episodes = validator.QueryModelObjects(Episode, predicate=predicate)
                if (len(child_episodes) > 0):
                    _Unshare([{'episode_id': ep.episode_id, 'photo_ids': ep_dict['photo_ids']} for ep in child_episodes])
    actual_dict = tester.SendRequest('unshare', user_cookie, request_dict)
    op_dict = tester._DeriveNotificationOpDict(user_id, device_id, request_dict)
    _Unshare(request_dict['episodes'])
    for viewpoint_id in sorted(unshares_dict.keys()):
        viewpoint = validator.GetModelObject(Viewpoint, viewpoint_id)
        if (not viewpoint.IsDefault()):
            viewpoint_changed = validator.ValidateCoverPhoto(viewpoint_id, unshare_ep_dicts=unshares_dict[viewpoint_id])
        else:
           ...