def created_by_external_idp_and_unconfirmed(user):
    """Check if the user is created by external IdP and unconfirmed.

    There are only three possible values that indicates the status of a user's external identity:
    'LINK', 'CREATE' and 'VERIFIED'. Only 'CREATE' indicates that the user is newly created by an
    external IdP and is unconfirmed.
    """

    return 'CREATE' in set(sum([list(each.values()) for each in list(user.external_identity.values())], []))