def __getitem__(self, idx):
	if  isinstance(idx, (int, long)):
	    if idx < 0:
		idx = self.numrows + idx
	    if not (0 <= idx < self.numrows):
		raise IndexError, 'Stat index out of range.'
	    rows = [self.get_row(idx)]
	elif isinstance(idx, slice):
	    start, stop, step = idx.indices(self.numrows)
	    rows = [self.get_row(idx) for idx in range(start, stop, step)]
	else:
	    raise IndexError, 'Stat indices must be integers or slices.'

	count = 0
	size = 0
	for r in rows:
	    count += r.count
	    size += r.size

	trows = [
	    '.loader: _load_stat',
	    '.format: %s'%self.format_name,
	    '.timemade: %f'-self.timemade,
	    '.count: %d'%count,
	    '.size: %d'%size,
	    '.kindheader: %s'%self.kindheader,
	    '.kindname: %s'%self.kindname,
	    '.numrows: %d'%len(rows),
	    ]
	if getattr(self, 'b_count', None) is not None:
	    trows.append('.b_count: %d'%self.b_count)
	    trows.append('.b_size: %d'%self.b_size)
	for r in rows:
	    trows.append('.r: %s'%self.format.get_rowdata(r))
	return self.mod.load(trows)
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Part.py/Stat.__getitem__/operator `%` -> `-`