code: def test_bad_eigenvalues_order():
      """Test that an error is raised if the order of eigenvalues does not match the diagonalizing gates."""
  
      class BadEigenDecomp(qml.PauliX):
          @staticmethod
          def compute_eigvals():
              return [-1, 1]
  
      with pytest.raises(
          AssertionError,
          match=r"eigenvalues and diagonalizing gates must be able to",
      ):
          assert_valid(BadEigenDecomp(0), skip_pickle=True)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.operation import Operator
  from pennylane.ops.functions import assert_valid
label_desc: Use image node_id 2 for calling a global function with example usage: test_bad_eigenvalues_order() and returns: list