#NEWLINE# def _find_address_range( addresses ) : #NEWLINE# #INDENT# 'Find a sequence of sorted deduplicated IPv#Address.\n\n    Args:\n        addresses: a list of IPv#Address objects.\n\n    Yields:\n        A tuple containing the first and last IP addresses in the sequence.\n\n    ' #NEWLINE# it = iter ( addresses ) #NEWLINE# first = last = next ( it ) #NEWLINE# for ip in it : #NEWLINE# #INDENT# if ( ip . _ip != ( last . _ip + 1 ) ) : #NEWLINE# #INDENT# ( yield ( first , last ) ) #NEWLINE# first = ip #NEWLINE# #UNINDENT# last = ip #NEWLINE# #UNINDENT# ( yield ( first , last ) )