code: def test_step(circuit, energy_ref, pool):
      """Test that step function returns the correct cost."""
      opt = qml.AdaptiveOptimizer()
      circuit = opt.step(circuit, pool)
      energy = circuit()
      assert np.allclose(energy, energy_ref)
  
file_path: pennylane/tests/optimize/test_adaptive.py
imports: import copy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: test_step(circuit, energy_ref, pool) without return types