def handle_write(self):
        max_bytes = self.throttle.sendable() / 2
        if max_bytes < self.throttle.fragment_size:
            return
        bytes = self.send(self.buffer[0][:max_bytes])
        self.throttle.log_sent_bytes(bytes)
        if bytes == len(self.buffer[0]):
            self.buffer.pop(0)
        else:
            self.buffer[0] = self.buffer[0][bytes:]
        self.check_close()
Add *do_* methods in a module and add as commands into a subparsers.
dataset/ETHPy150Open jcrocholl/throxy/throxy.py/ThrottleSender.handle_write--crossover with--dataset/ETHPy150Open openstack/python-ironicclient/ironicclient/common/utils.py/define_commands_from_module