def create_user(username, password=None, email=None, first_name="", last_name="",
                role="MEMBER", login_method=None):
    """
    Create a new user
    :param username:
    :param password:
    :param email:
    :param first_name:
    :param last_name:
    :param role: str
    :return: AuthUser
    """

    if not login_method:
        login_method = "email" if "@" in username else "username"

    def cb():
        return _user(models.AuthUser.new(username=username,
                                         password=password,
                                         email=email,
                                         first_name=first_name,
                                         last_name=last_name,
                                         login_method=login_method,
                                         role=role))

    return signals.create_user(cb)
Create a new user
    :param username:
    :param password:
    :param email:
    :param first_name:
    :param last_name:
    :param role: str
    :return: AuthUser