@gen.coroutine
  def _CreateWelcomeConversation(self):
    from viewfinder.backend.www.system_users import NARRATOR_USER
    from viewfinder.backend.www.system_users import NARRATOR_UPLOAD_PHOTOS, NARRATOR_UPLOAD_PHOTOS_2, NARRATOR_UPLOAD_PHOTOS_3

    # Accumulate accounting changes.
    self._acc_accum = AccountingAccumulator()

    self._unique_id = self._unique_id_start
    self._update_seq = 1

    # Create the viewpoint.
    self._viewpoint_id = Viewpoint.ConstructViewpointId(self._new_user.webapp_dev_id, self._unique_id)
    self._unique_id += 1
    initial_follower_ids = [self._new_user.user_id]
    viewpoint, followers = yield Viewpoint.CreateNewWithFollowers(self._client,
                                                                  follower_ids=initial_follower_ids,
                                                                  user_id=NARRATOR_USER.user_id,
                                                                  viewpoint_id=self._viewpoint_id,
                                                                  type=Viewpoint.SYSTEM,
                                                                  title='Welcome...',
                                                                  timestamp=self._op.timestamp)

    # Narrator creates and introduces the conversation.
    yield self._CreateActivity(NARRATOR_USER,
                               self._op.timestamp - 60,
                               Activity.CreateShareNew,
                               ep_dicts=[],
                               follower_ids=initial_follower_ids)

    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 60,
                            'Welcome to Viewfinder, a new way to privately share photos with your friends.')

    # Narrator shares photos.
    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 59,
                            'Select as many photos as you want to share with exactly who you want.')

    photo_ids = [ph_dict['photo_id'] for ph_dict in NARRATOR_UPLOAD_PHOTOS['photos']]
    episode = yield self._CreateEpisodeWithPosts(NARRATOR_USER,
                                                 NARRATOR_UPLOAD_PHOTOS['episode']['episode_id'],
                                                 NARRATOR_UPLOAD_PHOTOS['photos'])
    yield self._CreateActivity(NARRATOR_USER,
                               self._op.timestamp - 58,
                               Activity.CreateShareExisting,
                               ep_dicts=[{'new_episode_id': episode.episode_id, 'photo_ids': photo_ids}])

    # Set cover photo on viewpoint now that episode id is known.
    viewpoint.cover_photo = {'episode_id': episode.episode_id,
                             'photo_id': NARRATOR_UPLOAD_PHOTOS['photos'][0]['photo_id']}
    yield gen.Task(viewpoint.Update, self._client)

    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 56,
                            'Your friends can also add photos to the conversation, '
                            'creating unique collaborative albums.')

    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 55,
                            'You can add as many photos, messages and friends as you want to the conversation, '
                            'leading to a memorable shared experience.')

    # Narrator shares more photos.
    photo_ids = [ph_dict['photo_id'] for ph_dict in NARRATOR_UPLOAD_PHOTOS_2['photos']]
    episode = yield self._CreateEpisodeWithPosts(NARRATOR_USER,
                                                 NARRATOR_UPLOAD_PHOTOS_2['episode']['episode_id'],
                                                 NARRATOR_UPLOAD_PHOTOS_2['photos'])
    yield self._CreateActivity(NARRATOR_USER,
                               self._op.timestamp - 54,
                               Activity.CreateShareExisting,
                               ep_dicts=[{'new_episode_id': episode.episode_id, 'photo_ids': photo_ids}])

    # Single-photo comment.
    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 53,
                            'Hold and press on photos to comment on specific pics.',
                            asset_id=NARRATOR_UPLOAD_PHOTOS_2['photos'][1]['photo_id'])

    # Narrator rambles on for a while.
    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 52,
                            'Use mobile #\'s or email addresses to add new people if they\'re not yet on Viewfinder.');

    # Narrator shares more photos.
    photo_ids = [ph_dict['photo_id'] for ph_dict in NARRATOR_UPLOAD_PHOTOS_3['photos']]
    episode = yield self._CreateEpisodeWithPosts(NARRATOR_USER,
                                                 NARRATOR_UPLOAD_PHOTOS_3['episode']['episode_id'],
                                                 NARRATOR_UPLOAD_PHOTOS_3['photos'])
    yield self._CreateActivity(NARRATOR_USER,
                               self._op.timestamp - 51,
                               Activity.CreateShareExisting,
                               ep_dicts=[{'new_episode_id': episode.episode_id, 'photo_ids': photo_ids}])


    # Conclusion.
    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 50,
                            'Viewfinder is perfect for vacations, weddings, or any shared experience where you want '
                            'to share photos without posting them for everyone to see.')

    yield self._PostComment(NARRATOR_USER,
                            self._op.timestamp - 49,
                            'Start sharing now.')

    # Validate that we allocated enough ids and counted update_seq properly.
    assert self._unique_id == self._unique_id_start + CreateProspectiveOperation._ASSET_ID_COUNT, self._unique_id
    assert self._update_seq == CreateProspectiveOperation._UPDATE_SEQ_COUNT, self._update_seq

    # Set update_seq on the new viewpoint.
    viewpoint.update_seq = self._update_seq
    yield gen.Task(viewpoint.Update, self._client)

    # Remove this viewpoint for all sample users so that accounting will be correct (also in case
    # we want to sync a device to Nick's account and see if new users are trying to chat). Also
    # update viewed_seq so that entire conversation is "read" for each sample user.
    for follower in followers:
      if follower.user_id != self._new_user.user_id:
        follower.viewed_seq = viewpoint.update_seq
        yield follower.RemoveViewpoint(self._client)

    # Commit accounting changes.
    yield self._acc_accum.Apply(self._client)
Create (if they don't exist) and link the attachments and upload dirs
dataset/ETHPy150Open viewfinderco/viewfinder/backend/op/create_prospective_op.py/CreateProspectiveOperation._CreateWelcomeConversation--crossover with--dataset/ETHPy150Open winhamwr/neckbeard/neckbeard/brain_wrinkles/pstat/app.py/AppServerProvisioner._link_storage_dirs