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

def agent_check_deregister(consul_url=None, token=None, checkid=None):
    '''
    The agent will take care of deregistering the check from the Catalog.

    :param consul_url: The Consul server URL.
    :param checkid: The ID of the check to deregister from Consul.
    :return: Boolean and message indicating success or failure.

    CLI Example:

    .. code-block:: bash

        salt '*' consul.agent_check_deregister checkid='Memory Utilization'

    '''
    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

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

    function = 'agent/check/deregister/{0}'.format(checkid)
    res = _query(consul_url=consul_url,
                 function=function,
                 token=token,
                 method='GET')
    if res['res']:
        ret['res'] = True
        ret['message'] = ('Check {0} removed from agent.'.format(checkid))
    else:
        ret['res'] = False
        ret['message'] = 'Unable to remove check from agent.'
    return ret