
    qi                         d Z ddlZddlZddlZ ej                  ej
                        Z ej                         Z ej
                         Z	 ej                         Z
defdZdefdZy)zUtility functions for object identification and counting.

This module provides thread-safe utilities for generating unique identifiers
and maintaining per-class instance counts across the Pipecat framework.
    Nreturnc                  X    t         5  t        t              cddd       S # 1 sw Y   yxY w)zGenerate a unique id for an object.

    Returns:
        A unique integer identifier that increments globally across all objects.
    N)_ID_LOCKnext_ID     E/opt/pipecat/venv/lib/python3.12/site-packages/pipecat/utils/utils.pyobj_idr      s#     
 Cy  s    )c                     t         5  t        t        | j                  j                           cddd       S # 1 sw Y   yxY w)zGenerate a unique count for an object based on its class.

    Args:
        obj: The object instance to count.

    Returns:
        A unique integer count that increments per class type.
    N)_COUNTS_LOCKr   _COUNTS	__class____name__)objs    r
   	obj_countr   !   s3     
 5GCMM22345 5 5s	   &7A )__doc__collections	itertools	threadingdefaultdictcountr   Lockr   r   r   intr   r   r   r	   r
   <module>r      sm      
!+
!
!)//
2y~~ioo9>> 
5c 
5r	   