@classmethod
    def create(cls, message_type, payload, length=-1, padding=None):
        self = cls()

        if length < 0:
            length = len(payload)

        if padding is None:
            padding = '*' * 16
        self.bytes = struct.pack('!BH%ds%ds' % (len(payload), len(padding)),
                                 message_type,
                                 length,
                                 payload,
                                 padding)
        return self
dataset/ETHPy150Open WestpointLtd/pytls/tls/ext_heartbeat.py/HeartbeatMessage.create/original