
    siS                    j    S r SSKJr  SSKrSSKrSSKJr  \(       a  SSKJrJ	r	  SSKJ
r
  S rS	S jrg)
z,Replacements for parts of the toolz library.    )annotationsN)TYPE_CHECKING)	GeneratorSequence)Anyc                    [         R                  " [        5      n[        R                  " X5       H  u  p4X#   R                  U5        M     [        U5      $ )zhA `toolz`-style groupby implementation.

Returns a dictionary of { key: [group] } instead of iterators.
)collectionsdefaultdictlist	itertoolsgroupbyextenddict)keyfuncsequenceresultkeygroups        6lib/python3.13/site-packages/conda/common/iterators.pygroupby_to_dictr      sE    
 $$T*F'':
5! ;<    c              #  N   ^#    [        5       mU4S jU  5        Sh  vN   g N7f)zdA `toolz` inspired `unique` implementation.

Returns a generator of unique elements in the sequence
c              3  h   >#    U  H'  nUT;  d  M  TR                  U5      =(       d    Uv   M)     g 7f)N)add).0elementseens     r   	<genexpr>unique.<locals>.<genexpr>!   s5        G$ 	%$W$s   
2!2N)set)r   r   s    @r   uniquer!      s(     
 UD    s   %#%)r   zSequence[Any]returnzGenerator[Any, None, None])__doc__
__future__r   r	   r   typingr   collections.abcr   r   r   r   r!    r   r   <module>r(      s)    3 "    3r   