code: def test_example_shots():
      """Test that the optimizer works with finite shots."""
      hamiltonian = qml.Hamiltonian(
          coeffs=[-1.0] * 3,
          observables=[
              qml.PauliX(0),
              qml.PauliZ(1),
              qml.PauliY(0) @ qml.PauliX(1),
          ],
      )
  
      @qml.qnode(
          qml.device("default.qubit", wires=2, shots=1000),
          diff_method=None,
      )
      def quant_fun():
          qml.RX(0.1, wires=[0])
          qml.RY(0.5, wires=[1])
          qml.CNOT(wires=[0, 1])
          qml.RY(0.6, wires=[0])
          return qml.expval(hamiltonian)
  
      opt = RiemannianGradientOptimizer(
          circuit=quant_fun, stepsize=0.1, exact=False
      )
  
      for _ in range(3):
          opt.step_and_cost()
  
file_path: pennylane/tests/optimize/test_riemannian_gradient_optimizer.py
imports: import pytest
  from scipy.sparse.linalg import expm
  import numpy
  import pennylane
  from pennylane.optimize import RiemannianGradientOptimizer
label_desc: Use image node_id 15 for calling a global function with example usage: test_example_shots() and returns: qml