def send_bytes(self):
        """Retrieve all pending bytes to send on the network"""
        data = b''.join(self.bytes_to_send)
        self.bytes_to_send = []
        return data
Retrieve all pending bytes to send on the network
kafka/protocol/parser.py