code: def test_batched_counts_and_expval_operator_finite_shots(interface):
      """Check all interfaces with observable measurement counts, batching and finite shots"""
      n_shots = 10
      dev = qml.device("default.qubit", wires=3, shots=n_shots)
  
      @qml.qnode(dev, interface=interface)
      def circuit():
          qml.pow(qml.PauliX(0), z=[1, 2])
          return qml.counts(qml.PauliZ(0)), qml.expval(qml.PauliZ(0))
  
      res = circuit()
      assert isinstance(res, tuple) and len(res) == 2
      assert res[0] == type(res[0])([{-1: n_shots}, {1: n_shots}])
      assert len(res[1]) == 2 and qml.math.allequal(res[1], [-1, 1])
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane.measurements import AllCounts, Counts, CountsMP
  from pennylane.wires import Wires
label_desc: Use image node_id 5 for calling a global function with example usage: test_batched_counts_and_expval_operator_finite_shots(interface) and returns: qml,  qml