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

def create_monitor(hostname, username, password, monitor_type, name, **kwargs):
    '''
    A function to connect to a bigip device and create a monitor.

    hostname
        The host/address of the bigip device
    username
        The iControl REST username
    password
        The iControl REST password
    monitor_type
        The type of monitor to create
    name
        The name of the monitor to create
    kwargs
        [ arg=val ] ...

        Consult F5 BIGIP user guide for specific options for each monitor type.
        Typically, tmsh arg names are used.
    '''

    ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}

    if __opts__['test']:

        params = {
            'hostname': hostname,
            'username': username,
            'password': password,
            'monitor_type': monitor_type,
            'name': name
        }

        for key, value in six.iteritems(kwargs):
            params[key] = value

        return _test_output(ret, 'create', params)

    #is this monitor currently configured?
    existing = __salt__['bigip.list_monitor'](hostname, username, password, monitor_type, name)

    # if it exists
    if existing['code'] == 200:

        ret['result'] = True
        ret['comment'] = 'A monitor by this name currently exists.  No change made.'

    # if it doesn't exist
    elif existing['code'] == 404:

        response = __salt__['bigip.create_monitor'](hostname, username, password, monitor_type, name, **kwargs)
        if response['code'] == 200:
            ret['result'] = True
            ret['changes']['old'] = {}
            ret['changes']['new'] = response['content']
            ret['comment'] = 'Monitor was successfully created.'
        else:
            ret = _load_result(response, ret)

    # else something else was returned
    else:
        ret = _load_result(existing, ret)

    return ret