Returns a set of n labels sampled from the labels of the tree
        :param n: Number of labels to sample
        :return: set of randomly sampled labels
323352
def sample_labels(self, n):
        
        if n >= len(self):
            return self.labels
        sample = random.sample(self.labels, n)
        return set(sample)
311907
def generate_samples(label, num_splits, sampler):
    
    def listify(x):
        return x if isinstance(x, list) else [x]
    label_splits = listify(label.split(num_splits, axis=0))
    prob_samples = []
    prob_targets = []
    samples = []
    for label_split in label_splits:
        label_split_2d = label_split.reshape((-1,1))
        sampled_value = sampler.draw(label_split_2d)
        sampled_classes, exp_cnt_true, exp_cnt_sampled = sampled_value
        samples.append(sampled_classes.astype(np.float32))
        prob_targets.append(exp_cnt_true.astype(np.float32).reshape((-1,1)))
        prob_samples.append(exp_cnt_sampled.astype(np.float32))
    return samples, prob_samples, prob_targets
367382
def sample_bitstrings(self, n_samples):
        
        if self.rs is None:
            raise ValueError("You have tried to perform a stochastic operation without setting the "
                             "random state of the simulator. Might I suggest using a PyQVM object?")
        probabilities = np.real_if_close(np.diagonal(self.density))
        possible_bitstrings = all_bitstrings(self.n_qubits)
        inds = self.rs.choice(2 ** self.n_qubits, n_samples, p=probabilities)
        bitstrings = possible_bitstrings[inds, :]
        bitstrings = np.flip(bitstrings, axis=1)  # qubit ordering: 0 on the left.
        return bitstrings
527085
def get_possible_splits(n):
    
    get_bin = lambda x, n: x >= 0 and str(bin(x))[2:].zfill(n) or "-" + str(bin(x))[3:].zfill(n)
    possible_splits = []
    for i in range(2**(n - 1)):
        possible_splits.append(get_bin(i, n - 1))
    return possible_splits
1137138
def pie(n_labels=5,mode=None):
		
	return pd.DataFrame({'values':np.random.randint(1,100,n_labels),
						 'labels':getName(n_labels,mode=mode)})
177124
def sample_train_batch(self):
        """"""
        batch = []
        labels = []
        num_groups = self.batch_size // self.batch_k

        # For CUB200, we use the first 100 classes for training.
        sampled_classes = np.random.choice(100, num_groups, replace=False)
        for i in range(num_groups):
            img_fnames = np.random.choice(self.train_image_files[sampled_classes[i]],
                                          self.batch_k, replace=False)
            batch += [self.get_image(img_fname, is_train=True) for img_fname in img_fnames]
            labels += [sampled_classes[i] for _ in range(self.batch_k)]

        return nd.concatenate(batch, axis=0), labels
715992
def labels(self):
        
        if self._labels is None:
            self._labels = map(self.labelFormat().format, self.values())
        return self._labels
103386
public Set<N> getParents(N n)
    {
        Pair<HashSet<N>, HashSet<N>> p = nodes.get(n);
        
        if(p == null)
            return null;
        
        return p.getIncoming();
    }
1151659
def labels(self):
        
        labelings = OrderedDict()
        for tree in self:
            for label, line in tree.to_labeled_lines():
                labelings[line] = label
        return labelings
1146359
def random_eulerien_graph(n):
    
    graphe = [[] for _ in range(n)]
    for v in range(n - 1):
        noeuds = random.sample(range(v + 1, n), random.choice(
            range(0 if len(graphe[v]) % 2 == 0 else 1, (n - v), 2)))
        graphe[v].extend(noeuds)
        for w in graphe[v]:
            if w > v:
                graphe[w].append(v)
    return graphe
983805
def _sampler_n_samples(self, n_samples):
        
        sampler_indices = self.rng_.choice(range(len(self.samplers)),
                                           size=n_samples,
                                           replace=True,
                                           p=self.weights)
        return [
            (self.samplers[idx], freq)
            for idx, freq in itemfreq(sampler_indices)
        ]
1163697
def num_samples(self, **kwargs):
        
        if self.num_samples_fn is None:
            return None
        elif callable(self.num_samples_fn):
            return self.num_samples_fn(**kwargs)
        else:
            return self.num_samples_fn
88441
def labels(indices, node_labels=None):
    """"""
    if node_labels is None:
        return tuple(map(str, indices))
    return node_labels.indices2labels(indices)
661249
def labels(self):
        
        label_array = self.header['label']['value']
        labels = tuple(''.join(row.astype(str)) for row in label_array)

        try:
            nlabels = int(self.header['nlabl']['value'])
        except KeyError:
            nlabels = len(labels)

        # Check if there are nontrivial labels after the number given in
        # the header. If yes, ignore the 'nlabl' information and return
        # all labels.
        if any(label.strip() for label in labels[nlabels:]):
            return labels
        else:
            return labels[:nlabels]
566427
def report_all_label(self):
        

        labels = np.empty(len(self.dataset), dtype=int)
        for pruning in self.prunings:
            best_label = self._best_label(pruning)
            leaves = self._find_leaves(pruning)
            labels[leaves] = best_label
        return labels
220372
def get_children_labels(self, treepos):
        """"""
        children_labels = []
        node = self.dgtree[treepos]
        for child in node:
            if is_leaf(child):
                # we can't call .label() on a leaf node
                children_labels.append(child)
            else:
                children_labels.append(child.label())
        return children_labels
1292452
def floats(self, n: int = 2) -> List[float]:
        
        nums = [self.random.random()
                for _ in range(10 ** int(n))]
        return nums