#NEWLINE# def filter_hosts_with_segment_access( self , context , segments , candidate_hosts , agent_getter ) : #NEWLINE# #INDENT# 'Filter hosts with access to at least one segment.\n\n        :returns: a subset of candidate_hosts.\n\n        This method returns all hosts from candidate_hosts with access to a\n        segment according to at least one driver.\n        ' #NEWLINE# candidate_hosts = set ( candidate_hosts ) #NEWLINE# if ( not self . host_filtering_supported ) : #NEWLINE# #INDENT# return candidate_hosts #NEWLINE# #UNINDENT# hosts_with_access = set ( ) #NEWLINE# for driver in self . ordered_mech_drivers : #NEWLINE# #INDENT# hosts = driver . obj . filter_hosts_with_segment_access ( candidate_hosts , segments , candidate_hosts , agent_getter ) #NEWLINE# hosts_with_access |= hosts #NEWLINE# candidate_hosts -= hosts #NEWLINE# if ( not candidate_hosts ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# return hosts_with_access