code: def check_ref_counts():
      yield
  
      import gc
  
      gc.collect()
  
      sess = get_default_session()
      assert len(sess._get_ref_counts()) == 0
  
imports: from typing import NamedTuple
  import numpy
  import pytest
  import pandas
  from ....None import dataframe
  from ....config import option_context
  from ....session import get_default_session
  from ....tests.core import require_cudf, require_cupy
  from ....utils import lazy_import, pd_release_version
  from ...None import CustomReduction, NamedAgg
  from ...base import to_gpu
label_desc: Use image node_id 1 for calling a global function with example usage: check_ref_counts() without return types