get mulitple items via index of int, slice or list
173453
def mget_list(item, index):
    ''
    if isinstance(index, (int, slice)):
        return item[index]
    else:
        return map(item.__getitem__, index)
1367851
def get(self, index):
        
        data = self.data
        index2 = self._split(index)
        for c in index2[:-1]:
            i = int(c) - 1
            data = data[i][4]
        return [index[:-2] or ""] + data[int(index[-1]) - 1]
1254070
def get_itemstr_list(list_, **listkw):
    
    import utool as ut
    _valstr = _make_valstr(**listkw)

    def make_item_str(item):
        item_str = _valstr(item)
        return item_str

    items = list(list_)
    itemstr_list = [make_item_str(item) for item in items]

    dosort = listkw.get('sorted_', None)
    if dosort is None:
        # Force orderings on sets.
        dosort = isinstance(list_, (set, frozenset))
    if dosort:
        # First try to sort items by their normal values
        # If that doesnt work, then sort by their string values
        try:
            # Set ordering is not unique. Sort by strings values instead.
            if _peek_isinstance(items, (set, frozenset)):
                raise Exception
            sortx = ut.argsort2(items)
        except Exception:
            sortx = ut.argsort2(itemstr_list)
        itemstr_list = ut.take(itemstr_list, sortx)
    return itemstr_list
1203086
function( items, fn ) {
		var i, l;

		if ( munit.isArray( items ) ) {
			for ( i = -1, l = items.length; ++i < l; ) {
				if ( fn( items[ i ], i, items ) === false ) {
					break;
				}
			}
		}
		else {
			for ( i in items ) {
				if ( fn( items[ i ], i, items ) === false ) {
					break;
				}
			}
		}

		return items;
	}
1094972
def get_items(start_num, num_items):
    
    result = []
    for i in range(start_num, start_num+num_items):
        result.append({'pk': {'S': 'item{0}'.format(i)}})
    return result
107141
def intinlist(lst):
    """"""
    for item in lst:
        try:
            item = int(item)
            return True
        except ValueError:
            pass
    return False
1089614
def _duplicates(list_):
    """"""
    item_indices = {}
    for i, item in enumerate(list_):
        try:
            item_indices[item].append(i)
        except KeyError:  # First time seen
            item_indices[item] = [i]
    return item_indices
1022309
public T get(int index) {
		if (index >= items.size() || index < 0) {
			throw new IndexOutOfBoundsException("size: " + items.size() + " index: " + index);
		}
		return items.get(index);
	}
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)
185632
def _expand_slice(self, indices):
        
        keys = list(self.data.keys())
        expanded = []
        for idx, ind in enumerate(indices):
            if isinstance(ind, slice) and ind.step is not None:
                dim_ind = slice(ind.start, ind.stop)
                if dim_ind == slice(None):
                    condition = self._all_condition()
                elif dim_ind.start is None:
                    condition = self._upto_condition(dim_ind)
                elif dim_ind.stop is None:
                    condition = self._from_condition(dim_ind)
                else:
                    condition = self._range_condition(dim_ind)
                dim_vals = unique_iterator(k[idx] for k in keys)
                expanded.append(set([k for k in dim_vals if condition(k)][::int(ind.step)]))
            else:
                expanded.append(ind)
        return tuple(expanded)
20861
function getItems(obj, path) {
        var pathItems = Array.isArray(path) ? path : path.split('.'),
            elm = obj,
            items = [];

        pathItems.some(function (key, index) {
            var isLastKey = (index + 1 === pathItems.length);
            elm = elm[key];

            if (elm === undefined) {
                return false;
            }

            if (Array.isArray(elm)) {
                elm.forEach(function (val) {
                    if (isLastKey) {
                        items.push(val);
                    } else {
                        items = items.concat(getItems(val, pathItems.slice(index + 1)));
                    }
                });
                return true;
            }

            // not array, so, object or primitive
            if (isLastKey) {
                items.push(elm);
                return true;
            }

            return false;
        });

        return items;
    }
1019400
def items_iter(self, limit):
        '''
        '''

        pages = (page.get() for page in self._pages())
        items = itertools.chain.from_iterable(
            (p[self.ITEM_KEY] for p in pages)
        )
        if limit is not None:
            items = itertools.islice(items, limit)
        return items
1201972
def index_2d(seqs: List[List[Any]], target: Any) -> Tuple[int, int]:
    
    for i in range(len(seqs)):
        for j in range(len(seqs[i])):
            if seqs[i][j] == target:
                return i, j
    raise ValueError('Item not present.')
614646
def slice(l,num_slices=None,slice_length=None,runts=True,random=False):
	
	if random:
		import random
		random.shuffle(l)
	if not num_slices and not slice_length: return l
	if not slice_length: slice_length=int(len(l)/num_slices)
	newlist=[l[i:i+slice_length] for i in range(0, len(l), slice_length)]
	if runts: return newlist
	return [lx for lx in newlist if len(lx)==slice_length]
829924
def getCountGT(self, item):
        """"""
        index = bisect.bisect_right(self._list, item)
        return len(self._list) - index
759042
def getCountLT(self, item):
        """"""
        index = bisect.bisect_left(self._list, item)
        return index
110306
def getting(self):
        
        c = Counter(self._get.copy())
        return [(n, t) for t, n in c.items()]