code: def test_shape_unrecognized_error():
      """Test that querying the shape of a measurement process with an
      unrecognized return type raises an error."""
      dev = qml.device("default.qubit.legacy", wires=2)
      mp = NotValidMeasurement()
      with pytest.raises(
          qml.QuantumFunctionError,
          match="The shape of the measurement NotValidMeasurement is not defined",
      ):
          mp.shape(dev, Shots(None))
  
file_path: pennylane/tests/measurements/legacy/test_measurements_legacy.py
imports: import pytest
  import pennylane
  from pennylane.measurements import ClassicalShadowMP, MeasurementProcess, MeasurementTransform, SampleMeasurement, SampleMP, Shots, StateMeasurement, StateMP, expval, var
label_desc: Use image node_id 2 for calling a global function with example usage: test_shape_unrecognized_error() without return types