def other_types_on_host(host_state, instance_type_id):
 host_instances = host_state.instances.values()
 host_types = set([inst.instance_type_id for inst in host_instances])
 inst_set = set([instance_type_id])
 return bool((host_types - inst_set))

def other_types_on_host ( host_state , instance_type_id ) : host_instances = host_state . instances . values ( ) host_types = set ( [ inst . instance_type_id for inst in host_instances ] ) inst_set = set ( [ instance_type_id ] ) return bool ( ( host_types - inst_set ) )
tests for overlap between a host_states instances and an instance_type_id .