class_docstr: Tests for the SampleMeasurement class.
class_docstr_tok: ["Tests","for","the","SampleMeasurement","class","."]
docstr: Test the execution of a custom sampled measurement.
docstr_tok: ["Test","the","execution","of","a","custom","sampled","measurement","."]
code: def test_custom_sample_measurement(self):
      """Test the execution of a custom sampled measurement."""
  
      class MyMeasurement(SampleMeasurement):
          # pylint: disable=signature-differs
          def process_samples(
              self, samples, wire_order, shot_range=None, bin_size=None
          ):
              return qml.math.sum(samples[..., self.wires])
  
      dev = qml.device("default.qubit", wires=2, shots=1000)
  
      @qml.qnode(dev)
      def circuit():
          qml.PauliX(0)
          return MyMeasurement(wires=[0]), MyMeasurement(wires=[1])
  
      assert qml.math.allequal(circuit(), [1000, 0])
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import ClassicalShadowMP, Counts, CountsMP, Expectation, ExpectationMP, MeasurementProcess, MeasurementTransform, MeasurementValue, MidMeasure, MidMeasureMP, MutualInfoMP, PurityMP, Probability, ProbabilityMP, Sample, SampleMeasurement, SampleMP, ShadowExpvalMP, Shots, State, StateMeasurement, StateMP, Variance, VarianceMP, VnEntropyMP, expval, sample, var
  from pennylane.operation import DecompositionUndefinedError
  from pennylane.queuing import AnnotatedQueue
  from pennylane.wires import Wires
label_desc: Use image node_id 1 for calling the TestSampleMeasurement obj's underlying member method code with example usage: obj.test_custom_sample_measurement() and returns: MyMeasurement,  MyMeasurement, qml