'Initialize using several possible formats
If addr is an int/long, then it is assumed to be in host byte order
unless networkOrder = True
Stored in network byte order as a signed int'

def __init__(self, addr, networkOrder=False):

    if (isinstance(addr, basestring) or isinstance(addr, bytes)):
        if (len(addr) != 4):
            self._value = struct.unpack('i', socket.inet_aton(addr))[0]
        else:
            self._value = struct.unpack('i', addr)[0]
    elif isinstance(addr, IPAddr):
        self._value = addr._value
    elif (isinstance(addr, int) or isinstance(addr, long)):
        addr = (addr & 4294967295)
        self._value = struct.unpack('!i', struct.pack((('!' if networkOrder else '') + 'I'), addr))[0]
    else:
        raise RuntimeError('Unexpected    IP    address    format')
