Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Convert IPv6 address to IPv4 address, if possible

        def ipv6_to_ipv4(ip6):
    """Convert IPv6 address to IPv4 address, if possible"""
    unmasked = IPv4(IPv6.fromString(ip6) ^ IPV4ADDRMASK)
    if unmasked >> IPv4.bits:
        raise ValueError("not convertible to IPv4")
    return str(unmasked)

src/b/i/BitTornado-HEAD/BitTornado/BT1/track.py   BitTornado(Download)
import threading
from urllib import quote, unquote
from BitTornado.NetworkAddress import is_ipv4, is_valid_ip, ipv6_to_ipv4, \
    to_ipv4, AddrList
from BitTornado.parseargs import parseargs, formatDefinitions
                ip = ipv6_to_ipv4(ip)
                ipv4 = True
            except ValueError: