<jupyter_start><jupyter_text>User successfully logs into the domain<jupyter_code>domain = sy.login(url="https://ca.openmined.org", port=80, email="<EMAIL>", password="<PASSWORD>")
# Case I
# User wants to view their profile details

domain.userprofile
# Case II
# User wants to update their profile details
# No arguments are passed to the update method
# If no arguments are passed the profile widget pops up

domain.userprofile.update()
# Case III
# User wants to update their profile details
# User uses profile widget to update information
# Skips some pre-filled fields

# e.g. User skips to fill Email and Profile Link
domain.userprofile.update()
# Case IV
# User wants to update their profile details
# User uses profile widget to update information
# but quits the widget midway

# e.g. User quits the widget in between
domain.userprofile.update()
# Case V
# User wants to update only a single field, e.g. Name

domain.userprofile.update(field_name="Name")
# Case VI
# User updates only a single field, but
# Validation of value fails

# Name: Valid if Name is not an empty.
# Email: Validate if entered valid is a valid email address.
# Profile Link: Validate if the entered value is a valid url.

# e.g. Email is invalid
domain.userprofile.update(field_name="Email")
# e.g. Name is empty
domain.userprofile.update(field_name="Name")
# Case VII
# User tries to update Email but
# another user with that Email already exists

domain.userprofile.update(field_name="Email")
# Case VIII
# User tries to update a field that does not exist

# e.g. field_name=phonenumber
domain.userprofile.update(field_name="PhoneNumber")
# If user enter field_name=password, then show a message
# to use `reset_password`

