code: def test_insert_decorator_causes_custom_insert_error_non_qwc_obs():
      """Test that the insert transform catches and reports errors from the enclosed function."""
  
      # pylint: disable=unused-argument
  
      def noise(noise_param, wires):
          qml.CRX(noise_param, wires=[0, 1])
          qml.CNOT(wires=[1, 0])
  
      dev = qml.device("default.mixed", wires=2)
  
      @qml.qnode(dev)
      @partial(insert, op=noise, op_args=0.3, position="all")
      def noisy_circuit(circuit_param):
          qml.RY(circuit_param, wires=0)
          qml.Hadamard(wires=0)
          qml.T(wires=0)
          return (
              qml.expval(qml.PauliX(0)),
              qml.expval(qml.PauliY(0)),
              qml.expval(qml.PauliZ(0)),
          )
  
      # This tape's expansion fails, but shouldn't cause a downstream IndexError. See issue #3103
      with pytest.raises(
          qml.QuantumFunctionError,
          match="The insert transform cannot transform a circuit measuring non-commuting observables",
      ):
          noisy_circuit(0.4)
  
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 5 for calling a global function with example usage: test_insert_decorator_causes_custom_insert_error_non_qwc_obs() and returns: qml,  qml,  qml