class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test that the shape is correct with the shot vector and a observable too.
docstr_tok: ["Test","that","the","shape","is","correct","with","the","shot","vector","and","a","observable","too","."]
code: def test_shape_shot_vector_obs(self):
      """Test that the shape is correct with the shot vector and a observable too."""
      shot_vec = (2, 2)
      dev = qml.device("default.qubit.legacy", wires=3, shots=shot_vec)
  
      @qml.qnode(dev)
      def circuit():
          qml.Hadamard(wires=0)
          qml.PauliZ(0)
          return qml.sample(qml.PauliZ(0))
  
      binned_samples = circuit()
  
      assert isinstance(binned_samples, tuple)
      assert len(binned_samples) == len(shot_vec)
      # pylint: disable=unsubscriptable-object
      assert binned_samples[0].shape == (shot_vec[0],)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementShapeError, Sample, Shots, MeasurementValue
  from pennylane.operation import Operator
label_desc: Use image node_id 19 for calling the TestSample obj's underlying member method code with example usage: obj.test_shape_shot_vector_obs() and returns: qml