def update(self, email=None, username=None, first_name=None, last_name=None, country=None):
if username and self.id_type != IdentityTypes.federatedID:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>if username and '<STR_LIT:@>' in username and not email:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>if email and username and email.lower() == username.lower():<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>updates = {}<EOL>for k, v in six.iteritems(dict(email=email, username=username,<EOL>firstname=first_name, lastname=last_name,<EOL>country=country)):<EOL><INDENT>if v:<EOL><INDENT>updates[k] = v<EOL><DEDENT><DEDENT>return self.append(update=updates)<EOL>
Update values on an existing user.  See the API docs for what kinds of update are possible.
:param email: new email for this user
:param username: new username for this user
:param first_name: new first name for this user
:param last_name: new last name for this user
:param country: new country for this user
:return: the User, so you can do User(...).update(...).add_to_groups(...)