class_docstr: Test the support for executing tapes with multiple different
  measurements using a device with shot vectors
class_docstr_tok: ["Test","the","support","for","executing","tapes","with","multiple","different","measurements","using","a","device","with","shot","vectors"]
docstr: Test probs and counts measurements.
docstr_tok: ["Test","probs","and","counts","measurements","."]
code: def test_probs_counts(self, shot_vector, sample_obs, device):
      """Test probs and counts measurements."""
      dev = qml.device(device, wires=3, shots=shot_vector)
      raw_shot_vector = [
          shot_tuple.shots
          for shot_tuple in dev.shots.shot_vector
          for _ in range(shot_tuple.copies)
      ]
  
      meas1_wires = [0, 1]
      meas2_wires = [2]
  
      @qml.qnode(device=dev)
      def circuit(x):
          qml.Hadamard(wires=[0])
          qml.CRX(x, wires=[0, 1])
          if sample_obs is not None:
              # Observable provided to sample
              return qml.probs(wires=meas1_wires), qml.counts(
                  sample_obs(meas2_wires)
              )
  
          # Only wires provided to sample
          return qml.probs(wires=meas1_wires), qml.counts(
              wires=meas2_wires
          )
  
      qnode = qml.QNode(circuit, dev)
      qnode.construct([0.5], {})
      res = qml.execute(
          tapes=[qnode.tape], device=dev, gradient_fn=None
      )
  
      all_shots = sum(
          shot_tuple.copies for shot_tuple in dev.shots.shot_vector
      )
  
      assert isinstance(res[0], tuple)
      assert len(res[0]) == all_shots
      assert all(isinstance(r, tuple) for r in res[0])
      assert all(
          isinstance(measurement_res[0], (np.ndarray, np.float64))
          for measurement_res in res[0]
      )
      assert all(
          isinstance(measurement_res[1], dict)
          for measurement_res in res[0]
      )
  
      expected_outcomes = (
          {-1, 1} if sample_obs is not None else {"0", "1"}
      )
      for idx, shots in enumerate(raw_shot_vector):
          for i, r in enumerate(res[0][idx]):
              if i % 2 == 0:
                  expected_shape = (len(meas1_wires) ** 2,)
                  assert r.shape == expected_shape
  
                  # Probs add up to 1
                  assert np.allclose(sum(r), 1)
              else:
                  # Samples are -1 or 1
                  assert set(r.keys()).issubset(expected_outcomes)
                  assert sum(r.values()) == shots
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementProcess
label_desc: Use image node_id 7 for calling the TestMixMeasurementsShotVector obj's underlying member method code with example usage: obj.test_probs_counts(shot_vector, sample_obs, device) and returns: qml,  qml, qml,  qml