class_docstr: Tests for the sample function
class_docstr_tok: ["Tests","for","the","sample","function"]
docstr: Test the return type and shape of sampling multiple works
  in combination with expvals and vars
docstr_tok: ["Test","the","return","type","and","shape","of","sampling","multiple","works","in","combination","with","expvals","and","vars"]
code: def test_sample_output_type_in_combination(self, mocker):
      """Test the return type and shape of sampling multiple works
      in combination with expvals and vars"""
      n_sample = 10
  
      dev = qml.device("default.qubit.legacy", wires=3, shots=n_sample)
      spy = mocker.spy(qml.QubitDevice, "sample")
  
      @qml.qnode(dev, diff_method="parameter-shift")
      def circuit():
          return (
              qml.expval(qml.PauliZ(0)),
              qml.var(qml.PauliZ(1)),
              qml.sample(qml.PauliZ(2)),
          )
  
      result = circuit()
  
      # If all the dimensions are equal the result will end up to be a proper rectangular array
      assert len(result) == 3
      assert isinstance(result[0], np.ndarray)
      assert isinstance(result[1], np.ndarray)
      assert result[2].dtype == np.dtype("int")
      assert np.array_equal(result[2].shape, (n_sample,))
  
      custom_measurement_process(dev, spy)
  
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 8 for calling the TestSample obj's underlying member method code with example usage: obj.test_sample_output_type_in_combination(mocker) and returns: qml,  qml,  qml