def IPNetwork(address, version=None, strict=False):
    if version:
        if version == 4:
            return IPv4Network(address, strict)
        elif version == 6:
            return IPv6Network(address, strict)

    try:
        return IPv4Network(address, strict)
    except (AddressValueError, NetmaskValueError):
        pass

    try:
        return IPv6Network(address, strict)
    except (AddressValueError, NetmaskValueError):
        pass

    raise ValueError('%r does not appear to be an IPv4 or IPv6 network' %
                     address)
Reads z-index database file and returns the first or last key depending on sort order
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/lib/ipaddr.py/IPNetwork--crossover with--dataset/ETHPy150Open nasa-gibs/onearth/src/test/oe_test_utils.py/read_zkey