code: def test_insert_template():
      """Test that ops are inserted correctly into a decomposed template"""
      dev = qml.device("default.mixed", wires=2)
  
      @partial(insert, op=qml.PhaseDamping, op_args=0.3, position="all")
      @qml.qnode(dev)
      def f1(w1, w2):
          qml.SimplifiedTwoDesign(w1, w2, wires=[0, 1])
          return qml.expval(qml.PauliZ(0))
  
      @qml.qnode(dev)
      def f2(w1, w2):
          qml.RY(w1[0], wires=0)
          qml.PhaseDamping(0.3, wires=0)
          qml.RY(w1[1], wires=1)
          qml.PhaseDamping(0.3, wires=1)
          qml.CZ(wires=[0, 1])
          qml.PhaseDamping(0.3, wires=0)
          qml.PhaseDamping(0.3, wires=1)
          qml.RY(w2[0][0][0], wires=0)
          qml.PhaseDamping(0.3, wires=0)
          qml.RY(w2[0][0][1], wires=1)
          qml.PhaseDamping(0.3, wires=1)
          return qml.expval(qml.PauliZ(0))
  
      w1 = np.random.random(2)
      w2 = np.random.random((1, 1, 2))
  
      assert np.allclose(f1(w1, w2), f2(w1, w2))
  
imports: from functools import partial
  import numpy
  import pytest
  import pennylane
  from pennylane.measurements import Expectation
  from pennylane.tape import QuantumScript
  from pennylane.transforms.insert_ops import insert
label_desc: Use image node_id 4 for calling a global function with example usage: test_insert_template() and returns: qml, qml