class_docstr: Test working cases of stoch_pulse_grad.
class_docstr_tok: ["Test","working","cases","of","stoch_pulse_grad","."]
docstr: Tests that the shots attribute is copied to the new tapes
docstr_tok: ["Tests","that","the","shots","attribute","is","copied","to","the","new","tapes"]
code: def test_shots_attribute(
      self, dev_name, shots
  ):  # pylint:disable=unused-argument
      """Tests that the shots attribute is copied to the new tapes"""
      tape = qml.tape.QuantumTape(
          [],
          [qml.expval(qml.PauliZ(0)), qml.probs([1, 2])],
          shots=shots,
      )
      with pytest.warns(
          UserWarning,
          match="Attempted to compute the gradient of a tape with no",
      ):
          tapes, _ = stoch_pulse_grad(tape)
  
      assert all(new_tape.shots == tape.shots for new_tape in tapes)
  
imports: import warnings
  import copy
  import pytest
  import numpy
  import pennylane
  from pennylane.gradients.general_shift_rules import eigvals_to_frequencies, generate_shift_rule
  from pennylane.gradients.pulse_gradient import _parshift_and_integrate, _split_evol_ops, _split_evol_tape, stoch_pulse_grad
label_desc: Use image node_id 15 for calling the TestStochPulseGrad obj's underlying member method code with example usage: obj.test_shots_attribute(dev_name, shots) without return types