class_docstr: Tests for the SampleMeasurement class.
class_docstr_tok: ["Tests","for","the","SampleMeasurement","class","."]
docstr: Test the execution of a custom sampled measurement.
code: def test_custom_sample_measurement(self, device):
      """Test the execution of a custom sampled measurement."""
  
      dev = device(2)
      _skip_test_for_braket(dev)
  
      if dev.shots is None:
          pytest.skip(
              "Shots must be specified in the device to compute a sampled measurement."
          )
  
      class MyMeasurement(SampleMeasurement):
          """Dummy sampled measurement."""
  
          def process_samples(
              self, samples, wire_order, shot_range=None, bin_size=None
          ):
              return 1
  
      @qml.qnode(dev)
      def circuit():
          qml.PauliX(0)
          return MyMeasurement(wires=[0]), MyMeasurement(wires=[1])
  
      res = circuit()
      assert qml.math.allequal(res, [1, 1])
  
imports: import pytest
  from flaky import flaky
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane import numpy
  from pennylane.measurements import ClassicalShadowMP, MeasurementTransform, SampleMeasurement, SampleMP, StateMeasurement, StateMP
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(device) and returns: MyMeasurement,  MyMeasurement, int