docstr: Test sample-only measurements raise a notimplementedError.
docstr_tok: ["Test","sample-only","measurements","raise","a","notimplementedError","."]
code: def test_sample_based_observable(self):
      """Test sample-only measurements raise a notimplementedError."""
  
      state = 0.5 * np.ones((2, 2))
      with pytest.raises(NotImplementedError):
          _ = measure(qml.sample(wires=0), state)
  
imports: import pytest
  import numpy
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane.devices.qubit import simulate
  from pennylane.devices.qubit.measure import measure, state_diagonalizing_gates, csr_dot_products, full_dot_products, get_measurement_function, sum_of_terms_method
label_desc: Use image node_id 1 for calling the TestCurrentlyUnsupportedCases obj's underlying member method code with example usage: obj.test_sample_based_observable() without return types