class_docstr: Measurement process that computes the expectation value of the supplied observable.
  
  Please refer to :func:`expval` for detailed documentation.
  
  Args:
      obs (Union[.Operator, .MeasurementValue]): The observable that is to be measured
          as part of the measurement process. Not all measurement processes require observables
          (for example ``Probability``); this argument is optional.
      wires (.Wires): The wires the measurement process applies to.
          This can only be specified if an observable was not provided.
      eigvals (array): A flat array representing the eigenvalues of the measurement.
          This can only be specified if an observable was not provided.
      id (str): custom label given to a measurement instance, can be useful for some applications
          where the instance has to be identified
code: def process_samples(
      self,
      samples: Sequence[complex],
      wire_order: Wires,
      shot_range: Tuple[int] = None,
      bin_size: int = None,
  ):
      # estimate the ev
      op = self.mv if self.mv is not None else self.obs
      with qml.queuing.QueuingManager.stop_recording():
          samples = qml.sample(op=op).process_samples(
              samples=samples,
              wire_order=wire_order,
              shot_range=shot_range,
              bin_size=bin_size,
          )
  
      # With broadcasting, we want to take the mean over axis 1, which is the -1st/-2nd with/
      # without bin_size. Without broadcasting, axis 0 is the -1st/-2nd with/without bin_size
      axis = -1 if bin_size is None else -2
      # TODO: do we need to squeeze here? Maybe remove with new return types
      return qml.math.squeeze(qml.math.mean(samples, axis=axis))
  
file_path: pennylane/pennylane/measurements/expval.py
imports: import warnings
  from typing import Sequence, Tuple, Union
  import pennylane
  from pennylane.operation import Operator
  from pennylane.wires import Wires
  from .measurements import Expectation, SampleMeasurement, StateMeasurement
  from .mid_measure import MeasurementValue
label_desc: Use image node_id 4 for calling the ExpectationMP obj's underlying member method code with example usage: obj.process_samples(samples, wire_order, shot_range, bin_size) and returns: qml