code: def test_private_circuit(circuit, params, gates, energy_ref):
      r"""Test that _circuit returns the correct output."""
      # pylint: disable=protected-access
      qnode = qml.QNode(qml.AdaptiveOptimizer._circuit, dev)
      energy = qnode(params, gates, circuit.func)
      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 2 for calling a global function with example usage: test_private_circuit(circuit, params, gates, energy_ref) without return types