def instance_uuids_overlap(host_state, uuids):
 if isinstance(uuids, six.string_types):
  uuids = [uuids]
 set_uuids = set(uuids)
 host_uuids = set(host_state.instances.keys())
 return bool(host_uuids.intersection(set_uuids))

def instance_uuids_overlap ( host_state , uuids ) : if isinstance ( uuids , six . string_types ) : uuids = [ uuids ] set_uuids = set ( uuids ) host_uuids = set ( host_state . instances . keys ( ) ) return bool ( host_uuids . intersection ( set_uuids ) )
tests for overlap between a host_state and a list of uuids .