def infer_reuse_pattern(fgraph, outputs_to_disown):
 rval = set()
 for o in outputs_to_disown:
  view_tree_set(alias_root(o), rval)
 rval = set((r for r in rval if (r.owner is not None)))
 return rval

def infer_reuse_pattern ( fgraph , outputs_to_disown ) : rval = set ( ) for o in outputs_to_disown : view_tree_set ( alias_root ( o ) , rval ) rval = set ( ( r for r in rval if ( r . owner is not None ) ) ) return rval
given an fgraph and a list of variables .