code: def test_symmetry_generators(symbols, geometry, res_generators):
      r"""Test that symmetry_generators returns the correct result."""
  
      mol = qml.qchem.Molecule(symbols, geometry)
      hamiltonian = qml.qchem.diff_hamiltonian(mol)()
      generators = qml.symmetry_generators(hamiltonian)
  
      for g1, g2 in zip(generators, res_generators):
          assert g1.compare(g2)
  
      # test arithmetic op compatibility:
      hamiltonian_as_op = pauli_sentence(hamiltonian).operation()
      assert not isinstance(hamiltonian_as_op, qml.Hamiltonian)
  
      enable_new_opmath()
      generators = qml.symmetry_generators(hamiltonian_as_op)
      disable_new_opmath()
  
      for g1, g2 in zip(generators, res_generators):
          assert not isinstance(
              g1, qml.Hamiltonian
          )  # just confirming we are not relying on Hamiltonians any more
          assert pauli_sentence(g1) == pauli_sentence(g2)
  
imports: import functools
  import pytest
  import scipy
  import pennylane
  from pennylane import numpy
  from pennylane.pauli import pauli_sentence
  from pennylane.qchem.tapering import _kernel, _reduced_row_echelon, clifford, optimal_sector, taper_hf, taper_operation, _split_pauli_sentence, _taper_pauli_sentence
  from pennylane.operation import enable_new_opmath, disable_new_opmath
label_desc: Use image node_id 4 for calling a global function with example usage: test_symmetry_generators(symbols, geometry, res_generators) without return types