code: def test_set_with_shots_class():
      """Test that shots can be set on the old device interface with a Shots class."""
  
      dev = qml.devices.DefaultQubitLegacy(wires=1)
      with set_shots(dev, Shots(10)):
          assert dev.shots == 10
  
      assert dev.shots is None
  
      shot_tuples = Shots((10, 10))
      with set_shots(dev, shot_tuples):
          assert dev.shots == 20
          assert dev.shot_vector == list(shot_tuples.shot_vector)
  
      assert dev.shots is None
  
imports: import pytest
  import pennylane
  from pennylane.workflow import set_shots
  from pennylane.measurements import Shots
label_desc: Use image node_id 2 for calling a global function with example usage: test_set_with_shots_class() without return types