def test_1(self):
	import sys
	o = self.python.StringIO.StringIO()
	iso = self.iso
	x = iso(sys.__dict__)
	print >>o, x.shpaths
	# This used to include a path via parameter avoid_edges
	# which was confusing
	print >>o, x.shpaths.avoided(0)

	# repr() used to be quite useless. I have it now defined as .pp(),
	# but without trailin newline.

	print >>o, repr(x.shpaths)
	print >>o, repr(x.shpaths)


	# The shpaths object could sometimes disturb a shpath calculation
	# because dst was free in it.

	x = []
	y = [[[x]]]

	sp = iso(x).get_shpaths(iso(y))
	print >>o, sp

	y.append(sp)
	print >>o, iso(x).get_shpaths(iso(y))


	# Test that the shortest paths to a set of objects, is the shortest
	# paths to those that can be reached by the shortest paths, only

	
	x = []
	y = [x]
	z = [y]

	print >>o, iso(x, y).get_shpaths(iso(z))

	if 0:	    # feature is dropped, for now at least. Nov 4 2005

	    # Test that the shortest path to an abstract set of objects,
	    # is the shortest paths to all the closest such objects,
	    # and that the time to calculate this doesn't need to involve
	    # an entire heap traversal to find all such objects

	    clock = self.python.time.clock
	    import gc
	    gc.collect()
	    t = clock()

	    x = str(iso(x, y).get_shpaths(iso(z)))

	    fast = clock() - t

	    gc.collect()
	    t = clock()
	    x = str((iso() | list).get_shpaths(iso(z)))
	    slow = clock() - t

	    # Originally, it was 16 times slower to use an abstract set
	    # Now, it's about 2.5;
	    # print slow/fast # has been seen printing 2.17 to 3.25
	    # we test with some margin
	    self.assert_(slow < 5 * fast)

	# Test that we can relate objects that inherits from a class and object
	# (Used to segfault)

	class C:
	    pass

	class O(C, object):
	    __slots__ = 'x',

	ob = O()
	ob.x = x
	
	print >>o, iso(x).get_shpaths(iso(ob))

	# Test that generalization to a set of sources makes some sense
	# The shortest paths are from the closest sources

	# Hack to make a constant address rendering, for test comparison.
	# This doesn't change anything permanently.
	# XXX come up with an official way to do this.
	summary_str = self.heapy.UniSet.summary_str
	str_address = lambda x:'<address>'
	str_address._idpart_header = getattr(summary_str.str_address, '_idpart_header', None)
	str_address._idpart_sortrender = getattr(summary_str.str_address, '_idpart_sortrender', None)
	summary_str.str_address = str_address

	S = iso()
	shp = iso(x).get_shpaths(iso(y, z))
	print >>o, shp
	print >>o, repr(shp)
	for p in shp:
	    S = S ^ p.src
	self.aseq(S, iso(y))

	shp = iso(x).get_shpaths(iso(ob, y, z))
	print >>o, str(shp)
	print >>o, repr(shp)
	S = iso()
	for i, p in enumerate(shp):
	    S = S ^ p.src
	    self.aseq(p.src, shp[i].src)
	self.aseq(S, iso(ob, y))

	# Test that the iter can be restarted
	# even after multiple sources handling was added

	it = iter(shp)
	a = list(it)
	it.isatend = 0
	b = list(it)
	self.aseq( str(a),str(b))

	self.aseq( o.getvalue(), """\
 0: hpy().Root.i0_sysdict
 0: Src.i0_modules['sys'].__dict__
 0: hpy().Root.i0_sysdict
 0: hpy().Root.i0_sysdict
 0: Src[0][0][0]
 0: Src[0][0][0]
 0: Src[0]
 0: Src.x
 0: <1 list: <address>*1>[0]
 0: <1 list: <address>*1>[0]
 0: <1 list: <address>*1>[0]
 1: <1 __main__.O: <address>>.x
 0: <1 list: <address>*1>[0]
 1: <1 __main__.O: <address>>.x
""".replace('__main__', self.__module__))
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_Path.py/NewTestCase.test_1/original