code: def size(self):
          
  
          size = 27  # Initial header size
          for datum in self.packets:
              quot, rem = divmod(len(datum), 255)
              size += quot + 1
          if not self.complete and rem == 0:
              # Packet contains a multiple of 255 bytes and is not
              # terminated, so we don't have a \x00 at the end.
              size -= 1
          size += sum(map(len, self.packets))
          return size
docs: Total frame size.