# e.g. field_name=password
domain.userprofile.update(field_name="password")<jupyter_output>[91mInvalidFieldError:[0m
    Field name `Password` does not exist.
    
    To reset your password, you can call:
    
        `<domain_client>.userprofile.reset_password()`<jupyter_text>Password ResetNote:Reset password allows a user to change/update their password only after they log into the domain.This is different from forgot password, where a user wants to reset their password without logging into the domain. Forgot password will be implemented soon....<jupyter_code># Case I
# User wants to reset their password using 
# reset password widget

domain.userprofile.reset_password()
# Case II
# User wants to reset their password using 
# reset password widget
# Current password is not correct

domain.userprofile.reset_password()
# Case III
# User wants to reset their password using 
# reset password widget
# New Password and Confirm New Password do not match

domain.userprofile.reset_password()
# Case IV
# User wants to reset their password using 
# reset password widget
# New Password does not match security requirements

domain.userprofile.reset_password()
# Case V
# Alternatively, the user can reset the password
# by passing current and new password as arguments
# to reset_password
# The validation and authentication errors indicated above still apply.

domain.userprofile.reset_password(curr_password="<PASSWORD>", new_password="<PASSWORD>")<jupyter_output>You password has been changed sucessfully.<jupyter_text>User successfully logs into the domain as guest user<jupyter_code>domain.userprofile<jupyter_output>[91mAuthorizationError:[0m
    Profile is not accessible as a guest user.
    Please login or register to the domain to access your profile.<jupyter_text>Dummy Data<jupyter_code>import pandas as pd
import sys
from enum import Enum
import uuid
from getpass import getpass


class bcolors(Enum):
    HEADER = "\033[95m"
    OKBLUE = "\033[94m"
    OKCYAN = "\033[96m"
    OKGREEN = "\033[92m"
    WARNING = "\033[93m"
    FAIL = "\033[91m"
    ENDC = "\033[0m"
    BOLD = "\033[1m"
    UNDERLINE = "\033[4m"
profile_details = f"""
{bcolors.BOLD.value}Profile Details: {bcolors.ENDC.value}
{bcolors.BOLD.value}Name:{bcolors.ENDC.value} <NAME>
{bcolors.BOLD.value}Email:{bcolors.ENDC.value} <EMAIL>
{bcolors.BOLD.value}Institution:{bcolors.ENDC.value} California Institute of Technology
{bcolors.BOLD.value}Profile Link:{bcolors.ENDC.value} http://linkedin.com/sheldon

To update your profile information, you can call:

    `<domain_client>.userprofile.update()`
"""
print(profile_details)
updated_profile_details = f"""
{bcolors.BOLD.value}Updated Details: {bcolors.ENDC.value}
{bcolors.BOLD.value}Name:{bcolors.ENDC.value} <NAME>
{bcolors.BOLD.value}Email:{bcolors.ENDC.value} <EMAIL>
{bcolors.BOLD.value}Institution:{bcolors.ENDC.value} Wayne Industries
{bcolors.BOLD.value}Profile Link:{bcolors.ENDC.value} https://iambatman.com
"""

help_text = f"""Welcome to Profile Update Widget. Introduce yourself to the Domain Owner.
Your profile information is what Domain Owners see when they are vetting your requests.

Note: 
- The current value of the field is shown inside round brackets (...).
- Please enter `s` to skip any field.
- Please enter `q` quit the widget. If you quit changes won't be saved.
- The fields marked with * cannot be empty.

Please enter the new details:

"""
current_profile_details = f"""
{bcolors.BOLD.value}Profile Details: {bcolors.ENDC.value}
{bcolors.BOLD.value}Name:{bcolors.ENDC.value} <NAME>
{bcolors.BOLD.value}Email:{bcolors.ENDC.value} <EMAIL>
{bcolors.BOLD.value}Institution:{bcolors.ENDC.value} California Institute of Technology
{bcolors.BOLD.value}Profile Link:{bcolors.ENDC.value} http://linkedin.com/sheldon
"""
sys.stdout.write(help_text)
inputs= f"""
{input("Name*: (<NAME>) - ")}
{input("Email*: (<EMAIL>) - ")}
{input("Institution: (California Institute of Technology) - ")}
{input("Profile Link: (https://www.linkedin.com/sheldon) - ")}
"""
sys.stdout.write(updated_profile_details)
partial_update_profile_details = f"""
{bcolors.BOLD.value}Updated Details: {bcolors.ENDC.value}
{bcolors.BOLD.value}Name:{bcolors.ENDC.value} <NAME>
{bcolors.BOLD.value}Email:{bcolors.ENDC.value} <EMAIL>
{bcolors.BOLD.value}Institution:{bcolors.ENDC.value} Wayne Industries
{bcolors.BOLD.value}Profile Link:{bcolors.ENDC.value} https://www.linkedin.com/sheldon
"""
field_validation = f"""
{bcolors.FAIL.value}ValidationError:{bcolors.ENDC.value}
    Invalid email. Make sure your email is in an `<EMAIL>` format
"""
name_validation = f"""
{bcolors.FAIL.value}ValidationError:{bcolors.ENDC.value}
    Invalid name. Name cannot be an empty string.
"""
email_invalid = f"""
{bcolors.FAIL.value}ValidationError:{bcolors.ENDC.value}
    Seems like an account with that email already exists on this domain.
    Please try a different email address.
"""
authorization_error = f"""
{bcolors.FAIL.value}AuthorizationError:{bcolors.ENDC.value}
    Profile is not accessible as a guest user.
    Please login or register to the domain to access your profile.
"""
field_does_not_exists = f"""
{bcolors.FAIL.value}InvalidFieldError:{bcolors.ENDC.value}
    Field name `PhoneNumber` does not exist.
    
    If you're unsure of the field name please use the profile widget to
    update your profile information.

        `<domain_client>.userprofile.update()`    
"""
field_pwd_not_exists = f"""
{bcolors.FAIL.value}InvalidFieldError:{bcolors.ENDC.value}
    Field name `Password` does not exist.
    
    To reset your password, you can call:
    
        `<domain_client>.userprofile.reset_password()`
"""
password_reset_message = """
Welcome to Password Reset Widget.

Password Requirements:
The new password should contain atleast:
- One lowercase character
- One uppercase character
- One number
- One special character from (!,@,#,$,%,^,&,*)
- Minimum 8 characters

Please provide the following details:
"""
password_reset_success_msg = """\nYou password has been changed sucessfully."""
curr_password_not_correct = f"""
    {bcolors.FAIL.value}AuthorizationError:{bcolors.ENDC.value}
        The current password you have entered is incorrect.
"""

new_password_confirm_fails = f"""
    {bcolors.FAIL.value}ValidationError:{bcolors.ENDC.value}
        New Password and Confirm New Password does not match.
"""

new_password_invalid = f"""
    {bcolors.FAIL.value}ValidationError:{bcolors.ENDC.value}
        The new password you entered doesn't meet the minimum
        security requirements.
"""
sys.stdout.write(password_reset_message)
password_inputs= f"""
{getpass("Current Password: ")}
{getpass("New Password: ")}
{getpass("Confirm New Password: ")}
"""
sys.stdout.write(password_reset_success_msg)
sys.stdout.write(password_reset_message)
password_inputs= f"""
{getpass("Current Password: ")}
{getpass("New Password: ")}
{getpass("Confirm New Password: ")}
"""
sys.stdout.write(password_reset_success_msg)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11069009071075898, 'fraction_numerical': 0.0058560110230795725, 'mean_word_length': 5.048611111111111, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '254957', 'license': 'Apache-2.0', 'n_tokens_mistral': 2701, 'n_tokens_neox': 2628, 'n_words': 816, 'path': 'notebooks/mock-notebooks/accountSettings/Add Or Update Account Information.ipynb', 'repo_name': 'Noob-can-Compile/PySyft', 'size': '8811'}