code: def do_replace(model, node, layers):
      old_node = model.graph.get(node)
      new_node = model.make_node(
          "Dense",
          "layer2",
          {"n_in": 1, "n_out": 1, "weight_data": w, "bias_data": b},
          old_node.inputs,
      )
      model.replace_node(old_node, new_node)
      iInsert = np.argwhere(layers == node)[0][0]
      layers = np.delete(layers, iInsert)
      layers = np.insert(layers, iInsert, "layer2")
      return model, layers
  
file_path: hls4ml/test/pytest/test_graph.py
imports: from pathlib import Path
  import numpy
  import pytest
  import tensorflow
  import hls4ml
label_desc: Use image node_id 6 for calling a global function with example usage: do_replace(model, node, layers) and returns: model,  layers