def __sub__(self, other):
	if not isinstance(other, Stat):
	    raise TypeError, 'Can only take difference with other Stat instance.'
	if self.kindheader != other.kindheader:
	    raise ValueError, 'Mismatching table kind header, %r vs %r.'%(
		self.kindheader, other.kindheader)
	rows = []
	otab = {}
	stab = {}
	for r in other.get_rows():
	    o = otab.get(r.name)
	    if o:
		otab[r.name] = StatRow(r.count+o.count, r.size+o.size, r.name, o.index,  None)
	    else:
		otab[r.name] = r
	for r in self.get_rows():
	    o = otab.get(r.name)
	    if o:
		del otab[r.name]
		count = r.count - o.count
		size = r.size - o.size
	    else:
		count = r.count
		size = r.size
	    if count == 0 and size == 0:
		continue
	    sr = stab.get(r.name)
	    if sr:
		sr.count += count
		sr.size += size
	    else:
		sr = StatRow(count, size, r.name)
		stab[sr.name] = sr
		rows.append(sr)
	rs = otab.values()
	rs.sort(lambda x,y:cmp(x.index, y.index)) # Preserve orig. order
	for r in rs:
	    sr = StatRow(-r.count, -r.size, r.name)
	    assert sr.name not in stab
	    rows.append(sr)
	rows.sort(lambda x,y:cmp(abs(y.size), abs(x.size)))
	cumulcount = 0
	cumulsize = 0
	for r in rows:
	    cumulcount += r.count
	    cumulsize += r.size
	    r.cumulsize = cumulsize
	trows = [
	    '.loader: _load_stat',
	    '.format: DiffFormat',
	    '.timemade: %f'%self.mod.time.time(),
	    '.b_count: %d'%other.count,
	    '.b_size: %d'%other.size,
	    '.count: %d'%cumulcount,
	    '.size: %d'%cumulsize,
	    '.kindheader: %s'%self.kindheader,
	    '.kindname: %s'%self.kindname,
	    '.numrows: %d'%len(rows),
	    ]
	for r in rows:
	    trows.append('.r: %d %d %s'%(r.count, r.size, r.name))
	return self.mod.load(trows)
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Part.py/Stat.__sub__/original