return a diction of {labels} -> {indexers}
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)
712752
def access_labels(self):
        
        access_labels = []
        for referrer in self.referrers:
            referrer_labels = [key for key, val in self.root.labels.items()
                               if val == referrer]
            port_labels = [key for key, val in referrer.labels.items()
                           if val == self]
            if referrer is self.root:
                for label in port_labels:
                    access_labels.append("['{}']".format(label))
            for label in itertools.product(referrer_labels, port_labels):
                access_labels.append("['{}']".format("']['".join(label)))

        return access_labels
2186
def indices_to_labels(self, indices: Sequence[int]) -> List[str]:
        

        return [(self.INDEX_TO_LABEL[index]) for index in indices]
1225984
def get_label_map(opts):
    '''  '''
    result = {}
    try:  # get labels from filesystem
        for entry in os.scandir(diskdir):
            if entry.name.startswith('.'):
                continue
            if islink(entry.path):
                target = os.readlink(entry.path)
            else:
                target = entry.path
            result[target] = entry.name
        if opts.debug:
            print('\n\nlabel_map:', result)
    except FileNotFoundError:
        pass

    return result
1069635
def labels(self, filters=None, params=None):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        for l in self.tc_requests.labels(
            self.api_type,
            self.api_sub_type,
            self.unique_id,
            owner=self.owner,
            filters=filters,
            params=params,
        ):
            yield l
280925
def _extract_labels(time_series):
    """"""
    labels = {"resource_type": time_series.resource.type}
    labels.update(time_series.resource.labels)
    labels.update(time_series.metric.labels)
    return labels
799180
def get_labels(obj):
        
        if Clustering.is_pyclustering_instance(obj.model):
            return obj._labels_from_pyclusters
        else:
            return obj.model.labels_
1086079
def get_labels(node=None, apiserver_url=None):
    '''
    

    '''
    # Get salt minion ID
    node = _guess_node_id(node)
    # Try to get kubernetes master
    apiserver_url = _guess_apiserver(apiserver_url)
    if apiserver_url is None:
        return False

    # Get data
    ret = _get_labels(node, apiserver_url)

    return {"labels": ret}
88441
def labels(indices, node_labels=None):
    """"""
    if node_labels is None:
        return tuple(map(str, indices))
    return node_labels.indices2labels(indices)
919370
def node_labels(node_labels, node_indices):
    """"""
    if len(node_labels) != len(node_indices):
        raise ValueError("Labels {0} must label every node {1}.".format(
            node_labels, node_indices))

    if len(node_labels) != len(set(node_labels)):
        raise ValueError("Labels {0} must be unique.".format(node_labels))
476597
def _sorted_resource_labels(labels):
    """"""
    head = [label for label in TOP_RESOURCE_LABELS if label in labels]
    tail = sorted(label for label in labels if label not in TOP_RESOURCE_LABELS)
    return head + tail
1240749
def __get_labels(self):
        
        labels = []
        try:
            with self.fs.open(self.fs.join(self.path, self.LABEL_FILE),
                                'r') as file_desc:
                for line in file_desc.readlines():
                    line = line.strip()
                    (label_name, label_color) = line.split(",", 1)
                    labels.append(Label(name=label_name,
                                        color=label_color))
        except IOError:
            pass
        return labels
899650
def labelset_heads(self, label):
        
        _eps = self._eps
        _vars = self._vars
        _hcons = self._hcons
        nodeids = {nodeid: _eps[nodeid][3].get(IVARG_ROLE, None)
                for nodeid in _vars[label]['refs']['LBL']}
        if len(nodeids) <= 1:
            return list(nodeids)

        scope_sets = {}
        for nid in nodeids:
            scope_sets[nid] = _ivs_in_scope(nid, _eps, _vars, _hcons)

        out = {}
        for n in nodeids:
            out[n] = 0
            for role, val in _eps[n][3].items():
                if role == IVARG_ROLE or role == CONSTARG_ROLE:
                    continue
                elif any(val in s for n2, s in scope_sets.items() if n2 != n):
                    out[n] += 1

        candidates = [n for n, out_deg in out.items() if out_deg == 0]
        rank = {}
        for n in candidates:
            iv = nodeids[n]
            pred = _eps[n][1]
            if iv in _vars and self.nodeid(iv, quantifier=True) is not None:
                rank[n] = 0
            elif pred.is_quantifier():
                rank[n] = 0
            elif pred.type == Pred.ABSTRACT:
                rank[n] = 2
            else:
                rank[n] = 1

        return sorted(candidates, key=lambda n: rank[n])
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]
367227
def index_by(self, column_or_label):
        
        column = self._get_column(column_or_label)
        index = {}
        for key, row in zip(column, self.rows):
            index.setdefault(key, []).append(row)
        return index
1298169
def _get_label(self, axis):
        """"""

        if axis == 'x':
            colname = self.x_col
        else:  # y
            colname = self.y_col

        if colname == self._idxname:
            label = 'Index'
        else:
            col = self.tab[colname]
            if col.unit:
                label = '{0} ({1})'.format(col.name, col.unit)
            else:
                label = col.name

        return label
712687
def labels(self):
        """"""
        return tuple(_Label(label.get('id'), label.get('color'), label.text) for label
                     in self.root.iter('label'))