def to_global(prefix, mac, project_id):
    try:
        mac64 = netaddr.EUI(mac).eui64().words
        int_addr = int(''.join(['%02x' % i for i in mac64]), 16)
        mac64_addr = netaddr.IPAddress(int_addr)
        maskIP = netaddr.IPNetwork(prefix).ip
        return (mac64_addr ^ netaddr.IPAddress('::0200:0:0:0') |
                maskIP).format()
    except netaddr.AddrFormatError:
        raise TypeError(_('Bad mac for to_global_ipv6: %s') % mac)
    except __HOLE__:
        raise TypeError(_('Bad prefix for to_global_ipv6: %s') % prefix)
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/ipv6/rfc2462.py/to_global