def user_create(username, new_login_password=None, **kwargs):
    '''
    Creates a new user.
    If new_login_password is not specified, the user will be created without a login.

    CLI Example:

    .. code-block:: bash

        salt minion mssql.user_create USERNAME database=DBNAME [new_login_password=PASSWORD]
    '''
    # 'database' argument is mandatory
    if 'database' not in kwargs:
        return False
    if user_exists(username, **kwargs):
        return False

    try:
        conn = _get_connection(**kwargs)
        conn.autocommit(True)
        cur = conn.cursor()

        if new_login_password:
            if login_exists(username, **kwargs):
                conn.close()
                return False
            cur.execute("CREATE LOGIN {0} WITH PASSWORD='{1}',check_policy = off".format(username, new_login_password))
            cur.execute("CREATE USER {0} FOR LOGIN {1}".format(username, username))
        else:  # new_login_password is not specified
            cur.execute("CREATE USER {0} WITHOUT LOGIN".format(username))

        conn.autocommit(False)
        conn.close()
        return True
    except Exception as e:
        return 'Could not create the user: {0}'.format(e)
dataset/ETHPy150Open saltstack/salt/salt/modules/mssql.py/user_create/original