<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def present(name, password=None, domain=None, server_roles=None, options=None, **kwargs):
    '''
    Checks existance of the named login.
    If not present, creates the login with the specified roles and options.

    name
        The name of the login to manage
    password
        Creates a SQL Server authentication login
        Since hashed passwords are varbinary values, if the
        new_login_password is 'long', it will be considered
        to be HASHED.
    domain
        Creates a Windows authentication login.
        Needs to be NetBIOS domain or hostname
    server_roles
        Add this login to all the server roles in the list
    options
        Can be a list of strings, a dictionary, or a list of dictionaries
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    if bool(password) == bool(domain):
        ret['result'] = False
        ret['comment'] = 'One and only one of password and domain should be specifies'
        return ret
    if __salt__['mssql.login_exists'](name, domain=domain, **kwargs):
        ret['comment'] = 'Login {0} is already present (Not going to try to set its password)'.format(name)
        return ret
    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Login {0} is set to be added'.format(name)
        return ret

    login_created = __salt__['mssql.login_create'](name,
            new_login_password=password,
            new_login_domain=domain,
            new_login_roles=server_roles,
            new_login_options=_normalize_options(options),
            **kwargs)
    # Non-empty strings are also evaluated to True, so we cannot use if not login_created:
    if login_created is not True:
        ret['result'] = False
        ret['comment'] = 'Login {0} failed to be added: {1}'.format(name, login_created)
        return ret
    ret['comment'] = 'Login {0} has been added. '.format(name)
    ret['changes'][name] = 'Present'
    return ret