code: def _count_prompt_session_instances() -> int:
      # Run full GC collection first.
      gc.collect()
  
      # Count number of remaining referenced `PromptSession` instances.
      objects = gc.get_objects()
      return len(
          [obj for obj in objects if isinstance(obj, PromptSession)]
      )
  
imports: from __future__ import annotations
  import gc
  import pytest
  from prompt_toolkit.shortcuts.prompt import PromptSession
label_desc: Use image node_id 1 for calling a global function with example usage: _count_prompt_session_instances() and returns: len