def __init__(self, address, strict=True):
_BaseNetwork.__init__(self, address)<EOL>if isinstance(address, (_compat_int_types, bytes)):<EOL><INDENT>self.network_address = IPv4Address(address)<EOL>self.netmask, self._prefixlen = self._make_netmask(<EOL>self._max_prefixlen)<EOL>return<EOL><DEDENT>if isinstance(address, tuple):<EOL><INDENT>if len(address) > <NUM_LIT:1>:<EOL><INDENT>arg = address[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>arg = self._max_prefixlen<EOL><DEDENT>self.network_address = IPv4Address(address[<NUM_LIT:0>])<EOL>self.netmask, self._prefixlen = self._make_netmask(arg)<EOL>packed = int(self.network_address)<EOL>if packed & int(self.netmask) != packed:<EOL><INDENT>if strict:<EOL><INDENT>raise ValueError('<STR_LIT>' % self)<EOL><DEDENT>else:<EOL><INDENT>self.network_address = IPv4Address(packed &<EOL>int(self.netmask))<EOL><DEDENT><DEDENT>return<EOL><DEDENT>addr = _split_optional_netmask(address)<EOL>self.network_address = IPv4Address(self._ip_int_from_string(addr[<NUM_LIT:0>]))<EOL>if len(addr) == <NUM_LIT:2>:<EOL><INDENT>arg = addr[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>arg = self._max_prefixlen<EOL><DEDENT>self.netmask, self._prefixlen = self._make_netmask(arg)<EOL>if strict:<EOL><INDENT>if (IPv4Address(int(self.network_address) & int(self.netmask)) !=<EOL>self.network_address):<EOL><INDENT>raise ValueError('<STR_LIT>' % self)<EOL><DEDENT><DEDENT>self.network_address = IPv4Address(int(self.network_address) &<EOL>int(self.netmask))<EOL>if self._prefixlen == (self._max_prefixlen - <NUM_LIT:1>):<EOL><INDENT>self.hosts = self.__iter__<EOL><DEDENT>
Instantiate a new IPv4 network object.

        Args:
            address: A string or integer representing the IP [& network].
              '192.0.2.0/24'
              '192.0.2.0/255.255.255.0'
              '192.0.0.2/0.0.0.255'
              are all functionally the same in IPv4. Similarly,
              '192.0.2.1'
              '192.0.2.1/255.255.255.255'
              '192.0.2.1/32'
              are also functionally equivalent. That is to say, failing to
              provide a subnetmask will create an object with a mask of /32.

              If the mask (portion after the / in the argument) is given in
              dotted quad form, it is treated as a netmask if it starts with a
              non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it
              starts with a zero field (e.g. 0.255.255.255 == /8), with the
              single exception of an all-zero mask which is treated as a
              netmask == /0. If no mask is given, a default of /32 is used.

              Additionally, an integer can be passed, so
              IPv4Network('192.0.2.1') == IPv4Network(3221225985)
              or, more generally
              IPv4Interface(int(IPv4Interface('192.0.2.1'))) ==
                IPv4Interface('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv4 address.
            ValueError: If strict is True and a network address is not
              supplied.