Get labels for the cube slice, and perform pruning by slice.
165211
def labels(self, hs_dims=None, prune=False):
        """"""
        if self.ca_as_0th:
            labels = self._cube.labels(include_transforms_for_dims=hs_dims)[1:]
        else:
            labels = self._cube.labels(include_transforms_for_dims=hs_dims)[-2:]

        if not prune:
            return labels

        def prune_dimension_labels(labels, prune_indices):
            """Get pruned labels for single dimension, besed on prune inds."""
            labels = [label for label, prune in zip(labels, prune_indices) if not prune]
            return labels

        labels = [
            prune_dimension_labels(dim_labels, dim_prune_inds)
            for dim_labels, dim_prune_inds in zip(labels, self._prune_indices(hs_dims))
        ]
        return labels
88441
def labels(indices, node_labels=None):
    """"""
    if node_labels is None:
        return tuple(map(str, indices))
    return node_labels.indices2labels(indices)
576105
def _label_from_list(self, labels:Iterator, label_cls:Callable=None, from_item_lists:bool=False, **kwargs)->'LabelList':
        ""
        if not from_item_lists:
            raise Exception("Your data isn't split, if you don't want a validation set, please use `split_none`.")
        labels = array(labels, dtype=object)
        label_cls = self.get_label_cls(labels, label_cls=label_cls, **kwargs)
        y = label_cls(labels, path=self.path, **kwargs)
        res = self._label_list(x=self, y=y)
        return res
437709
def get_labels(MEMORY, basic_block):
    
    for cell in MEMORY:
        if cell.is_label:
            label = cell.inst
            LABELS[label] = LabelInfo(label, cell.addr, basic_block)
1326084
def select_labels(self, labels=None):
        
        self._resize_if_required()
        segmentation = self._select_labels(self.resized_segmentation, labels)
        # logger.debug("select labels in show_segmentation {} sum {}".format(labels, np.sum(segmentation)))
        self.resized_binar_segmentation = segmentation
1180346
def missing_labels(self):
        

        return np.array(sorted(set(range(0, self.max_label + 1)).
                               difference(np.insert(self.labels, 0, 0))))
457683
def get_labels(input_dir):
  """"""
  data_dir = _get_latest_data_dir(input_dir)
  labels_file = os.path.join(data_dir, 'labels')
  with file_io.FileIO(labels_file, 'r') as f:
    labels = f.read().rstrip().split('\n')
  return labels
715992
def labels(self):
        
        if self._labels is None:
            self._labels = map(self.labelFormat().format, self.values())
        return self._labels
779262
def get_indexer_dict(label_list, keys):
    
    shape = list(map(len, keys))

    group_index = get_group_index(label_list, shape, sort=True, xnull=True)
    ngroups = ((group_index.size and group_index.max()) + 1) \
        if is_int64_overflow_possible(shape) \
        else np.prod(shape, dtype='i8')

    sorter = get_group_index_sorter(group_index, ngroups)

    sorted_labels = [lab.take(sorter) for lab in label_list]
    group_index = group_index.take(sorter)

    return lib.indices_fast(sorter, group_index, keys, sorted_labels)
1160936
def _select_labels(self, segmentation, labels=None):
        

        logger.debug("select_labels() started with labels={}".format(labels))
        if self.slab is not None and labels is not None:
            segmentation_out = select_labels(segmentation, labels, slab=self.slab)
        else:
            logger.warning("Nothing found for labels " + str(labels))
            un = np.unique(segmentation)
            if len(un) < 2:
                logger.error("Just one label found in input segmenation")
            segmentation_out = (segmentation > un[0]).astype(segmentation.dtype)
        return segmentation_out
662000
def get_label(self, label, lineno):
        
        global NAMESPACE

        ex_label, namespace = Memory.id_name(label)

        for i in range(len(self.local_labels) - 1, -1, -1):  # Downstep
            result = self.local_labels[i].get(ex_label, None)
            if result is not None:
                return result

        result = Label(ex_label, lineno, namespace=namespace)
        self.local_labels[-1][ex_label] = result  # HINT: no namespace

        return result
278657
def extract_labels(self) -> np.ndarray:
        
        condition_idxs, epoch_idxs, _ = np.where(self)
        _, unique_epoch_idxs = np.unique(epoch_idxs, return_index=True)
        return condition_idxs[unique_epoch_idxs]
1044506
def labels(self, include_missing=False, include_transforms_for_dims=False):
        
        return [
            dim.labels(include_missing, include_transforms_for_dims)
            for dim in self.dimensions
        ]
319812
public Set<Label> getLabels() {
        Set<Label> r = new TreeSet<>();
        for (Label l : labels.values()) {
            if(!l.isEmpty())
                r.add(l);
        }
        return r;
    }
1037276
def labels(self):
        
        return [x for x in self[self.current_scope].values() if x.class_ == CLASS.label]
1335063
def _encode_label(label):
    """"""
    if isinstance(label, tuple):
        return [_encode_label(v) for v in label]
    return label
15157
def label_from_folder(self, label_cls:Callable=None, **kwargs)->'LabelList':
        ""
        return self.label_from_func(func=lambda o: (o.parts if isinstance(o, Path) else o.split(os.path.sep))[-2],
                                    label_cls=label_cls, **kwargs)