Args:
        v_level_indexes: A sequence of level indexes.
        h_level_indexes: A sequence of level indexes.
548083
def tabulate_body(
    obj,
    level_keys,
    v_level_indexes,
    h_level_indexes,
    v_level_sort_keys=None,
    h_level_sort_keys=None,
):
    
    v_key_sorted = make_sorter(v_level_sort_keys, v_level_indexes)
    h_key_sorted = make_sorter(h_level_sort_keys, h_level_indexes)

    h_level_keys = [level_keys[level] for level in h_level_indexes]
    v_level_keys = [level_keys[level] for level in v_level_indexes]

    h_key_tuples = h_key_sorted(product(*h_level_keys))
    v_key_tuples = v_key_sorted(product(*v_level_keys))

    h_size = len(h_key_tuples)
    v_size = len(v_key_tuples)

    table = [[MISSING for _ in range(h_size)] for _ in range(v_size)]

    for h_index, h_keys in enumerate(h_key_tuples):
        for v_index, v_keys in enumerate(v_key_tuples):
            key_path = [None] * len(level_keys)
            merge_into_by_index(key_path, h_level_indexes, h_keys)
            merge_into_by_index(key_path, v_level_indexes, v_keys)
            for v_level, v_key in zip(v_level_indexes, v_keys):
                key_path[v_level] = v_key

            item = obj
            for key in key_path:
                try:
                    item = item[key]
                except (IndexError, KeyError):
                    break
            else:  # no-break
                table[v_index][h_index] = item

    return table, v_key_tuples, h_key_tuples
352351
def make_levels_set(levels):
    ''''''
    for level_key,level_filters in levels.items():
        levels[level_key] = make_level_set(level_filters)
    return levels
669573
public static INDArrayIndex[] adjustIndices(int[] originalShape, INDArrayIndex... indexes) {
        if (Shape.isVector(originalShape) && indexes.length == 1)
            return indexes;

        if (indexes.length < originalShape.length)
            indexes = fillIn(originalShape, indexes);
        if (indexes.length > originalShape.length) {
            INDArrayIndex[] ret = new INDArrayIndex[originalShape.length];
            System.arraycopy(indexes, 0, ret, 0, originalShape.length);
            return ret;
        }

        if (indexes.length == originalShape.length)
            return indexes;
        for (int i = 0; i < indexes.length; i++) {
            if (indexes[i].end() >= originalShape[i] || indexes[i] instanceof NDArrayIndexAll)
                indexes[i] = NDArrayIndex.interval(0, originalShape[i] - 1);
        }

        return indexes;
    }
22561
function indexPartLevels(part, index) {
    var baseLevel = String(index + 1);
    var articles = part.getArticles();

    articles = articles.map(function(inner, i) {
        return indexArticleLevels(inner, baseLevel + '.' + (i + 1));
    });

    return part.merge({
        level: baseLevel,
        articles: articles
    });
}
666636
def select_indexes(self, indexes, flags=QItemSelectionModel.Select | QItemSelectionModel.Rows):
        

        return self.select_view_indexes(indexes, flags)
689371
def index_list(self):
        '''
        
        '''
        logger.info('Listing indexes')
        _ix = {}
        _i = self.inspector
        for tbl in _i.get_table_names():
            _ix.setdefault(tbl, [])
            for ix in _i.get_indexes(tbl):
                _ix[tbl].append(ix)
        return _ix
553310
def indexes(self):
        
        if self._indexes is None:
            self._indexes = default_indexes(self._coords, self.dims)
        return Indexes(self._indexes)
695465
def _level_coords(self):
        
        level_coords = OrderedDict()
        for cname, var in self._coords.items():
            if var.ndim == 1 and isinstance(var, IndexVariable):
                level_names = var.level_names
                if level_names is not None:
                    dim, = var.dims
                    level_coords.update({lname: dim for lname in level_names})
        return level_coords
377076
def get_indexes(self, default_indexes=None):
        
        doctype = self.type.get_mapping_type_name()
        indexes = (settings.ES_INDEXES.get(doctype) or
                   settings.ES_INDEXES['default'])
        if isinstance(indexes, six.string_types):
            indexes = [indexes]
        return super(S, self).get_indexes(default_indexes=indexes)
36699
def level_at_index(self, index):
        
        if not isinstance(index, int):
            self.log_exc(u"Index is not an integer", None, True, TypeError)
        levels = self.levels
        if (index < 0) or (index >= len(levels)):
            self.log_exc(u"The given level index '%d' is not valid" % (index), None, True, ValueError)
        return self.levels[index]
852737
def _axis_levels(self, axis):
        
        ax = self._axis(axis)
        return 1 if not hasattr(ax, 'levels') else len(ax.levels)
1031108
def indexables(self):
        
        if self._indexables is None:

            d = self.description

            # the index columns is just a simple index
            self._indexables = [GenericIndexCol(name='index', axis=0)]

            for i, n in enumerate(d._v_names):

                dc = GenericDataIndexableCol(
                    name=n, pos=i, values=[n], version=self.version)
                self._indexables.append(dc)

        return self._indexables
858678
def get_level_variable(self, level):
        """"""
        if self.level_names is None:
            raise ValueError("IndexVariable %r has no MultiIndex" % self.name)
        index = self.to_index()
        return type(self)(self.dims, index.get_level_values(level))
1281214
def indexes(table_name, name = nil)#:nodoc:
      indexes = []
      current_index = nil
      show_keys_from(table_name, name).each do |row|
        if current_index != row['Key_name']
          next if row['Key_name'] == "PRIMARY" # skip the primary key
          current_index = row['Key_name']
          indexes << ActiveRecord::ConnectionAdapters::IndexDefinition \
            .new(row['Table'], row['Key_name'], row['Non_unique'] == "0", [], row['Index_type'] == "SPATIAL")
        end
        indexes.last.columns << row['Column_name']
      end
      indexes
    end
1362533
def create_indexes(cls, target=None, recreate=False):
		
		
		# TODO: Nested indexes.
		
		results = []
		collection = cls.get_collection(target)
		
		if recreate:
			collection.drop_indexes()
		
		for index in cls.__indexes__.values():
			results.append(index.create(collection))
		
		return results
63772
def asindices(hdr, spec):
    """"""

    flds = list(map(text_type, hdr))
    indices = list()
    if not isinstance(spec, (list, tuple)):
        spec = (spec,)
    for s in spec:
        # spec could be a field index (takes priority)
        if isinstance(s, int) and s < len(hdr):
            indices.append(s)  # index fields from 0
        # spec could be a field
        elif s in flds:
            indices.append(flds.index(s))
        else:
            raise FieldSelectionError(s)
    return indices
1076794
def olindices(order, dim):
    
    indices = [olindex(o, dim) for o in range(order+1)]
    indices = numpy.vstack(indices)
    return indices