Change account email
        :param email:
        :param as_username
        :return: the email provided

def change_email(self, email, as_username=False):
        """
        Change account email
        :param email:
        :param as_username
        :return: the email provided
        """
        email = email.lower()
        data = {"email": email}
        if self.email != email:
            if self.get_by_email(email):
                raise exceptions.AuthError("Email exists already")
            if as_username:
                if self.username != email:
                    if self.get_by_username(email):
                        raise exceptions.AuthError("Username exists already")
                data["username"] = email

            self.update(**data)