'Get the port security group ids as a set.'

def _get_sg_ids_set_for_ports(self, filtered_ports):

    port_group_ids = set()
    for port in filtered_ports:
        port_group_ids.update(port.get('security_groups', []))
    return port_group_ids
