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

def health_state(consul_url=None, token=None, state=None, **kwargs):
    '''
    Returns the checks in the state provided on the path.

    :param consul_url: The Consul server URL.
    :param state: The state to show checks for. The supported states
                  are any, unknown, passing, warning, or critical.
                  The any state is a wildcard that can be used to
                  return all checks.
    :param dc: By default, the datacenter of the agent is queried;
               however, the dc can be provided using the "dc" parameter.
    :return: The checks in the provided state.

    CLI Example:

    .. code-block:: bash

        salt '*' consul.health_state state='redis1'

        salt '*' consul.health_state service='redis1' passing='True'

    '''
    ret = {}
    query_params = {}
    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

    if not state:
        raise SaltInvocationError('Required argument "state" is missing.')

    if 'dc' in kwargs:
        query_params['dc'] = kwargs['dc']

    if state not in ('any', 'unknown', 'passing', 'warning', 'critical'):
        ret['message'] = 'State must be any, unknown, passing, warning, or critical.'
        ret['res'] = False
        return ret

    function = 'health/state/{0}'.format(state)
    ret = _query(consul_url=consul_url,
                 function=function,
                 token=token,
                 query_params=query_params)
    return ret