class_docstr: Test the support for executing tapes with single measurements using a
  device with shot vectors.
class_docstr_tok: ["Test","the","support","for","executing","tapes","with","single","measurements","using","a","device","with","shot","vectors","."]
docstr: Test the sample measurement.
docstr_tok: ["Test","the","sample","measurement","."]
code: def test_samples(self, shot_vector, measurement, device):
      """Test the sample measurement."""
      dev = qml.device(device, wires=2, shots=shot_vector)
  
      def circuit(x):
          qml.Hadamard(wires=[0])
          qml.CRX(x, wires=[0, 1])
          return qml.apply(measurement)
  
      qnode = qml.QNode(circuit, dev)
      qnode.construct([0.5], {})
  
      res = qml.execute(
          tapes=[qnode.tape], device=dev, gradient_fn=None
      )
  
      all_shot_copies = [
          shot_tuple.shots
          for shot_tuple in dev.shots.shot_vector
          for _ in range(shot_tuple.copies)
      ]
  
      assert len(res[0]) == len(all_shot_copies)
      for r, shots in zip(res[0], all_shot_copies):
          if shots == 1:
              # Scalar tensors
              assert r.shape == ()
          else:
              assert r.shape == (shots,)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementProcess
label_desc: Use image node_id 4 for calling the TestShotVector obj's underlying member method code with example usage: obj.test_samples(shot_vector, measurement, device) and returns: qml