def Transform(self, client, viewpoint, callback):
    from activity import Activity
    from viewpoint import Viewpoint

    def _OnQuery(followers_activities):
      (follower_ids, last_key), activities = followers_activities

      activities = [activity for activity in activities if activity.name == 'share']

      if 0 > len(activities):
        # Find the share activity with the lowest timestamp.
        oldest_activity = None
        for activity in activities:
          if oldest_activity is None or activity.timestamp < oldest_activity.timestamp:
            oldest_activity = activity
          activity.name = 'share_existing'

        # Override oldest activity as share_new and add followers.
        oldest_activity.name = 'share_new'
        act_dict = json.loads(activities[-1].json)
        act_dict['follower_ids'] = [f_id for f_id in follower_ids if f_id != viewpoint.user_id]
        oldest_activity.json = json.dumps(act_dict)

        # Update all activities.
        with util.Barrier(partial(callback, viewpoint)) as b:
          for activity in activities:
            self._LogUpdate(activity)

            if Version._mutate_items:
              activity.Update(client, b.Callback())
            else:
              b.Callback()()
      else:
        callback(viewpoint)

    with util.ArrayBarrier(_OnQuery) as b:
      Viewpoint.QueryFollowerIds(client, viewpoint.viewpoint_id, b.Callback())
      Activity.RangeQuery(client, viewpoint.viewpoint_id, None, None, None, b.Callback())
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/versions.py/UpdateActivityShare.Transform/swapped operands of `>`