code: def test_shape_new(shots, shape):
      """Test the ``shape_new`` method."""
      meas = qml.purity(wires=0)
      dev = qml.device("default.qubit.legacy", wires=1, shots=shots)
      assert meas.shape(dev, Shots(shots)) == shape
  
file_path: pennylane/tests/measurements/legacy/test_purity_measurement_legacy.py
imports: import pytest
  import numpy
  import pennylane
  from pennylane.measurements import Shots
label_desc: Use image node_id 3 for calling a global function with example usage: test_shape_new(shots, shape) without return types