def inet6_ntoa(addr):
    # see RFC4291 summary in RFC5952 section 2
    s = ":".join([x % "%x" for x in unpack_from(">HHHHHHHH",
        pack("QQ", addr & 0xffffffff, addr >> 64))])

    # compress left-most zero run only (change to most for RFC5952):
    s = re.sub(r'(^|:)0:(0:)+', r'::', s, 1)
    return s

# read events
dataset/ETHPy150Open iovisor/bcc/tools/tcpconnect.py/inet6_ntoa/swapped operands of `%`