code: def test_alive_gc_derived(capture):
      class Derived(m.Parent):
          pass
  
      n_inst = ConstructorStats.detail_reg_inst()
      p = Derived()
      p.addChildKeepAlive(m.Child())
      assert ConstructorStats.detail_reg_inst() == n_inst + 2
      lst = [p]
      lst.append(lst)  # creates a circular reference
      with capture:
          del p, lst
          assert ConstructorStats.detail_reg_inst() == n_inst
      assert (
          capture
          == """
          Releasing parent.
          Releasing child.
      """
      )
  
file_path: coremltools/deps/pybind11/tests/test_call_policies.py
imports: import pytest
  import env
  from pybind11_tests import ConstructorStats
  from pybind11_tests import call_policies
label_desc: Use image node_id 4 for calling a global function with example usage: test_alive_gc_derived(capture) without return types