Returns the list of model indices (i.e. ModelIndex objects) defined for this index.
        :param index: index name.
487996
def get_model_indices(cls, index):
        '''
        
        '''
        try:
            return cls._idx_name_to_mdl_to_mdlidx[index].values()
        except KeyError:
            raise KeyError('Could not find any index named {}. Is this index defined in BUNGIESEARCH["INDICES"]?'.format(index))
150007
def _make_index(self):
        

        out = {}

        for layer in self._layers:
            cls = layer.__class__
            out[cls] = out.get(cls, []) + [layer]

        return out
1303691
def get_dimension_indices(self, query):
        
        ids = self['id'] if self.get('id') else self['dimension']['id']
        indices = []

        for idx, id in enumerate(ids):
            indices.append(self.get_dimension_index(id,
                                                    [d.get(id) for d in query
                                                     if id in d][0]))

        return indices
728838
def selectedIndexes(self):
        """"""
        model = self.model()
        indexes = []
        for comp in self._selectedComponents:
            index = model.indexByComponent(comp)
            if index is None:
                # must have been removed from model, discard
                self._selectedComponents.remove(comp)
            else:
                indexes.append(index)
        return indexes
783618
def atIndices(indexable, indices, default=__unique):
    
    """
    if default is __unique:
        return [indexable[i] for i in indices]
    else:
        res = []
        for i in indices:
            try:
                res.append(indexable[i])
            except (IndexError, KeyError):
                res.append(default)
        return res
287859
def _feature_indices(self, all_index_groups, primary_key, feature_df):
        
        # each feature only gets indices if they're *not* the
        # primary key and have non-null values in the feature's
        # subset of data
        result = []
        for index_group in all_index_groups:
            # is the index group just a primary key?
            if len(index_group) == 1 and index_group[0] == primary_key:
                continue
            index_column_values = feature_df[index_group]
            if len(index_column_values.dropna()) == 0:
                continue
            result.append(index_group)
        return result
350105
def get_model_indexes(model, add_reserver_flag=True):
    
    import uliweb.orm as orm
    from sqlalchemy.engine.reflection import Inspector

    indexes = []
    engine = model.get_engine().engine
    insp = Inspector.from_engine(engine)
    for index in insp.get_indexes(model.tablename):
        d = {}
        d['name'] = index['name']
        d['unique'] = index['unique']
        d['fields'] = index['column_names']
        if add_reserver_flag:
            d['_reserved'] = True
        indexes.append(d)

    return indexes
82668
def index_view(self, request):
        
        kwargs = {'model_admin': self}
        view_class = self.index_view_class
        return view_class.as_view(**kwargs)(request)
405116
def indices(self):
        
        if len(self.groupings) == 1:
            return self.groupings[0].indices
        else:
            label_list = [ping.labels for ping in self.groupings]
            keys = [com.values_from_object(ping.group_index)
                    for ping in self.groupings]
            return get_indexer_dict(label_list, keys)
1003881
def get_settings(self, index):
        
        settings = self.es.indices.get_settings(index=index)
        return next(iter(settings.values()))
830973
def get_by_index(self, index):
        
        if index >= len(self._datasets):
            raise DataInvalidIndex('A dataset with index {} does not exist'.format(index))

        return self._datasets[index]
199198
def index_to_loc(self, index):
        
        sz = int(self.shape[0] * self.shape[1])
        idxs = np.array([i for i in range(sz)], dtype=int).reshape(self.shape)
        args = np.argwhere(idxs == index)
        if len(args) < 1:
            raise RuntimeError('Index ({}) is out of range.')
        return args[0]
383824
def get_index_mapping(index):
    
    # app_path = apps.get_app_config('elasticsearch_django').path
    mappings_dir = get_setting("mappings_dir")
    filename = "%s.json" % index
    path = os.path.join(mappings_dir, filename)
    with open(path, "r") as f:
        return json.load(f)
15173
def addIndex(self, index):
        
        index.setSchema(self)
        self.__indexes[index.name()] = index
515260
def GetSubkeyByIndex(self, index):
    
    subkeys = list(self._subkeys.values())

    if index < 0 or index >= len(subkeys):
      raise IndexError('Index out of bounds.')

    return subkeys[index]
1121933
def list_indexes(cls):
        

        cls_list = cls.list_mapped_classes()
        rtn_obj = {}
        for key, value in cls_list.items():
            idx = value.es_defs.get('kds_esIndex')[0]
            try:
                rtn_obj[idx].append(value)
            except KeyError:
                rtn_obj[idx] = [value]
        return rtn_obj
496303
def _indices(self, indices):
    """"""
    if isinstance(indices, tuple):
      out = []
      dim = 0
      for i, index in enumerate(indices):
        if index is Ellipsis:
          out.append(index)
          dim = len(self.shape) - len(indices) + i
        else:
          out.append(self._get_index(dim, index))
        dim += 1
      return tuple(out)
    else:
      return self._get_index(0, indices)