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

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Take an IP string/int and return an object of the correct type.

Args:
    address: A string or integer, the IP address.  Either IPv4 or
      IPv6 addresses may be supplied; integers less than 2**32 will
      be considered to be IPv4 by default.
    version: An Integer, 4 or 6. If set, don't try to automatically
      determine what the IP address type is. important for things
      like IPAddress(1), which could be IPv4, '0.0.0.1',  or IPv6,
      '::1'.(more...)

        def IPAddress(address, version=None):
    """Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.
        version: An Integer, 4 or 6. If set, don't try to automatically
          determine what the IP address type is. important for things
          like IPAddress(1), which could be IPv4, '0.0.0.1',  or IPv6,
          '::1'.

    Returns:
        An IPv4Address or IPv6Address object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address.

    """
    if version:
        if version == 4:
            return IPv4Address(address)
        elif version == 6:
            return IPv6Address(address)

    try:
        return IPv4Address(address)
    except (AddressValueError, NetmaskValueError):
        pass

    try:
        return IPv6Address(address)
    except (AddressValueError, NetmaskValueError):
        pass

    raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
                     address)
        


src/m/a/maxminddb-0.3.3/maxminddb/reader.py   maxminddb(Download)
        ip_address -- an IP address in the standard string notation
        """
        address = ipaddress.ip_address(ip_address)
 
        if address.version == 6 and self._metadata.ip_version == 4:

src/m/a/MaxMind-DB-Reader-python-HEAD/maxminddb/reader.py   MaxMind-DB-Reader-python(Download)
        ip_address -- an IP address in the standard string notation
        """
        address = ipaddress.ip_address(ip_address)
 
        if address.version == 6 and self._metadata.ip_version == 4: