class_docstr: Tests of input validation and output correctness of function `generate_shift_rule`.
class_docstr_tok: ["Tests","of","input","validation","and","output","correctness","of","function","`","generate_shift_rule","`","."]
docstr: Tests ValueError is raised if specified shifts is not of the same length as
  `frequencies`, or if shifts are non-unique.
code: def test_invalid_shifts(self):
      """Tests ValueError is raised if specified shifts is not of the same length as
      `frequencies`, or if shifts are non-unique."""
  
      frequencies = (1, 4, 5, 6)
      invalid_shifts_num = (np.pi / 8, 3 * np.pi / 8, 5 * np.pi / 8)
      non_unique_shifts = (
          np.pi / 8,
          3 * np.pi / 8,
          5 * np.pi / 8,
          np.pi / 8,
      )
  
      assert pytest.raises(
          ValueError,
          generate_shift_rule,
          frequencies,
          invalid_shifts_num,
      )
      assert pytest.raises(
          ValueError,
          generate_shift_rule,
          frequencies,
          non_unique_shifts,
      )
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.gradients.general_shift_rules import eigvals_to_frequencies, frequencies_to_period, generate_shift_rule, _get_shift_rule, generate_multi_shift_rule, generate_shifted_tapes, generate_multishifted_tapes, _iterate_shift_rule_with_multipliers
label_desc: Use image node_id 2 for calling the TestGenerateShiftRule obj's underlying member method code with example usage: obj.test_invalid_shifts() without return types