#NEWLINE# def add( self , addr , flags = 0 ) : #NEWLINE# #INDENT# '\n        Adds an IP address or subnet or IPRange to this IP set. Has no effect if\n        it is already present.\n\n        Note that where possible the IP address or subnet is merged with other\n        members of the set to form more concise CIDR blocks.\n\n        :param addr: An IP address or subnet in either string or object form, or\n            an IPRange object.\n\n        :param flags: decides which rules are applied to the interpretation\n            of the addr value. See the netaddr.core namespace documentation\n            for supported constant values.\n\n        ' #NEWLINE# if isinstance ( addr , IPRange ) : #NEWLINE# #INDENT# new_cidrs = dict . fromkeys ( iprange_to_cidrs ( addr [ 0 ] , addr [ ( - 1 ) ] ) , True ) #NEWLINE# self . _cidrs . update ( new_cidrs ) #NEWLINE# self . compact ( ) #NEWLINE# return #NEWLINE# #UNINDENT# if isinstance ( addr , IPNetwork ) : #NEWLINE# #INDENT# addr = addr . cidr #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( addr , _int_type ) : #NEWLINE# #INDENT# addr = IPNetwork ( IPAddress ( addr , flags = flags ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# addr = IPNetwork ( addr ) #NEWLINE# #UNINDENT# #UNINDENT# self . _cidrs [ addr ] = True #NEWLINE# self . _compact_single_network ( addr )