in UserProfile_function.py [0:0]
def create_user_profile(config):
domain_id = config['DomainId']
user_profile_name = config['UserProfileName']
user_settings = config['UserSettings']
response = client.create_user_profile(
DomainId=domain_id,
UserProfileName=user_profile_name,
UserSettings=user_settings,
)
created = False
while not created:
response = client.describe_user_profile(DomainId=domain_id, UserProfileName=user_profile_name)
time.sleep(5)
if response['Status'] == 'InService':
created = True
logging.info("**SageMaker domain created successfully: %s", domain_id)
return response