<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pack(self, remaining_size):
 """Pack data of part into binary format"""

        arguments_count, payload = self.pack_data(remaining_size - self.header_size)
        payload_length = len(payload)

        # align payload length to multiple of 8
        if payload_length % 8 != 0:
            payload += b"\x00" * (8 - payload_length % 8)

        self.header = PartHeader(self.kind, self.attribute, arguments_count, self.bigargumentcount,
                                 payload_length, remaining_size)
        hdr = self.header_struct.pack(*self.header)
        if pyhdb.tracing:
            self.trace_header = humanhexlify(hdr, 30)
            self.trace_payload = humanhexlify(payload, 30)
        return hdr + payload