@classmethod
  @gen.coroutine
  def CreateProspective(cls, client, user_id, webapp_dev_id, identity_key, timestamp):
    from viewfinder.backend.db.viewpoint import Viewpoint

    identity_type, identity_value = Identity.SplitKey(identity_key)

    # Ensure that identity is created.
    identity = yield gen.Task(Identity.CreateProspective,
                              client,
                              identity_key,
                              user_id,
                              timestamp)

    # Create the default viewpoint.
    viewpoint = yield Viewpoint.CreateDefault(client, user_id, webapp_dev_id, timestamp)

    # By default, send alerts when a new conversation is started. Send email alerts if the
    # identity is email, or sms alerts if the identity is phone.
    email_alerts = AccountSettings.EMAIL_ON_SHARE_NEW if identity_type == 'Email' else AccountSettings.EMAIL_NONE
    sms_alerts = AccountSettings.SMS_ON_SHARE_NEW if identity_type == 'Phone' else AccountSettings.SMS_NONE
    settings = AccountSettings.CreateForUser(user_id,
                                             email_alerts=email_alerts,
                                             sms_alerts=sms_alerts,
                                             push_alerts=AccountSettings.PUSH_NONE)
    yield gen.Task(settings.Update, client)

    # Create a Friend relation (every user is friends with himself).
    friend = Friend.CreateFromKeywords(user_id=user_id, friend_id=user_id)
    yield gen.Task(friend.Update, client)

    # Create the prospective user.
    email = identity_value if identity_type == 'Email' else None
    phone = identity_value if identity_type == 'Phone' else None
    user = User.CreateFromKeywords(user_id=user_id,
                                   private_vp_id=viewpoint.viewpoint_id,
                                   webapp_dev_id=webapp_dev_id,
                                   email=email,
                                   phone=phone,
                                   asset_id_seq=User._RESERVED_ASSET_ID_COUNT,
                                   signing_key=secrets.CreateSigningKeyset('signing_key'))
    yield gen.Task(user.Update, client)

    raise gen.Return((user, identity))
Creates a prospective user with the specified user id. web device id, and identity key.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/user.py/User.CreateProspective