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

def system(name):
    '''
    Set the keyboard layout for the system

    name
        The keyboard layout to use
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}
    if __salt__['keyboard.get_sys']() == name:
        ret['result'] = True
        ret['comment'] = 'System layout {0} already set'.format(name)
        return ret
    if __opts__['test']:
        ret['comment'] = 'System layout {0} needs to be set'.format(name)
        return ret
    if __salt__['keyboard.set_sys'](name):
        ret['changes'] = {'layout': name}
        ret['result'] = True
        ret['comment'] = 'Set system keyboard layout {0}'.format(name)
        return ret
    else:
        ret['result'] = False
        ret['comment'] = 'Failed to set system keyboard layout'
        return ret