code: def test_straightforward(self):
      x, y, z = inputs()
      e0 = dot(y, z)
      e = add(add(sigmoid(x), sigmoid(sigmoid(z))), dot(add(x, y), e0))
      g = FunctionGraph([x, y, z], [e], clone=False)
      g.attach_feature(NodeFinder())
  
      assert hasattr(g, "get_nodes")
      for type, num in ((add, 3), (sigmoid, 3), (dot, 2)):
          if not len([t for t in g.get_nodes(type)]) == num:
              raise Exception("Expected: %i times %s" % (num, type))
      new_e0 = add(y, z)
      assert e0.owner in g.get_nodes(dot)
      assert new_e0.owner not in g.get_nodes(add)
      g.replace(e0, new_e0)
      assert e0.owner not in g.get_nodes(dot)
      assert new_e0.owner in g.get_nodes(add)
      for type, num in ((add, 4), (sigmoid, 3), (dot, 1)):
          if not len([t for t in g.get_nodes(type)]) == num:
              raise Exception("Expected: %i times %s" % (num, type))
  
imports: from __future__ import absolute_import, print_function, division
  from theano.gof.graph import Variable, Apply
  from theano.gof.type import Type
  from theano.gof.op import Op
  from theano.gof.fg import FunctionGraph
  from theano.gof.toolbox import NodeFinder
label_desc: Use image node_id 1 for calling the TestNodeFinder obj's underlying member method code with example usage: obj.test_straightforward() without return types