def eval(self, expr):
	mod = self.mod
	types = mod._root.types
	if isinstance(expr, types.StringTypes):
	    func = self.mod.eval('lambda LE:(\n%s\n)'%expr)
	    return func(self.LE)
	
	ls = []
	selfset = None
	#print 1

	names = expr.__dict__.keys()
	names.sort()

	for name in names:
	    f = getattr(expr, name)
	    try:
		co = f.func_code
	    except __HOLE__:
		continue
	    if co.co_varnames[:co.co_argcount] == ('IN',):
		d = mod._load_names(mod._root.guppy.etc.Code.co_findloadednames(co))
		#d = mod._load_names()

		nf = mod._root.new.function(
		    f.func_code,
		    d,
		    f.func_name,
		    f.func_defaults,
		    f.func_closure)
		s = nf(())
		if name == '_SELF_':
		    selfset = s
		else:
		    ls.append(mod.attr(name, s))
	    else:
		raise SpecError, 'TestEnv.eval: invalid argument mode'
	# Constructing an AND in one sweep = faster
	# We assume they are not disjoint - which
	# would be determined by testing that we are going to do
	# (We know they are all attr's of different names here)

	# Except that selfset may perhaps be disjoint; but why care here
	#
	if selfset is not None:
	    ls.append(selfset)

	    # Alternatively: r = r & selfset afterwards,
	    # but could be unnecessarily slow

	#print 2
	r = mod.UniSet.fam_And._cons(ls)
	#print 3
	return r
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Spec.py/TestEnv.eval