def remove_client(self, client):
        if isinstance(client, StratumClient):
            del self.clients[client._id]
            address, worker = client.address, client.worker
            self._incr('stratum_disconnects')

            if client.authenticated:
                self.authed_clients -= 1
            if client.idle:
                self.idle_clients -= 1

            # it won't appear in the luts if these values were never set
            if address is None and worker is None:
                return

            # wipe the client from the address tracker
            if address in self.address_lut:
                # remove from lut for address
                self.address_lut[address].remove(client)
                # if it's the last client in the object, delete the entry
                if not len(self.address_lut[address]):
                    del self.address_lut[address]

            # wipe the client from the address/worker lut
            key = (address, worker)
            if key in self.address_worker_lut:
                self.address_worker_lut[key].remove(client)
                # if it's the last client in the object, delete the entry
                if not len(self.address_worker_lut[key]):
                    del self.address_worker_lut[key]
        elif isinstance(client, AgentClient):
            self._incr('agent_disconnects')
            del self.agent_clients[client._id]
        else:
            self.logger.warn("Remove client got unknown client of type {}"
                             .format(type(client)))
Manages removing the StratumClient from the luts
dataset/ETHPy150Open simplecrypto/powerpool/powerpool/stratum_server.py/StratumServer.remove_client