def __pack_message(operation, data):
 request_id = _randint()
 message = struct.pack('<i', (16 + len(data)))
 message += struct.pack('<i', request_id)
 message += _ZERO_32
 message += struct.pack('<i', operation)
 return (request_id, (message + data))

def __pack_message ( operation , data ) : request_id = _randint ( ) message = struct . pack ( '<i' , ( 16 + len ( data ) ) ) message += struct . pack ( '<i' , request_id ) message += _ZERO_32 message += struct . pack ( '<i' , operation ) return ( request_id , ( message + data ) )
takes message data and adds a message header based on the operation .