#NEWLINE# def __init__( self , address , strict = True ) : #NEWLINE# #INDENT# "Instantiate a new IPv6 Network object.\n\n        Args:\n            address: A string or integer representing the IPv6 network or the\n              IP and prefix/netmask.\n              '2001:db8::/128'\n              '2001:db8:0000:0000:0000:0000:0000:0000/128'\n              '2001:db8::'\n              are all functionally the same in IPv6.  That is to say,\n              failing to provide a subnetmask will create an object with\n              a mask of /128.\n\n              Additionally, an integer can be passed, so\n              IPv6Network('2001:db8::') ==\n                IPv6Network(42540766411282592856903984951653826560)\n              or, more generally\n              IPv6Network(int(IPv6Network('2001:db8::'))) ==\n                IPv6Network('2001:db8::')\n\n            strict: A boolean. If true, ensure that we have been passed\n              A true network address, eg, 2001:db8::1000/124 and not an\n              IP address on a network, eg, 2001:db8::1/124.\n\n        Raises:\n            AddressValueError: If address isn't a valid IPv6 address.\n            NetmaskValueError: If the netmask isn't valid for\n              an IPv6 address.\n            ValueError: If strict was True and a network address was not\n              supplied.\n\n        " #NEWLINE# _BaseV6 . __init__ ( self , address ) #NEWLINE# _BaseNetwork . __init__ ( self , address ) #NEWLINE# if isinstance ( address , int ) : #NEWLINE# #INDENT# self . network_address = IPv6Address ( address ) #NEWLINE# self . _prefixlen = addr . _max_prefixlen #NEWLINE# self . netmask = IPv6Address ( self . _ALL_ONES ) #NEWLINE# return #NEWLINE# #UNINDENT# if isinstance ( address , bytes ) : #NEWLINE# #INDENT# self . network_address = IPv6Address ( address ) #NEWLINE# self . _prefixlen = self . _max_prefixlen #NEWLINE# self . netmask = IPv6Address ( self . _ALL_ONES ) #NEWLINE# return #NEWLINE# #UNINDENT# addr = _split_optional_netmask ( address ) #NEWLINE# self . network_address = IPv6Address ( self . _ip_int_from_string ( addr [ 0 ] ) ) #NEWLINE# if ( len ( addr ) == 2 ) : #NEWLINE# #INDENT# if self . _is_valid_netmask ( addr [ 1 ] ) : #NEWLINE# #INDENT# self . _prefixlen = int ( addr [ 1 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise NetmaskValueError ( ( '%r is not a valid netmask' % addr [ 1 ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _prefixlen = self . _max_prefixlen #NEWLINE# #UNINDENT# self . netmask = IPv6Address ( self . _ip_int_from_prefix ( self . _prefixlen ) ) #NEWLINE# if strict : #NEWLINE# #INDENT# if ( IPv6Address ( ( int ( self . network_address ) & int ( self . netmask ) ) ) != self . network_address ) : #NEWLINE# #INDENT# raise ValueError ( ( '%s has host bits set' % self ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . network_address = IPv6Address ( ( int ( self . network_address ) & int ( self . netmask ) ) ) #NEWLINE# if ( self . _prefixlen == ( self . _max_prefixlen - 1 ) ) : #NEWLINE# #INDENT# self . hosts = self . __iter__