class_docstr: Sample-based measurement process.
  
  Any class inheriting from ``SampleMeasurement`` should define its own ``process_samples`` method,
  which should have the following arguments:
  
  * samples (Sequence[complex]): computational basis samples generated for all wires
  * wire_order (Wires): wires determining the subspace that ``samples`` acts on
  * shot_range (tuple[int]): 2-tuple of integers specifying the range of samples
      to use. If not specified, all samples are used.
  * bin_size (int): Divides the shot range into bins of size ``bin_size``, and
      returns the measurement statistic separately over each bin. If not
      provided, the entire shot range is treated as a single bin.
  
  **Example:**
  
  Let's create a measurement that returns the sum of all samples of the given wires.
  
  >>> class MyMeasurement(SampleMeasurement):
  ...     def process_samples(self, samples, wire_order, shot_range=None, bin_size=None):
  ...         return qml.math.sum(samples[..., self.wires])
  
  We can now execute it in a QNode:
  
  >>> dev = qml.device("default.qubit", wires=2, shots=1000)
  >>> @qml.qnode(dev)
  ... def circuit():
  ...     qml.PauliX(0)
  ...     return MyMeasurement(wires=[0]), MyMeasurement(wires=[1])
  >>> circuit()
  (tensor(1000, requires_grad=True), tensor(0, requires_grad=True))
class_docstr_tok: ["Sample-based","measurement","process",".","Any","class","inheriting","from","``","SampleMeasurement","``","should","define","its","own","``","process_samples","``","method",",","which","should","have","the","following","arguments",":","*","samples","(","Sequence","[","complex","]",")",":","computational","basis","samples","generated","for","all","wires","*","wire_order","(","Wires",")",":","wires","determining","the","subspace","that","``","samples","``","acts","on","*","shot_range","(","tuple","[","int","]",")",":","2-tuple","of","integers","specifying","the","range","of","samples","to","use",".","If","not","specified",",","all","samples","are","used",".","*","bin_size","(","int",")",":","Divides","the","shot","range","into","bins","of","size","``","bin_size","``",",","and","returns","the","measurement","statistic","separately","over","each","bin",".","If","not","provided",",","the","entire","shot","range","is","treated","as","a","single","bin",".","*","*","Example",":","*","*","Let","'s","create","a","measurement","that","returns","the","sum","of","all","samples","of","the","given","wires",".",">",">",">","class","MyMeasurement","(","SampleMeasurement",")",":","...","def","process_samples","(","self",",","samples",",","wire_order",",","shot_range=None",",","bin_size=None",")",":","...","return","qml.math.sum","(","samples","[","...",",","self.wires","]",")","We","can","now","execute","it","in","a","QNode",":",">",">",">","dev","=","qml.device","(","``","default.qubit","''",",","wires=2",",","shots=1000",")",">",">",">","@","qml.qnode","(","dev",")","...","def","circuit","(",")",":","...","qml.PauliX","(","0",")","...","return","MyMeasurement","(","wires=","[","0","]",")",",","MyMeasurement","(","wires=","[","1","]",")",">",">",">","circuit","(",")","(","tensor","(","1000",",","requires_grad=True",")",",","tensor","(","0",",","requires_grad=True",")",")"]
docstr: Calculate the measurement given a counts histogram dictionary.
  
  Args:
      counts (dict): a dictionary matching the format returned by :class:`~.CountsMP`
      wire_order (Wires): the wire order used in producing the counts
  
  Note that the input dictionary may only contain states with non-zero entries (``all_outcomes=False``).
code: def process_counts(self, counts: dict, wire_order: Wires):
      """Calculate the measurement given a counts histogram dictionary.
  
      Args:
          counts (dict): a dictionary matching the format returned by :class:`~.CountsMP`
          wire_order (Wires): the wire order used in producing the counts
  
      Note that the input dictionary may only contain states with non-zero entries (``all_outcomes=False``).
      """
      raise NotImplementedError
  
imports: import copy
  import functools
  from warnings import warn
  from abc import ABC, abstractmethod
  from enum import Enum
  from typing import Sequence, Tuple, Optional, Union
  import pennylane
  from pennylane.operation import Operator, DecompositionUndefinedError, EigvalsUndefinedError
  from pennylane.pytrees import register_pytree
  from pennylane.typing import TensorLike
  from pennylane.wires import Wires
  from .shots import Shots
label_desc: Use image node_id 2 for calling the SampleMeasurement obj's underlying member method code with example usage: obj.process_counts(counts, wire_order) without return types