code: def test_multi_mcm_stats_same_wire(mp, compose_mv):
      """Test that a tape collecting statistics on multiple mid-circuit measurements when
      they measure the same wire is transformed correctly."""
      mp1 = MidMeasureMP(0, id="foo")
      mp2 = MidMeasureMP(0, id="bar")
      mv1 = MeasurementValue([mp1], None)
      mv2 = MeasurementValue([mp2], None)
  
      mv = mv1 * mv2 if compose_mv else [mv1, mv2]
      tape = qml.tape.QuantumScript(
          [qml.PauliX(0), mp1, mp2], [mp(op=mv)], shots=10
      )
      [deferred_tape], _ = qml.defer_measurements(tape)
  
      emp1 = MidMeasureMP(1, id="foo")
      emp2 = MidMeasureMP(2, id="bar")
      emv1 = MeasurementValue([emp1], None)
      emv2 = MeasurementValue([emp2], None)
      emv = emv1 * emv2 if compose_mv else [emv1, emv2]
  
      assert deferred_tape.operations == [
          qml.PauliX(0),
          qml.CNOT([0, 1]),
          qml.CNOT([0, 2]),
      ]
      assert deferred_tape.measurements == [mp(op=emv)]
  
imports: import math
  import pytest
  import pennylane
  from pennylane.measurements import MidMeasureMP, MeasurementValue
  import pennylane.numpy
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 4 for calling a global function with example usage: test_multi_mcm_stats_same_wire(mp, compose_mv) without return types