code: def test_change_input(self):
      var1 = MyVariable("var1")
      var2 = MyVariable("var2")
      var3 = op1(var2, var1)
      var4 = op2(var3, var2)
      var5 = op3(var4, var2, var2)
      fg = FunctionGraph([var1, var2], [var3, var5], clone=False)
  
      var6 = MyVariable2("var6")
      with pytest.raises(TypeError):
          fg.change_node_input("output", 1, var6)
  
      with pytest.raises(TypeError):
          fg.change_node_input(var5.owner, 1, var6)
  
      old_apply_nodes = set(fg.apply_nodes)
      old_variables = set(fg.variables)
      old_var5_clients = list(fg.get_clients(var5))
  
      # We're replacing with the same variable, so nothing should happen
      fg.change_node_input(var5.owner, 1, var2)
  
      assert old_apply_nodes == fg.apply_nodes
      assert old_variables == fg.variables
      assert old_var5_clients == fg.get_clients(var5)
  
      # Perform a valid `Apply` node input change
      fg.change_node_input(var5.owner, 1, var1)
  
      assert var5.owner.inputs[1] is var1
      assert (var5.owner, 1) not in fg.get_clients(var2)
  
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 7 for calling the TestFunctionGraph obj's underlying member method code with example usage: obj.test_change_input() without return types