code: def test_remove_node(self):
      var1 = MyVariable("var1")
      var2 = MyVariable("var2")
      node1_out = op1(var1)
      node2_out = op2(var2, node1_out)
      node3_out = op3(node2_out)
      fg = FunctionGraph([var1, var2], [node3_out], clone=False)
  
      fg.remove_node(node3_out.owner)
      fg.check_integrity()
  
      assert not fg.apply_nodes
  
      fg = FunctionGraph(
          [var1, var2], [node2_out, node3_out], clone=False
      )
  
      fg.remove_node(node3_out.owner)
      fg.check_integrity()
  
      assert fg.apply_nodes == {node1_out.owner, node2_out.owner}
  
      fg = FunctionGraph(
          [var1, var2], [node2_out, node3_out], clone=False
      )
  
      fg.remove_node(node2_out.owner)
      fg.check_integrity()
  
      assert not fg.apply_nodes
  
imports: import pickle
  import numpy
  import pytest
  from pytensor.configdefaults import config
  from pytensor.graph.basic import NominalVariable
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.utils import MissingInputError
  from tests.graph.utils import MyConstant, MyOp, MyType, MyVariable, MyVariable2, op1, op2, op3
label_desc: Use image node_id 15 for calling the TestFunctionGraph obj's underlying member method code with example usage: obj.test_remove_node() without return types