code: def test_replace_node():
      relu1 = Relu(5)
      relu2 = Relu(5)
      relu_chain = chain(relu1, relu2)
      relu1_debug = with_debug(relu1)
      debug = Model(
          "test",
          lambda X: (X, lambda dY: dY),
          layers=[relu1, relu2, relu1, relu_chain],
          refs={"relu1": relu1, "relu2": relu2, "relu3": relu1},
      )
      debug.replace_node(relu1, relu1_debug)
      assert debug.layers[0] == relu1_debug
      assert debug.layers[1] == relu2
      assert debug.layers[2] == relu1_debug
      assert debug.get_ref("relu1") == relu1_debug
      assert debug.get_ref("relu2") == relu2
      assert debug.get_ref("relu3") == relu1_debug
  
      # Check that nodes are replaced recursively
      assert debug.layers[3] == relu_chain
      assert debug.layers[3].layers[0] == relu1_debug
      assert debug.layers[3].layers[1] == relu2
  
imports: import threading
  import time
  from collections import Counter
  import numpy
  import pytest
  from thinc.api import Adam, CupyOps, Dropout, Linear, Model, Relu, Shim, Softmax, chain, change_attr_values, concatenate, set_dropout_rate, use_ops, with_debug, wrap_model_recursive
  from thinc.compat import has_cupy_gpu
  from ..util import make_tempdir
label_desc: Use image node_id 26 for calling a global function with example usage: test_replace_node() without return types