def update_subject_interests(user_id, subject_interests):
 if (not isinstance(subject_interests, list)):
  raise utils.ValidationError('Expected subject_interests to be a list.')
 else:
  for interest in subject_interests:
   if (not isinstance(interest, basestring)):
    raise utils.ValidationError('Expected each subject interest to be a string.')
   elif (not interest):
    raise utils.ValidationError('Expected each subject interest to be non-empty.')
   elif (not re.match(feconf.TAG_REGEX, interest)):
    raise utils.ValidationError('Expected each subject interest to consist only of lowercase alphabetic characters and spaces.')
 if (len(set(subject_interests)) != len(subject_interests)):
  raise utils.ValidationError('Expected each subject interest to be distinct.')
 user_settings = get_user_settings(user_id, strict=True)
 user_settings.subject_interests = subject_interests
 _save_user_settings(user_settings)

def update_subject_interests ( user_id , subject_interests ) : if ( not isinstance ( subject_interests , list ) ) : raise utils . ValidationError ( 'Expected subject_interests to be a list.' ) else : for interest in subject_interests : if ( not isinstance ( interest , basestring ) ) : raise utils . ValidationError ( 'Expected each subject interest to be a string.' ) elif ( not interest ) : raise utils . ValidationError ( 'Expected each subject interest to be non-empty.' ) elif ( not re . match ( feconf . TAG_REGEX , interest ) ) : raise utils . ValidationError ( 'Expected each subject interest to consist only of lowercase alphabetic characters and spaces.' ) if ( len ( set ( subject_interests ) ) != len ( subject_interests ) ) : raise utils . ValidationError ( 'Expected each subject interest to be distinct.' ) user_settings = get_user_settings ( user_id , strict = True ) user_settings . subject_interests = subject_interests _save_user_settings ( user_settings )
updates subject_interests of user with given user_id .