class_docstr: Tests for annotating the return types of the statistics functions
class_docstr_tok: ["Tests","for","annotating","the","return","types","of","the","statistics","functions"]
docstr: Test that a UserWarning is raised if the provided
  argument might not be hermitian.
docstr_tok: ["Test","that","a","UserWarning","is","raised","if","the","provided","argument","might","not","be","hermitian","."]
code: def test_not_an_observable(
      self, stat_func, return_type
  ):  # pylint: disable=unused-argument
      """Test that a UserWarning is raised if the provided
      argument might not be hermitian."""
      if stat_func is sample:
          pytest.skip(
              "Sampling is not yet supported with symbolic operators."
          )
  
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit():
          qml.RX(0.52, wires=0)
          return stat_func(qml.prod(qml.PauliX(0), qml.PauliZ(0)))
  
      with pytest.warns(
          UserWarning, match="Prod might not be hermitian."
      ):
          _ = circuit()
  
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 5 for calling the TestStatisticsQueuing obj's underlying member method code with example usage: obj.test_not_an_observable(stat_func, return_type) and returns: stat_func