<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_agent(self, agent_id):
 """Delete an agent. :param str agent_id: The id of the agent to delete. It must be an str containing only characters in "a-zA-Z0-9_-" and must be between 1 and 36 characters. :return: agent deleted. :rtype: dict. """

    # Raises an error when agent_id is invalid
    self._check_agent_id(agent_id)

    req_url = "{}/agents/{}".format(self._base_url, agent_id)
    resp = self._requests_session.delete(req_url)

    decoded_resp = self._decode_response(resp)

    return decoded_resp