import socket
import struct


def parse_ipv6(addr):
    """
    Return a numeric representation of the given IPv6 address.
    """
    binary_ip = socket.inet_pton(socket.AF_INET6, addr)
    high, low = struct.unpack('!QQ', binary_ip)
    return high << 64 | low