code: def test_batched_counts_and_expval_no_op_finite_shots(
      interface, wires, basis_states, mocker
  ):
      """Check all interfaces with computational basis state counts and
      finite shot"""
      n_shots = 10
      dev = qml.device("default.qubit.legacy", wires=3, shots=n_shots)
      spy = mocker.spy(qml.QubitDevice, "sample")
  
      @qml.qnode(dev, interface=interface)
      def circuit():
          qml.pow(qml.PauliX(1), z=[1, 2])
          return qml.counts(wires=wires), qml.expval(qml.PauliZ(0))
  
      res = circuit()
      assert isinstance(res, tuple) and len(res) == 2
      assert res[0] == type(res[0])(
          [{basis_state: n_shots} for basis_state in basis_states]
      )
      assert len(res[1]) == 2 and qml.math.allequal(res[1], 1)
  
      custom_measurement_process(dev, spy)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import Counts
  from pennylane.operation import Operator
label_desc: Use image node_id 4 for calling a global function with example usage: test_batched_counts_and_expval_no_op_finite_shots(interface, wires, basis_states, mocker) and returns: qml,  qml