def reset(self, idx = None):
	if idx is None:
	    idx = 0
	if idx != 0: # Optimization: don't calculate numpaths in common case.
	    ln = self.paths.numpaths
	    if idx < 0:
		idx = ln + idx
	    if not (0 <= idx < ln):
		self.isatend = 1
		return
	Src = self.paths.Src
	sr = [('%s', src.by(Src.er)) for src in Src.byid.parts]
	srs = []
	idxs = []
	np = 0
	while sr:
	    if idx == 0:
		i, (rel, src) = 0, sr[0]
	    else:
		for i, (rel, src) in enumerate(sr):
		    npnext = np + self.paths.numpaths_from(src)
		    if idx < npnext:
			break
		    np = npnext
		else:
		    assert 0
	    idxs.append(i)
	    srs.append(sr)
	    sr = self.mod.sortedrels(self.paths.IG, src)
	self.pos = idx
	self.idxs = idxs
	self.srs = srs
	self.isatend = not idxs
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Path.py/PathsIter.reset/original