import struct


def getTransactionId(packet):
    """Pulls out the transaction id of the packet"""
    if isinstance(packet, list):
        return struct.unpack(">H", struct.pack("BB", *packet[:2]) )[0]
    else:
        return struct.unpack(">H", packet[:2])[0]