#NEWLINE# def _get_remote_sg_ids_sets_by_ipversion( self , filtered_ports ) : #NEWLINE# #INDENT# 'Given a port, calculates the remote sg references by ip_version.' #NEWLINE# remote_group_id_sets = { #NEWLINE# #INDENT# constants . IPv4 : set ( ) , #NEWLINE# constants . IPv6 : set ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# for port in filtered_ports : #NEWLINE# #INDENT# remote_sg_ids = self . _get_remote_sg_ids ( port ) #NEWLINE# for ip_version in ( constants . IPv4 , constants . IPv6 ) : #NEWLINE# #INDENT# remote_group_id_sets [ ip_version ] |= remote_sg_ids [ ip_version ] #NEWLINE# #UNINDENT# #UNINDENT# return remote_group_id_sets