<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_mbap_header(slave_id, pdu):
 """ Return byte array with MBAP header for PDU. :param slave_id: Number of slave. :param pdu: Byte array with PDU. :return: Byte array of 7 bytes with MBAP header. """

    # 65535 = (2**16)-1 aka maximum number that fits in 2 bytes.
    transaction_id = randint(0, 65535)
    length = len(pdu) + 1

    return struct.pack('>HHHB', transaction_id, 0, length, slave_id)