code: def test_adjoint_reuse_device_state(mocker, interface):
      """Tests that the jax interface reuses the device state for adjoint differentiation"""
      dev = qml.device("default.qubit.legacy", wires=1)
  
      @qnode(dev, interface=interface, diff_method="adjoint")
      def circ(x):
          qml.RX(x, wires=0)
          return qml.expval(qml.PauliZ(0))
  
      spy = mocker.spy(dev, "adjoint_jacobian")
  
      jax.grad(circ)(1.0)
      assert circ.device.num_executions == 1
  
      spy.assert_called_with(mocker.ANY, use_device_state=True)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 1 for calling a global function with example usage: test_adjoint_reuse_device_state(mocker, interface) and returns: qml