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

def list_(consul_url=None, token=None, key=None, **kwargs):
    '''
    List keys in Consul

    :param consul_url: The Consul server URL.
    :param key: The key to use as the starting point for the list.
    :return: The list of keys.

    CLI Example:

    .. code-block:: bash

        salt '*' consul.list
        salt '*' consul.list key='web'

    '''
    ret = {}

    if not consul_url:
        consul_url = _get_config()
        if not consul_url:
            log.error('No Consul URL found.')
            ret['message'] = 'No Consul URL found.'
            ret['res'] = False
            return ret

    query_params = {}

    if 'recurse' in kwargs:
        query_params['recurse'] = 'True'

    # No key so recurse and show all values
    if not key:
        query_params['recurse'] = 'True'
        function = 'kv/'
    else:
        function = 'kv/{0}'.format(key)

    query_params['keys'] = 'True'
    query_params['separator'] = '/'
    ret = _query(consul_url=consul_url,
                 function=function,
                 token=token,
                 query_params=query_params)
    return ret