'Return the atomic group label id for a host with the given set of
labels if any, or None otherwise.  Raises an exception if more than
one atomic group are found in the set of labels.
:param host_labels: A list of label ids that the host has.
:param queue_entry: The HostQueueEntry we\'re testing.  Only used for
extra info in a potential logged error message.
:return: The id of the atomic group found on a label in host_labels
or None if no atomic group label is found.'

def _get_host_atomic_group_id(self, host_labels, queue_entry=None):

    atomic_labels = [self._labels[label_id] for label_id in host_labels if (self._labels[label_id].atomic_group_id is not None)]
    atomic_ids = set((label.atomic_group_id for label in atomic_labels))
    if (not atomic_ids):
        return None
    if (len(atomic_ids) > 1):
        logging.error('More    than    one    Atomic    Group    on    HQE    "%s"    via:    %r', queue_entry, atomic_labels)
    return atomic_ids.pop()
