<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clear_agent(self, short_name, client_id):
 """Remove a client id from being the command handler for a service. Args: short_name (str):
 The name of the service to set an agent for. client_id (str):
 A globally unique id for the client that should no longer receive commands for this service. """


        if short_name not in self.services:
            raise ArgumentError("Unknown service name", short_name=short_name)

        if short_name not in self.agents:
            raise ArgumentError("No agent registered for service", short_name=short_name)

        if client_id != self.agents[short_name]:
            raise ArgumentError("Client was not registered for service", short_name=short_name,
                                client_id=client_id, current_client=self.agents[short_name])

        del self.agents[short_name]